SABnzbd Smart Downloader

Come up with a useful post-processing script? Share it here!
markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

That makes sense,  I'm guessing it's not actually able to hit the queue to do a queue check and make sure that it hasn't already started downloading...

This should fix the issue.

Open SSD.cfg:

Below the line:

Code: Select all

ADD_PARAMS = &cat=tv
Add this line:

Code: Select all

API_KEY = enterkeyhere
also remove &apikey= from the ADD_PARAMS line.

Then copy and paste the post the post the following link into the tv_rss.py file:
http://jqd.org/pastebin?id=257

Make sure you overwrite everything that is already in the tv_rss.py file.

Let me know if this works or not.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

orinoco
Newbie
Newbie
Posts: 8
Joined: April 20th, 2009, 11:45 am

Re: SABnzbd Smart Downloader

Post by orinoco »

Hi, Thanks it looks like below now

009-04-26 19:12:49,146 INFO IS NOT IN QUEUE: xxxxxxxxxxxxxxxxx
2009-04-26 19:12:49,146 INFO ADD QUEUE: 2009-04-26 19:12:49: http://v3.newzbin.com/search/xxxxxx
2009-04-26 19:12:49,147 INFO REPORT_ID: xxxxxxx
2009-04-26 19:12:49,152 INFO PROCESS NZB FEED:
2009-04-26 19:12:49,152 DEBUG FEED: Other



Just opening this in a browser the link is a blank search page, again many thanks for all your help

markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

It looks like it thinks the feed is not a standard Newzbin feed, can you try dropping the v3.newzbin.com and using www.newzbin.com?


This is really odd, never seen so many issues, I'm going to try and run 0.4.9 on my machine and see if that works...might end up having to try it out in OS X and see what happens.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

Alright, couple things. First off the "2009-04-26 19:12:49,146 INFO ADD QUEUE: 2009-04-26 19:12:49: http://v3.newzbin.com/search/xxxxxx" Line is a bug in the way it parses the report_id from the URL (it happens afterwards which causes the whole URL to be posted, not just the report ID), this debug message can be ignored (it is fixed in the trunk version 0.9.4, if you care to upgrade).

The next is a bug in how the password is sent along with an APIKEY, not exactly sure why it freaks SAB out, but there is a message in the cherrypy.log file about it.

So the way around it is to copy and paste the python file contents from the link below and paste it into tv_rss.py (remove everything else of course). I assume you're not using an username and password to access SAB (If you are this script seems to work).

If you're not using a password, then this script should now work, if you're using a password you can un-comment Line 544 and comment out Line 543.

Grab the new tv_rss.py file here:
http://pastebin.com/f7a5ec5a4

This should work at last...

-Markus

