Autodownload script

Come up with a useful post-processing script? Share it here!
pinion
Newbie
Newbie
Posts: 17
Joined: January 26th, 2009, 2:21 am

Re: Autodownload script

Post by pinion »

Thanks markus!  It did help me get started although I'm running this under Freenas with FreeBSD and for some reason I still can't get it to run right.  Freenas says it can't execute the cron job.  I'm asking over in there forums for help.
I ran into a problem with the TV show script where as I'm trying to download Judge Judy for my wife but the show name is like this Judge.Judy.S07E046.PDTV.XviD-W4F where as there is an extra 0 in the episode number which causes errors.  Could this be fixed easily?
Cuchulainn
Release Testers
Release Testers
Posts: 7
Joined: December 1st, 2008, 9:11 am

Re: Autodownload script

Post by Cuchulainn »

Okay, I figured out a way to adjust the movie script to check against the rottentomatoes rating. Right now it will download a movie from the nzbs.org rss-feed if the imdb or rottentomatoes rating is higher than 75. I am not at home in Python, so it is a bit of a hack, but hopefully someone will find it useful.
http://pastebin.com/f4e673063
Adjust the rss-feed and the directories at the start of the script.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Mmmm new version. Does it fix by chance searching for folders negating case? I'm having issues with The Office (US) versus The Office (Us), SAB likes to rename the files after download to The Office (Us), whereas this script looks for The Office (US), which means either it won't automatically download, or it just attempts to download it until its out off the RSS feed (SAB rejects it as a duplicate NZB file which is nice).

Looking forward to the update.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
pinion
Newbie
Newbie
Posts: 17
Joined: January 26th, 2009, 2:21 am

Re: Autodownload script

Post by pinion »

Ok, I'm not sure exactly what happened but today the script picked up the extra 0 in the episode number just fine and downloaded the other episodes.  Now I'm wondering if there is a way to output to a file the shows matched and shows not matched so I know if I'm missing something I may want.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

I use redirection in Linux, shouldn't be an issue as the same exists for Windows.

Just run the command like this for example:

Code: Select all

python /boot/scripts/rss_tv.py >> /mnt/staging/SABnzbd/logs/rss_tv_nb.log
>> appends to a file
> erases the file and starts a new one

You can either call the above from command line directly or via a shell script, I use a shell script, which I call from cron, then I can add more commands without changes (or remove the logging).

For Windows a bat file would work great (plus can be called from scheduled tasks).

Hope this helps,

Markis
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
pinion
Newbie
Newbie
Posts: 17
Joined: January 26th, 2009, 2:21 am

Re: Autodownload script

Post by pinion »

Thanks Markus.  That's exactly what I'm looking for.  I'm actually running SABnzbd on my FreeNAS box that runs FreeBSD.  I know about enough to get into trouble ;) but I do have sabnzbd running and these scripts going as cron jobs now so I guess that's better than some.  Thanks for all the help!
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Haha no problem... I started running SAB on my unRAID Server, based on Slackware 12.1, I'm in the same boat, know enough to be deadly. I think the worse I've done is trying to run mplayer and mencoder on it to convert MKVs to MP4's... doesn't work at all, but the combining multiple AVI's works...go figure. Glad I can help, FreeNAS was going to be my storage server of choice until I discovered unRAID (http://www.lime-technology.com).

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
pinion
Newbie
Newbie
Posts: 17
Joined: January 26th, 2009, 2:21 am

Re: Autodownload script

Post by pinion »

What are you doing to combine the multiple avi's for movies that are two discs and what not?  That may be worth it's own thread on how you got that going in a linux environment. 
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Will do, I'm using a script I found here and modified it, I ended up posting the steps over on the unRAID forums, but didn't think of posting it here. I'll have to re-write a bi as it was very specific to unRAID (using slackware packages), but it shoudl work find for other flavors. I'll see what I can do to get that up a bit later today...

EDIT: Uploaded what I did in Slackware to get it going...hopefully it points you in the right direction, its not 100% specific to Slackware, but it leans that way for sure.

http://forums.sabnzbd.org/index.php?topic=1712.0

