Page 1 of 1

SABnzbd can't handle ; (problem with htmlencoded characters)

Posted: December 16th, 2015, 10:31 pm
by jant90
I just noticed SABnzbd has trouble when there is a ";" in the NZB filename, so for example "&" (the html encoded & sign). The job name gets cut off at the ; character. I noticed this when Sonarr sent some NZB's to SABnzbd and the job names got corrupt (and this messed up automation down the line).

While the ; character shouldn't be in filenames in the first place (as NZBGeek shouldn't have encoded the & character in the filename), SABnzbd should be able to handle it just fine as it's not an illegal character.

Coincidentally NZBGeek has the exact same problem, when trying to download their NZB's the filename is cut off right at the ; sign. If they just leave the & in there as they should then there wouldn't be any problems in my automated setup either (other Newznab based services do this, e.g. oznzb), it kinda sucks I just got a NZBGeek VIG subscription because of the positive reviews online.

It's very easy to reproduce, but here is my log either way:

Code: Select all

2015-12-17 02:37:43,637::INFO::[__init__:628] Adding "Family.Guy.S09E15.Brothers.&amp
2015-12-17 02:37:43,640::INFO::[misc:811] Creating directories: C:\Users\Administrator\Downloads\incomplete\`Family.Guy.S09E15.Brothers.&amp
2015-12-17 02:37:43,658::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [01/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.par2" yEnc (1/1) added to queue
2015-12-17 02:37:43,661::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [02/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r00" yEnc (1/69) added to queue
2015-12-17 02:37:43,664::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [03/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r01" yEnc (1/69) added to queue
2015-12-17 02:37:43,667::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [04/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r02" yEnc (1/69) added to queue
2015-12-17 02:37:43,671::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [05/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r03" yEnc (1/69) added to queue
2015-12-17 02:37:43,673::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [06/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r04" yEnc (1/69) added to queue
2015-12-17 02:37:43,676::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [07/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r05" yEnc (1/69) added to queue
2015-12-17 02:37:43,677::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [08/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r06" yEnc (1/69) added to queue
2015-12-17 02:37:43,680::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [09/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r07" yEnc (1/69) added to queue
2015-12-17 02:37:43,684::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [10/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r08" yEnc (1/69) added to queue
2015-12-17 02:37:43,686::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [11/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.r09" yEnc (1/23) added to queue
2015-12-17 02:37:43,687::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [12/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.rar" yEnc (1/69) added to queue
2015-12-17 02:37:43,690::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [13/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol00+01.par2" yEnc (1/2) added to queue
2015-12-17 02:37:43,690::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [14/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol01+02.par2" yEnc (1/3) added to queue
2015-12-17 02:37:43,691::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [15/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol03+04.par2" yEnc (1/5) added to queue
2015-12-17 02:37:43,693::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [16/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol07+08.par2" yEnc (1/9) added to queue
2015-12-17 02:37:43,694::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [17/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol15+16.par2" yEnc (1/17) added to queue
2015-12-17 02:37:43,697::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [18/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol31+32.par2" yEnc (1/33) added to queue
2015-12-17 02:37:43,697::INFO::[nzbstuff:444] File [n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD [19/19] - "[n0crypt]Family.Guy.S09E15.Brothers.&.Sisters.720p.WEB-DL.DD5.1.H.264-BHD.vol63+08.par2" yEnc (1/9) added to queue
2015-12-17 02:37:43,697::INFO::[__init__:584] Backing up C:\Users\Administrator\Downloads\incomplete\`Family.Guy.S09E15.Brothers.&amp\__ADMIN__\"Family.Guy.S09E15.Brothers.&amp.nzb.gz
2015-12-17 02:37:43,698::ERROR::[__init__:591] Saving C:\Users\Administrator\Downloads\incomplete\`Family.Guy.S09E15.Brothers.&amp\__ADMIN__\"Family.Guy.S09E15.Brothers.&amp.nzb.gz failed
2015-12-17 02:37:43,698::INFO::[__init__:592] Traceback: 
Traceback (most recent call last):
  File "sabnzbd\__init__.pyo", line 586, in save_compressed
  File "gzip.pyo", line 95, in __init__
IOError: [Errno 2] No such file or directory: '"Family.Guy.S09E15.Brothers.&amp.nzb.gz'
2015-12-17 02:37:43,779::INFO::[newsunpack:1561] Running pre-queue script ['C:\\Users\\Administrator\\Documents\\SabPostProc\\RemoveObfuscated.exe', '`Family.Guy.S09E15.Brothers.&amp', '', 'sonarr', '', '-1', '616746213', 'alt.binaries.boneless', '`Family Guy', '9', '15', 'Brothers &amp']
2015-12-17 02:37:43,799::INFO::[newsunpack:1583] Pre-Q accepts `Family.Guy.S09E15.Brothers.&amp
2015-12-17 02:37:43,802::INFO::[nzbqueue:218] Saving queue
2015-12-17 02:37:43,805::INFO::[__init__:919] Saving data for queue9.sab in C:\Users\Administrator\AppData\Local\sabnzbd\admin\queue9.sab

Re: SABnzbd can't handle ; (problem with htmlencoded charact

Posted: December 17th, 2015, 3:19 am
by shypike
Confirmed. I will look into it.

*Edit*
This might be difficult to solve. The problem is in the CherryPy web framework that we use.
Adding the file through the watched folder works fine.
The web framework hands down a mutilated file name.

Re: SABnzbd can't handle ; (problem with htmlencoded charact

Posted: December 17th, 2015, 8:02 pm
by jant90
Ah that sucks. It sounded like a simple fix, just escape some characters and be up and running again but if it's that deep rooted in the http server then though luck I guess. But I guess CherryPy developers want to have it fixed too so it will be fixed some day (if they're informed of the problem that is).

I guess for now I just have to manually fix it when this occurs (luckily not that often) and hope it will be fixed sometime.

Thanks for looking into it! :)

Re: SABnzbd can't handle ; (problem with htmlencoded charact

Posted: December 18th, 2015, 2:53 am
by shypike
It's definitely a serious problem in CherryPy.
I filed a complaint at its website, so with a bit of luck it will be solved before 2019.
For the time being, I made a primitive patch that solves this particular problem.
It will be included in Beta4.

Re: SABnzbd can't handle ; (problem with htmlencoded charact

Posted: December 19th, 2015, 1:00 pm
by jant90
Great, thanks! And thank you for all your hard work :).