SABnzbd version: 3.1.1
Running on windows 10.'
I'm using Medusa in combination with Prowlarr.
Prowlarr functions as a newznab indexer. Medusa is getting an url back from prowlarr that downloads the nzb. Medusa sends the url using the Sabnzbd api "addurl" command.
Medusa has been doing this for many years. But only recently when we've added prowlarr support we've started noticing this issue.
The problem here is that the url returned by prowlarr is a valid url. When pasting it in the browser it will download the nzb for you.
This is the request that's being send to sab:
The nzb name is parsed as: `Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb; filename@=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb`
Also the download is created with this name.
Let me know if you need more info.
The issue has been reported by a few Medusa users now. And it can be reproduced when using Medua + prowlarr + sabnzbd
Logs: https://gist.github.com/p0psicles/bd5d4 ... 1a88b92527
Sending nzb through api using api addurl results in bad nzbname
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Sending nzb through api using api addurl results in bad nzbname
Last edited by p0psicles on August 22nd, 2021, 5:32 am, edited 1 time in total.
Re: Sending nzb through api using api addurl results in bad nzbname
I'd like to add some logs and the api request send to sab. But i'm a new user so I can't post links yet. I'll wait until I can update this post.
Re: Sending nzb through api using api addurl results in bad nzbname
I am not sure what is going on here, where it is adding this extra UTF-8 part.
Is this inside the headers or on the NZB file?
I'm not sure I want to setup the whole chain just to check if it's even SABnzbd's problem.. Is there any way I can test it somewhere?
Is this inside the headers or on the NZB file?
I'm not sure I want to setup the whole chain just to check if it's even SABnzbd's problem.. Is there any way I can test it somewhere?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Sending nzb through api using api addurl results in bad nzbname
Sorry I don't understand that question. Or maybe I do? When I upload the NZB manual to sab it's Working fine. So I guess the headers?
I could try run sab on my dev machine in vscode. And get some debugging going on. Then we could do something like a teamviewer. That way you can step through it with the entire chain set up?
Re: Sending nzb through api using api addurl results in bad nzbname
For the info inside the nzb, simply open the file in a text editor and check the metadata (typically near the very top). For the headers, download the nzb from that localhost port 9696 url with some util or browser that displays the http headers, such as the developer console/tool of common browsers (firefox, chromium).
Re: Sending nzb through api using api addurl results in bad nzbname
I've tracked it down to the content-disposition header.
https://imgur.com/a/vQfMif1
value here is:
here:
https://github.com/sabnzbd/sabnzbd/blob ... er.py#L194
It will parse into:
So now it's the discussion is prowlarr at fault, for returning that header. Or sabnzbd for parsing it this freely?
Personally I would use a regex for this. Something like:
I can create a PR if you'd like?
https://imgur.com/a/vQfMif1
value here is:
Code: Select all
attachment; filename=Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb; filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb
https://github.com/sabnzbd/sabnzbd/blob ... er.py#L194
It will parse into:
Code: Select all
Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb; filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb
Personally I would use a regex for this. Something like:
Code: Select all
re.match(r'.*filename=([^=;]+)', value).group(1)
Re: Sending nzb through api using api addurl results in bad nzbname
Thanks for debugging!
It seems Prowlarr is doing things according to the RFC standard, and SABnzbd is wrong:
https://datatracker.ietf.org/doc/html/r ... tion-3.2.2
It seems Prowlarr is doing things according to the RFC standard, and SABnzbd is wrong:
https://datatracker.ietf.org/doc/html/r ... tion-3.2.2
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Sending nzb through api using api addurl results in bad nzbname
Is there something I can do?
Re: Sending nzb through api using api addurl results in bad nzbname
No, I need to fix it!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Sending nzb through api using api addurl results in bad nzbname
I see your going to do a release. Any chance this could get included? I could do a pr today. If you don't have time your self. I would like to provide a solution to my users.
Ow wait you already tagged.
I can still do the pr.
Ow wait you already tagged.
I can still do the pr.
Re: Sending nzb through api using api addurl results in bad nzbname
Sorry I forgot. Yes, can you indeed do a PR?
It should work for all these 3 cases:
It should work for all these 3 cases:
Code: Select all
filename=Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb; filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb
filename=Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb;
filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Sending nzb through api using api addurl results in bad nzbname
Done.
The regex I used should support those three formats. I tested it icw Medusa+prowlarr, and that works
The regex I used should support those three formats. I tested it icw Medusa+prowlarr, and that works