EDIT: I modified 0.9.4 to add in support for an API Key, it also already had better support for people NOT using a password (it doesn't try to send a blank username/password, which is logged in cherrypy.log).

So I present 0.9.5, which should be good to get us through the next little bit.

Changes:
Added API Key Support
Better matching for shows that Contain () or ' (Post about it somewhere above).

Known Issues:
If you want CSI, edit the Aliases.cfg file to exclude CSI = xxxxx (ok for Newzbin users, non-newzbin users should leave this) - causes the script to pick up alternatives of this show as the original and do file matching against the original, not the "spin-offs".

It's best to get the files from the SVN that Minimad setup: http://my-svn.assembla.com/svn/SABnzbd_ ... der/trunk/

Then get these files and replace what is already there:

Both in a zip file: http://www.megaupload.com/?d=XNLJYATS


Just get the files in the zip below, Apparently I was using an old version of 0.9.4 (trunk), so some things have changed quite a bit.

Or all files zipped nicely: http://www.megaupload.com/?d=W7620D77

-Markus
Last edited by markus101 on April 27th, 2009, 1:54 am, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

orinoco
Newbie
Newbie
Posts: 8
Joined: April 20th, 2009, 11:45 am

Re: SABnzbd Smart Downloader

Post by orinoco »

Many thanks to Markus101 for all his help getting me setup and running perfectly with this script, all running without any problems on Mac OSX

dirtymurt
Newbie
Newbie
Posts: 8
Joined: April 30th, 2009, 1:36 pm

Re: SABnzbd Smart Downloader

Post by dirtymurt »

anyone had these scripts running under FREEnas?

hi Orinoco? how's things? long time..

pilGrim
Full Member
Full Member
Posts: 116
Joined: January 9th, 2009, 7:28 pm
Location: Hong Kong, SAR China

Re: SABnzbd Smart Downloader

Post by pilGrim »

markus101 wrote:

Grab the new tv_rss.py file here:
http://pastebin.com/f7a5ec5a4


Or all files zipped nicely: http://www.megaupload.com/?d=W7620D77

-Markus
Hey Marcus,

I have been away (work and life getting in the way of my download hobby haha), and I just realized that an upgrade to SAB has killed my old script with the API key.  I see you did some great work to fix, but are the above the same?  I am in Hong Kong and can't download from the megaupload.com link, I get a not available in my area.  Figured I would ask before I try the pastbin version as your msg sounds like the second option is more updated?

Cheers,

markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

Hi PilGrim,

Yes, I'm pretty sure that pastebin link is out-of-date, below I wanted people to ensure they were using the same version of the script I was using, seeing as I wasn't using the latest Trunk version from minimad.

I'll paste the current SSD-TV.py file in pastebin, along with the changes to the config file.

http://pastebin.com/f2637b3cc

This needs to be added to the config file, I added it the the [SABnzbd Config] Section below the Web Access Username & Password:

Code: Select all

# API Key Information
API_KEY_ENABLED = False
API_KEY = af0f33d7e7e50c4db7f7cfd2133083b0
Hope this is helpful,

Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

pilGrim
Full Member
Full Member
Posts: 116
Joined: January 9th, 2009, 7:28 pm
Location: Hong Kong, SAR China

Re: SABnzbd Smart Downloader

Post by pilGrim »

markus101 wrote: Hi PilGrim,

Yes, I'm pretty sure that pastebin link is out-of-date, below I wanted people to ensure they were using the same version of the script I was using, seeing as I wasn't using the latest Trunk version from minimad.

I'll paste the current SSD-TV.py file in pastebin, along with the changes to the config file.

http://pastebin.com/f2637b3cc

This needs to be added to the config file, I added it the the [SABnzbd Config] Section below the Web Access Username & Password:

Code: Select all

# API Key Information
API_KEY_ENABLED = False
API_KEY = af0f33d7e7e50c4db7f7cfd2133083b0
Hope this is helpful,

Markus
Thanks.  It is downloading again, but need to spend some time to check out the changes. 

I still have not gotten American Dad! and CSI to download correctly.  Minimad's alias feature works to find the show, but the dl to the black hole to ensure it is named properly for the unrar and rename, move is still not working right for me.  have you gotten that to work?

markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

CSI works for me, not using the alias though, it started finding all flavors of CSI as the original, which meant I got two shows I didn't want. Using Newzbin so the alias is not needed anyways. Not sure why but I have an issue with Parks and Recreation, the script compares the show to my directory and says not wanted, even though the strings are identical, really odd, but I haven't figured that ones out yet either.

Sorry I can't be more help there, but let me know if you figure it out.

Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

mattgoody
Newbie
Newbie
Posts: 6
Joined: April 19th, 2009, 8:23 pm

Re: SABnzbd Smart Downloader

Post by mattgoody »

Hey guys - great script. im having a problem getting queue checking to work. i use a newzbin rss feed and when smart queue checking is enabled, the script works but queue checking doesnt. Ill get duplicate episodes in the queue if i run the script again before an episode is finished downloading.  However when i turn smart queue checking to false, every show i want gets a FAILED PROCESSING error.  One thing ive noticed is that in the SSD-TV.py file the definition of IsInQueue and IsInQueueSmart both get the queue items from the url my_SAB + "/api?mode=queue&output=xml" + ... while in other areas that line is my_SAB + "/sabnzbd/api?mode=queue&output=xml" + ... Whenever i tinker with any code in those definitions, with the exception of like logger.info("hello"), however i get a FAILED PROCESSING error as well. Anyway i dont know much about python so there could be a simple reason, but i cant for the life of me figure out how to get any type of queue checking to work. Thanks

edit: i just realized that on the trunk version on the my-svn site the /sabnzbd directory is always there, so i guess that must have been something that happened when markus made 0.9.5. anyway as i said when i try to add anything to the script that actually does something other than print a simple string, even if its just printing a variable, i get a FAILED PROCESSING error so i cant figure out how to add the /sabnzbd to the SSD-TV.py file. any help is super welcome. Thanks again

edit2: i downloaded the script from the megaupload link a few posts back incase thats helpful

edit3: i was just reading the api documentation and it says the advanced queue support was added in 0.5 and im running 0.4.9. Is this the issue im having? Must i compile 0.5?
Last edited by mattgoody on May 18th, 2009, 1:04 pm, edited 1 time in total.

markus101
Release Testers
Release Testers
Posts: 413
Joined: August 13th, 2008, 2:51 am

Re: SABnzbd Smart Downloader

Post by markus101 »

You should still be able to view the queue with the old version, they may have changed how it works, but that view was still there. They added the option to get a dump of the History via the API though.

Looking at the script it looks like I was modifying things that didn't need to be adjusted.

SAB 0.5.0+ drops the need for the url to look like this: http://localhost:8080/sabnzbd
and allows it to just be http://localhost:8080

I modified the queue portion when I was working on getting it to work and broke that.

change the following line:

Code: Select all

queue=xml.dom.minidom.parse(urllib.urlopen(my_SAB + "/api?mode=queue&output=xml" + SAB_api_key + my_SAB_web_params))
to:

Code: Select all

queue=xml.dom.minidom.parse(urllib.urlopen(my_SAB + "/sabnzbd/api?mode=queue&output=xml" + SAB_api_key + my_SAB_web_params))
in both isInQueue and isInSmartQueue and that issue should be resolved.

I had issues when trying to debug what was going on too, its very picky where you put print/logger.info lines, usually you just have to move it around until it works (trial and error), unless you know exactly what is happening.

If you find it easier you can copy the contents of the following pastebin link into SSD-TV.py and that will also work.

This should now work for you, thanks for catching this error.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com

mattgoody
Newbie
Newbie
Posts: 6
Joined: April 19th, 2009, 8:23 pm

Re: SABnzbd Smart Downloader

Post by mattgoody »

thanks markus. ill try that after work :-) thanks a ton for the updates and all the help ur providing in this thread

