Autodownload script

Come up with a useful post-processing script? Share it here!
minimad
Release Testers
Release Testers
Posts: 62
Joined: January 11th, 2009, 5:45 pm

Re: Autodownload script

Post by minimad »

All,

For those having issues with folders not matching shownames from tvdb e.g. xxx NY and the final SAB extract is xxx New York as named by the nzb.

I'm using a port-processing script based on the tvdb api tvnamer.py that moves the files as well as renaming them into the tvdb format. 

When I have the instructions written down I'll post the modified script and how to use it.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

I just came across an issue, not sure how this happened.  Here is a paste bin to the relevant log output: http://pastebin.com/f22b44591

Basically it ignores the files it finds and downloads them anyways because it says there isn't a match. Not sure if something on Newzbin changes, but I tried an old script and the same thing happened and it downloaded the same nzb files (they were already in SAB, so SAB rejected them), ended up waking up this AM to 26 new downloads, for episodes that I already had.

Very odd... The only changes I made yesterday was adding a couple packages for using the ABGX360 script posted in these forums:

Code: Select all

curl-7.16.2-i486-1.tgz
libidn-1.5-i486-1.tgz
Not that I see either of those screwing anything up...Let me know if you need me to test anything, I'm going to give my server a kick in the pants and reboot it and advise.

EDIT: No change after the reboot...really weird.

-Markus
Last edited by markus101 on February 10th, 2009, 12:54 pm, edited 1 time in total.
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,

I think I know what is wrong and I think it has always happened.

I think it's to do with one of the regex's when checking the episode files, I pretty sure it's the (US), well not the US bit but the ( & ), I think it's screwing up the number of groups I'm expecting and the script just goes, ah well I don't have it so get it.

It's becuase the () are 'special' characters in regex's and I'm not handling them properly.

I'll look into it but I'm still getting my head around them.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Hi Minimad,

Hmmm, that makes sense, but looking at my logs other shows with ()'s seemed to have worked before, and properly got a match on disk. I was running the old version last night (0.7 + the Newzbin fix, so 0.71 effectively), it worked last week with another show with ()'s Show Name (2008), but last night it started downloading dupes of that exact same show that worked last week, without me changing the version, which is why I initially blamed the libs I had installed, but it doesn't appear to be the cause.

SAB's now handling the duplicate NZB issue, but rather weird issue.

I'm now using 0.88 for proper testing - the issue still exists as I mentioned, but I can deal with it, I'll keep an eye on other shows that don't have ()'s in them and report back if I have issues with them, which would mean another issue entirely.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Neph
Newbie
Newbie
Posts: 1
Joined: February 10th, 2009, 3:44 pm

Re: Autodownload script

Post by Neph »

How do I run this script in SABnzbd? Where do I put the code from pastebin?
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

You run in via python, its not run by SABnzbd, but by running an external command manually or using cron/windows scheduler to run it automatically.

To run it manually you would type:

Code: Select all

python /path/to/script/rss_tv.py
or in Windows:

Code: Select all

python C:\script\rss_tv.py
Hope this helps.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
rollingeyeball
Release Testers
Release Testers
Posts: 181
Joined: January 30th, 2009, 12:26 pm

Re: Autodownload script

Post by rollingeyeball »

Code: Select all

FEED: NewzBin
PROCESSING:Show
NZB:  Show
TVDB:  Show
CHECK WANTED: Show
SHOW NOT WANTED: Show
It IS wanted by me  :-\

E:\Foldername\TV\NCIS\Season 06\eps are here, named correctly.

Code: Select all

if sys.platform == "win32":
    tv_dirs=[ "J:\downloads\complete\TV" ]
else:
    tv_dirs=[ "E:\Foldername\TV" ]
What am I doing wrong?

Thats just one show, I made a purely ^^ That Show rss, but no others work either.
Last edited by rollingeyeball on February 20th, 2009, 1:19 pm, edited 1 time in total.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Looks like you're using Windows, which means you need to change the part relevant to Windows, what you changed would apply to non-Windows (OS X or Linux).

Code: Select all

if sys.platform == "win32":
    tv_dirs=[ "E:\Foldername\TV" ]
else:
    tv_dirs=[ "/mnt/not/used ]
The above change should work, post back if you still have difficulties.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
rollingeyeball
Release Testers
Release Testers
Posts: 181
Joined: January 30th, 2009, 12:26 pm

Re: Autodownload script

Post by rollingeyeball »

oh of course!
While I don't know python thats really.. my bad. hehe
Just that it said live download folder first, so it got me all confused :P
minimad
Release Testers
Release Testers
Posts: 62
Joined: January 11th, 2009, 5:45 pm

Re: Autodownload script

Post by minimad »

I should have changed the wording when I changed the code, sorry.

I'll try to reword it.
fysa
Newbie
Newbie
Posts: 2
Joined: February 13th, 2009, 3:57 pm

Re: Autodownload script

Post by fysa »

I threw together a small caching class "SimpleCache" and worked it into this script.

This will make a file called "simplecache.pyd" in the current directory.  I have not debugged it anywhere else, and it may need modification before it works for you.

The speed of subsequent TVDB lookups is mostly instantaneous now -- i.e., the first run will take a while, but after your cache is built, a complete run should only take 30 seconds.

http://pastebin.com/f26711c22

YMMV/at your own risk/etc/etc..
minimad
Release Testers
Release Testers
Posts: 62
Joined: January 11th, 2009, 5:45 pm

Re: Autodownload script

Post by minimad »

Hi fysa,

Many Thanks, this was something on my todo list as I had noticed that it would take a while, I thought it was mostly the shows that are more 'generic' in name e.g. the daily show which thetvdb has to spend a lot longer searching for.

Anyway, I've put you changes into my test scripts (I've made a lot of code changes recently and still testing them).

Thanks again
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: Autodownload script

Post by markus101 »

Found an issue with It's Always Sunny in Philadelphia. It's see's that I want to show, but fails to properly compare the files on disk to the RSS Feed item. Must not like the ' in It's, same as ()'s in (US)  :(

Not a huge deal, but just a heads up.

Looking forward to the next release,

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: Autodownload script

Post by pilGrim »

markus101 wrote: Found an issue with It's Always Sunny in Philadelphia. It's see's that I want to show, but fails to properly compare the files on disk to the RSS Feed item. Must not like the ' in It's, same as ()'s in (US)  :(

Not a huge deal, but just a heads up.

Looking forward to the next release,

Markus
Yes that problem has been there, American Dad! is not the same as American Dad, or anything with a 's does not always match up.  Minimad has a solution that he is working on.  I think the next release should address the problem.
rollingeyeball
Release Testers
Release Testers
Posts: 181
Joined: January 30th, 2009, 12:26 pm

Re: Autodownload script

Post by rollingeyeball »

I've decided I don't need this for TV downloading.  But I'd like to re-express my interest in an update or two on the Movie Download script.

Being able to come home and have new popular movies (as rated by rotten tomatoes) would be great!
Post Reply