-Markus
Last edited by markus101 on February 4th, 2009, 11:44 am, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Got a solution for the US shows where Newzbin/TheTVDB look for (US) and SAB renames them to (Us), check out this thread with switches fixed attached to his post: http://forums.sabnzbd.org/http://forums ... 667#p10667

It will only work with Newzbin, as other RSS feeds drop the () around US, I have it working on a trunk version of SAB, but it should work for 0.4.6 as well, it requires editing a python file, so it won't work with Windows Compiled Binaries (unless they still call the python files?).\

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
minimad
Release Testers
Release Testers
Posts: 62
Joined: January 11th, 2009, 5:45 pm

Re: Autodownload script

Post by minimad »

Hi Markus,

Good call.  Looked at the other thread and made the changes that the devs suggested.

http://pastebin.com/f5bc3244f

Is version 0.88.

Does slow the script down a bit (by maybe upto half a second per entry, depending on number of shows in your library)
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Hi,

Woohoo an update to test out, glad to see you're still working on it. The Down will be manageable, better than editing the tvsort.py on each new version, although that would've have been worth it in the long run. Glad to see it was a pretty easy fix - On both sides of the field. Hopefully they do commit the changes they made as a switch, I'd love to see that as an option, just to make it look cleaner.

As always I look forward to testing it out and seeing the magic happen. I'll post back my feedback once I get a chance to test it out.

EDIT: I was talking with someone that recently got into Newsgroups/SAB. They have their folder structure as follows, they've played with other options, but haven't found anything that worked as well for them as RSS Feeds did in uTorrent (with smart episode matching as they call it).

Windows based...

Code: Select all

Z:\tv\Series Name\Season 1\S01E01 - Show Name.mkv
Sounds like they'd be interested in the script, if it could handle their semi-obscure naming structure.

Cheers,

Markus
Last edited by markus101 on February 6th, 2009, 6:42 pm, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Stokkes
Newbie
Newbie
Posts: 32
Joined: January 23rd, 2009, 10:28 pm

Re: Autodownload script

Post by Stokkes »

minimad,

Have you fixed the issue with 1 digit season numbers in the folder names? (ie: /mnt/user/tv/Lost/Season 1/Lost 1x01 - Pilot.avi)
pinion
Newbie
Newbie
Posts: 17
Joined: January 26th, 2009, 2:21 am

Re: Autodownload script

Post by pinion »

EDIT**
Disregard I think it was just a no internet connection thing.  I was confused because I was getting to the box but the box didn't connect to the outside.

Anyone else getting this error now with version 0.88?

Code: Select all

PROCESS NZB FEED: http://feeds.feedburner.com/minimad
FEED: Other
Traceback (most recent call last):
  File "rsstv.py", line 755, in <module>
    Main()
  File "rsstv.py", line 692, in Main
    dom=xml.dom.minidom.parse(urllib.urlopen(feed))
  File "/usr/local/lib/python2.5/urllib.py", line 82, in urlopen
    return opener.open(url)
  File "/usr/local/lib/python2.5/urllib.py", line 190, in open
    return getattr(self, name)(url)
  File "/usr/local/lib/python2.5/urllib.py", line 325, in open_http
    h.endheaders()
  File "/usr/local/lib/python2.5/httplib.py", line 860, in endheaders
    self._send_output()
  File "/usr/local/lib/python2.5/httplib.py", line 732, in _send_output
    self.send(msg)
  File "/usr/local/lib/python2.5/httplib.py", line 699, in send
    self.connect()
  File "/usr/local/lib/python2.5/httplib.py", line 683, in connect
    raise socket.error, msg
IOError: [Errno socket error] (51, 'Network is unreachable')
Last edited by pinion on February 8th, 2009, 8:04 pm, edited 1 time in total.
minimad
Release Testers
Release Testers
Posts: 62
Joined: January 11th, 2009, 5:45 pm

Re: Autodownload script

Post by minimad »

Hi Stokkes,

Nope, not quite fixed it, I have a solution (I think) but battling with python to do what I want it to do. I'm able to turn the 1 into 01 but i seem to be having trouble turning back the other way.

Not spent much time since the other night (not moved more than 10 feet from bed to bathroom if you know what I mean).
Post Reply