mattgoody
Newbie
Newbie
Posts: 6
Joined: April 19th, 2009, 8:23 pm

Re: SABnzbd Smart Downloader

Post by mattgoody »

lol i cant figure out what it is, but just changing those 2 lines to include the /sabnzbd makes every show i want say FAILED PROCESSING. when i change it back by removing the /sabnzbd the shows are added to the queue but are duplicated. this is so frustrating

Ok:
1. When i have no /sabnzbd in SSD-TV.py and SMART_QUEUE = True in the config, i get duplicates of stuff already in the queue:

Code: Select all

2009-05-19 18:28:50,367 INFO MISSING: Season 6, Episode 24
2009-05-19 18:28:50,367 INFO ENTERED isInQueueSmart
2009-05-19 18:28:50,382 INFO IS NOT IN QUEUE: Show Name - S06E24
2009-05-19 18:28:50,382 INFO ADD QUEUE: 2009-05-19 18:28:50: 4996992
2009-05-19 18:28:50,382 INFO REPORT_ID: *******
(it really is in the queue)

2. When i have SMART_QUEUE = False i always get FAILED PROCESSING on any show im missing and want, it doesnt matter about the /sabnzbd. log looks like this:

Code: Select all

2009-05-19 18:26:40,164 INFO MISSING: Season 6, Episode 24
2009-05-19 18:26:40,180 INFO FAILED PROCESSING: Show Name - 6x24 - Ep Name
3. When i add the /sabnzbd to the SSD-TV.py file to make it like this:

Code: Select all

queue=xml.dom.minidom.parse(urllib.urlopen(my_SAB + "/sabnzbd/api?mode=queue&output=xml" + SAB_api_key + my_SAB_web_params))
then when SMART_QUEUE = True, the same FAILED PROCESSING message happens but it comes after the logger.info prints that we entered the smart queue checking functions

Code: Select all

2009-05-19 19:24:40,648 INFO MISSING: Season 6, Episode 24
2009-05-19 19:24:40,648 INFO ENTERED isInQueueSmart
2009-05-19 19:24:40,664 INFO FAILED PROCESSING: Show Name - 6x24 - Ep Name
IDK what else to do. Any suggestions are greatly appreciated

Edit:
So i downloaded the trunk version from the svn and kept my old config file and changed the

Code: Select all

my_SAB_web_params = "&apikey=987654321123456"
where the numbers is my specific api key.
What is interesting is that now in the log file when it gets to a show that i want AND that is in the queue it actually does say

Code: Select all

2009-05-19 20:04:47,351 INFO IS IN QUEUE: Show Name - S06E24
and then gracefully moves on to the next item in the rss feed, without a FAILED PROCESSING error.  However, when it gets to a show i want that is not in the queue, it does this:

Code: Select all

2009-05-19 20:04:47,710 INFO IS NOT IN QUEUE: Show Name - S04E24
2009-05-19 20:04:47,710 INFO FAILED PROCESSING: Show Name - 4x24 - Ep name
I don't know what to make of it really because i dont know what you (markus) changed besides apikey stuff to make 0.9.5 and also I have no idea why its getting to a furhter step and THEN failing.
Last edited by mattgoody on May 19th, 2009, 7:18 pm, edited 1 time in total.

mattgoody
Newbie
Newbie
Posts: 6
Joined: April 19th, 2009, 8:23 pm

Re: SABnzbd Smart Downloader

Post by mattgoody »

I finally figured out how to debug this thing using pdb. lol i feel so dumb. anyway i found the problem with the 0.9.4 i was having.  It had set SSDhistory = {} on line 155 when it should have been SSDhistory = []
This was causing line 878:

Code: Select all

if toDownload:
SSDhistory.append(nzbDetails['Report-Formatted'])
to give the error: AttributeError: "'dict' object has no attribute 'append'"

After that it worked and added the necessary episode to the queue. im gonna try to figure out why it doesnt work in markus' 0.9.5 since he (you) deleted the append line it seems, which is fine i guess cuz i have no idea what SSDHistory is doing.  When i figure that out ill edit this post if anyone cares :-)

Edit: I figured it out. In 0.9.5 the line read /sabnzbd/api?mode=queue but in 0.9.4 it was mode=qstatus. i changed 0.9.5 to qstatus and it works great. i feel super dumb yet relieved. I should have noticed it when i asked you about Sabnzbd+ 0.5 and the enhanced queue status or whatever. Sorry for all the posts. :-)
Last edited by mattgoody on May 19th, 2009, 10:20 pm, edited 1 time in total.

Post Reply