Autodownload script
Re: Autodownload script
Hi All,
Updated Script:
http://pastebin.com/m4d8b4b8a
Fixed a bug in my branch of DoubleDrat's script. Nows sends the correct nzb name to the isInQueue function, it was sending the modifed name which of course didn't match when SABnzbd downloaded the nzb.
minimad
Updated Script:
http://pastebin.com/m4d8b4b8a
Fixed a bug in my branch of DoubleDrat's script. Nows sends the correct nzb name to the isInQueue function, it was sending the modifed name which of course didn't match when SABnzbd downloaded the nzb.
minimad
Re: Autodownload script
Updated Script:
http://pastebin.com/f31a31e8e
Important changes:
New Queue check - Looks for the series, episode rather than the filename of the NZB.
theTVDB intergration - Now requires tvdb_api, gets the correct series name from theTVDB.
http://pastebin.com/f31a31e8e
Important changes:
New Queue check - Looks for the series, episode rather than the filename of the NZB.
theTVDB intergration - Now requires tvdb_api, gets the correct series name from theTVDB.
Re: Autodownload script
Hi,
I've got a quick Question on how to get this working for me. I'm using Linux (unRAID 0.4.4 - based on Slackware 12.1) my TV shows are all located in "/mnt/user/tv" the full path for example would be "/mnt/user/tv/House/Season 1/House - S01E01 - Example"
My problem is that when I run rss_tv.py it grabs the RSS feed properly (Newzbin) but says Format Not Wanted: (I tried testing with something that was currently on the RSS Feed "Psych"), but I get the same message.
I'm just wondering if I need to make any changes to the py file (outside of the "normal" config changes to set my directories, to use Newzbin and my SAB Address).
Please let me know, I'd love to not have to delete dupes that I get almost daily due to the normal SAB RSS Feed reader finding a new NZB file in the feed.
EDIT: I'm using a XVid Specific feed, and looking for XVid only.
video_formats="[xX][vV][iI][dD]"
Thanks,
Markus101
I've got a quick Question on how to get this working for me. I'm using Linux (unRAID 0.4.4 - based on Slackware 12.1) my TV shows are all located in "/mnt/user/tv" the full path for example would be "/mnt/user/tv/House/Season 1/House - S01E01 - Example"
My problem is that when I run rss_tv.py it grabs the RSS feed properly (Newzbin) but says Format Not Wanted: (I tried testing with something that was currently on the RSS Feed "Psych"), but I get the same message.
I'm just wondering if I need to make any changes to the py file (outside of the "normal" config changes to set my directories, to use Newzbin and my SAB Address).
Please let me know, I'd love to not have to delete dupes that I get almost daily due to the normal SAB RSS Feed reader finding a new NZB file in the feed.
EDIT: I'm using a XVid Specific feed, and looking for XVid only.
video_formats="[xX][vV][iI][dD]"
Thanks,
Markus101
Last edited by markus101 on January 20th, 2009, 7:12 pm, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Re: Autodownload script
markus101 wrote: Hi,
I've got a quick Question on how to get this working for me. I'm using Linux (unRAID 0.4.4 - based on Slackware 12.1) my TV shows are all located in "/mnt/user/tv" the full path for example would be "/mnt/user/tv/House/Season 1/House - S01E01 - Example"
My problem is that when I run rss_tv.py it grabs the RSS feed properly (Newzbin) but says Format Not Wanted: (I tried testing with something that was currently on the RSS Feed "Psych"), but I get the same message.
I'm just wondering if I need to make any changes to the py file (outside of the "normal" config changes to set my directories, to use Newzbin and my SAB Address).
Please let me know, I'd love to not have to delete dupes that I get almost daily due to the normal SAB RSS Feed reader finding a new NZB file in the feed.
EDIT: I'm using a XVid Specific feed, and looking for XVid only.
video_formats="[xX][vV][iI][dD]"
Thanks,
Markus101
Markus, does newzbin have the xvid in the title for the show in the RSS feed? I don't know how newzbind feeds work, but this feature works well with TVBINZ.net I tested it last night.
Re: Autodownload script
No, it doesn't, which makes perfect sense - It's a nice clean title without the format listed, which would explain everything and why the initial script by popcorn works... I'll see what I can do to strip the format from the script, because I really like the idea of using TheTVDB to grab info, albeit I run tvrename (http://tvrename.com) to rename shows/keep track of what I'm missing, but it also uses TheTVDB for its backend database.
Thanks for your input pilGrim - I guess it's time to 'learn' python, or at least enough to stumble through this...
EDIT: Looks like a minor change to the python file After a few minutes of Trial and Error, all that was needed, was to comment out the following:
# if not isFormatWanted(report):
# if debug:
# print("Format Not Wanted: " + report)
# raise FormatNotWanted
Thanks for the push in the right direction pilGrim, and minimad for the excellent script.
EDIT2: It's now attempting to process the RSS feed, it also finds missing files, but it doesn't download the nzb/send the report to SAB...
It says its missing the file, but never downloads it (nor a mention of it goign to be downloaded). Any suggestions?
EDIT3: Issue also happens where it says missing, but fails to start the download of the file for my nzbs.org TV feed (which contains xvid in teh title and uses the unmodified script).
Thanks for your input pilGrim - I guess it's time to 'learn' python, or at least enough to stumble through this...
EDIT: Looks like a minor change to the python file After a few minutes of Trial and Error, all that was needed, was to comment out the following:
# if not isFormatWanted(report):
# if debug:
# print("Format Not Wanted: " + report)
# raise FormatNotWanted
Thanks for the push in the right direction pilGrim, and minimad for the excellent script.
EDIT2: It's now attempting to process the RSS feed, it also finds missing files, but it doesn't download the nzb/send the report to SAB...
It says its missing the file, but never downloads it (nor a mention of it goign to be downloaded). Any suggestions?
EDIT3: Issue also happens where it says missing, but fails to start the download of the file for my nzbs.org TV feed (which contains xvid in teh title and uses the unmodified script).
Last edited by markus101 on January 21st, 2009, 2:52 am, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Re: Autodownload script
Minimad has done the heavy lifting on the script changes and I have done a lot of testing and bug checks. the problem is that neither of us are members to newzbin to ensure the newzbin compatibility works. My understanding of newzbin was that you can create a custom RSS feed that would only give you xvid or HD so the check is probably not needed? if your RSS feed already sorts out to xvid only I would set the variable at the top to ="" that way you can leave the main section remed so when it is called it does not cause other issues in the codemarkus101 wrote: EDIT2: It's now attempting to process the RSS feed, it also finds missing files, but it doesn't download the nzb/send the report to SAB...
It says its missing the file, but never downloads it (nor a mention of it going to be downloaded). Any suggestions?
For not queue issue, when testing I normally put SAB up and pause it so I can see what stacks up in the queue. The section of code that actually puts the file into the queue is here:
Code: Select all
#
def download(report_id):
print "Adding to QUEUE: " + time.strftime("%Y-%m-%d %H:%M:%S")+": "+ report
#put your address for the api stuff here
if NewzBin:
#NewzBin Style
urllib.urlopen(my_SAB+"/sabnzbd/api?mode=addid&name="+report_id+my_SAB_params)
else:
#'Other' NZB RSS
urllib.urlopen(my_SAB+"/sabnzbd/api?mode=addurl&name="+report_id+my_SAB_params)
#end if NewzBin
Re: Autodownload script
Doh, Why didn't i think of that...I was thinking it would have to be a * in the quotes, which breaks everything - Okay started with a base script again and running though works (without any other changes to the script). It takes a bit to run through, but when it finishes it still hasn't added anything to the Queue. Nor do I get the output:
Which should get displayed if a report is getting added to the queue, which would point to an issue actually calling the download definition.
Which to my knowledge is this portion of the script:
Any suggestions would be great - I'm willing to be a test dummy for the Newzbin portion if wanted/needed.
Code: Select all
print "Adding to QUEUE: " + time.strftime("%Y-%m-%d %H:%M:%S")+": "+ report
Which to my knowledge is this portion of the script:
Code: Select all
#if isWanted(series) and isMissing(series, season, episode) and (not isInQueue(report_original)):
if isWanted(series) and isMissing(series, season, episode) and (not isInQueueSmart(series, season, episode)):
msgid=node.getElementsByTagName("link")[0].childNodes[0].data
msgid=urllib.quote(msgid)
download(msgid)
#end if isWanted(series)
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Re: Autodownload script
well,
looks like I broke something in the script. As pilGrim said, we both don't have access to newzbin so its good to get someone trying my script out that does.
Be warned, not all my versions I post will work, as i mostly code between 10pm and 1am and anything after midnight tends to get a bit fuzzy :-), missing varibles, spelling mistakes and such like.
pilGrim uses Windows, your on Linux and I use both :-). You may have noticed the win32 specific bit for the directory path, I got fed up with changing it each time i was testing.
possible the 'Smart' queue check doesn't like the Newzbin feed. Sounds like the script is just 'bugging' out in the queue check, I had this happen on me last night, put a load of '24' nzbs in the queue and as it was trying to get the file the queue has 'Trying to get file xxxxxx' or something similar, this caused the code to to bomb out. If the filename from the queue doesn't match the format expected the script just quits the bit its doing then carries on as if it did it.
OK, here's my plan of action
1, Make the format check dependant on the 'Newzbin' option in user config (false uses the format check, true doesn't use it). This one's Easy
2, Make the 'Smart' queue check a user config option.
3, markus101, if possible can you post me (via pastebin.com) a copy of a newzbin feed with the shows you are interest in, in it. I'm flying sort of blind when it comes to the newzbin feed, never seen one, just made assumptions based on the code.
4, Fix the 'Smart' queue, as to not quit if it gets something unexpected.
markus101,
Where are you based? I'm in the UK, pilGrim is in Hong Kong so time differences make things interesting :-)
looks like I broke something in the script. As pilGrim said, we both don't have access to newzbin so its good to get someone trying my script out that does.
Be warned, not all my versions I post will work, as i mostly code between 10pm and 1am and anything after midnight tends to get a bit fuzzy :-), missing varibles, spelling mistakes and such like.
pilGrim uses Windows, your on Linux and I use both :-). You may have noticed the win32 specific bit for the directory path, I got fed up with changing it each time i was testing.
possible the 'Smart' queue check doesn't like the Newzbin feed. Sounds like the script is just 'bugging' out in the queue check, I had this happen on me last night, put a load of '24' nzbs in the queue and as it was trying to get the file the queue has 'Trying to get file xxxxxx' or something similar, this caused the code to to bomb out. If the filename from the queue doesn't match the format expected the script just quits the bit its doing then carries on as if it did it.
OK, here's my plan of action
1, Make the format check dependant on the 'Newzbin' option in user config (false uses the format check, true doesn't use it). This one's Easy
2, Make the 'Smart' queue check a user config option.
3, markus101, if possible can you post me (via pastebin.com) a copy of a newzbin feed with the shows you are interest in, in it. I'm flying sort of blind when it comes to the newzbin feed, never seen one, just made assumptions based on the code.
4, Fix the 'Smart' queue, as to not quit if it gets something unexpected.
markus101,
Where are you based? I'm in the UK, pilGrim is in Hong Kong so time differences make things interesting :-)
Re: Autodownload script
Ok,
Modified Script:
http://pastebin.com/f4f9b11bd
Major Changes:
Format check is now dependant on if you are using NewzBin or not
'Smart' queue check is now optional
'Smart' queue shouldn't exit if it finds something 'odd'
new Known Issues section
moved change log to top of script
added additional debug statement (controled by the debug option)
cleaned up the code and made it 'style' consistant.
Needs someone with a NewzBin account to test that side of things
Please test and PM me if anything odd.
Modified Script:
http://pastebin.com/f4f9b11bd
Major Changes:
Format check is now dependant on if you are using NewzBin or not
'Smart' queue check is now optional
'Smart' queue shouldn't exit if it finds something 'odd'
new Known Issues section
moved change log to top of script
added additional debug statement (controled by the debug option)
cleaned up the code and made it 'style' consistant.
Needs someone with a NewzBin account to test that side of things
Please test and PM me if anything odd.
Re: Autodownload script
Oooh sounds good, I'll try to test it out tonight and get you some feedback.
I'm based in BC, Canada, so I'm PST, it's only 5pm now, so I should have an opportunity to test this out before the night's over.
EDIT: Did some testing, looks good, came back to an error with newzbin, saying the server is having issues (500) blah blah blah. It then wouldn't add files to the queue...anyone else have issues with Newzbin tonight? or do they just hate me today?:(
Cheers,
markus101
I'm based in BC, Canada, so I'm PST, it's only 5pm now, so I should have an opportunity to test this out before the night's over.
EDIT: Did some testing, looks good, came back to an error with newzbin, saying the server is having issues (500) blah blah blah. It then wouldn't add files to the queue...anyone else have issues with Newzbin tonight? or do they just hate me today?:(
Cheers,
markus101
Last edited by markus101 on January 22nd, 2009, 3:50 am, edited 1 time in total.
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Re: Autodownload script
Hi guys,
I'm trying the last Minimad script but have the following error :
I'm running Win Vista 32 bits. I just copied / pasted the script into a txt file, edited it to my needs, installed python 2.5.4 and launched the edited /renamed script (from .txt to .py) in commandline.
I never installed any tvdb_api, and found something on google named tvdb_api, but I can't seem to be able to download it (the page doesn't exists or so).
Any help would be very appreciated, thanks in advance.
I'm trying the last Minimad script but have the following error :
Code: Select all
D:\Docs>TV_Dler.py
Traceback (most recent call last):
File "D:\Docs\TV_Dler.py", line 12, in <module>
from tvdb_api import (tvdb_error, tvdb_shownotfound, tvdb_seasonnotfound,
ImportError: No module named tvdb_api
I never installed any tvdb_api, and found something on google named tvdb_api, but I can't seem to be able to download it (the page doesn't exists or so).
Any help would be very appreciated, thanks in advance.
Re: Autodownload script
You need all the TVDP_api files. Just dl them and put them in the same directory. You can find them here: http://github.com/dbr/tvdb_api/tree/masterNesousx wrote: Hi guys,
I'm trying the last Minimad script but have the following error :
I'm running Win Vista 32 bits. I just copied / pasted the script into a txt file, edited it to my needs, installed python 2.5.4 and launched the edited /renamed script (from .txt to .py) in commandline.Code: Select all
D:\Docs>TV_Dler.py Traceback (most recent call last): File "D:\Docs\TV_Dler.py", line 12, in <module> from tvdb_api import (tvdb_error, tvdb_shownotfound, tvdb_seasonnotfound, ImportError: No module named tvdb_api
I never installed any tvdb_api, and found something on google named tvdb_api, but I can't seem to be able to download it (the page doesn't exists or so).
Any help would be very appreciated, thanks in advance.
Re: Autodownload script
I'have got a new error now :ppilGrim wrote:
You need all the TVDP_api files. Just dl them and put them in the same directory. You can find them here: http://github.com/dbr/tvdb_api/tree/master
Code: Select all
D:\Docs\Scripts>TV_Dler.py
Traceback (most recent call last):
File "D:\Docs\Scripts\TV_Dler.py", line 12, in <module>
from tvdb_api import (tvdb_error, tvdb_shownotfound, tvdb_seasonnotfound,
File "D:\Docs\Scripts\tvdb_api.py", line 5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
^
SyntaxError: invalid syntax
nm, got it working !!
Thanks much
Last edited by Nesousx on January 22nd, 2009, 8:21 am, edited 1 time in total.
Re: Autodownload script
Well actually, it doesn't really work.
I got the following :
But it doesn't load anything into sabnzd queue / actual download.
Any idea?
EDIT : edited with the debug output.
I got the following :
Code: Select all
D:\Docs\Scripts>TV_Dler.py
Processing :Lost.S05E02.720p.HDTV.x264-2HD
2009-01-22 14:47:12,375) DEBUG Retriving URL http://www.thetvdb.com/api/0629B785
CE550C8D/mirrors.xml
2009-01-22 14:47:12,378) DEBUG Found mirror <mirror>
<id>1</id>
<mirrorpath>http://thetvdb.com</mirrorpath>
<typemask>7</typemask>
</mirror>
2009-01-22 14:47:12,380) DEBUG Found total of 1 mirrors
ORIG: Lost
2009-01-22 14:47:12,381) DEBUG Getting show lost
2009-01-22 14:47:12,381) DEBUG Retriving URL http://thetvdb.com/api/GetSeries.ph
p?seriesname=lost
2009-01-22 14:47:12,461) DEBUG Found series Lost (id: 73739)
2009-01-22 14:47:12,463) DEBUG Found series Lost Universe (id: 73181)
2009-01-22 14:47:12,464) DEBUG Found series Lost (2001) (id: 72906)
2009-01-22 14:47:12,466) DEBUG Found series Lost in Space (id: 72923)
2009-01-22 14:47:12,467) DEBUG Found series Lost in Austen (id: 82934)
2009-01-22 14:47:12,469) DEBUG Found series Lost Civilizations (id: 80525)
2009-01-22 14:47:12,470) DEBUG Found series Lost Highway (id: 74729)
2009-01-22 14:47:12,470) DEBUG Found series Lost at Home (id: 71150)
2009-01-22 14:47:12,473) DEBUG Found series Lost on Earth (id: 71225)
2009-01-22 14:47:12,473) DEBUG Found series Lost Cities of the Ancients (id: 837
41)
2009-01-22 14:47:12,474) DEBUG Found series Lost Land of the Jaguar (id: 82715)
2009-01-22 14:47:12,476) DEBUG Found series Lost Treasures of NFL Films (id: 738
31)
2009-01-22 14:47:12,477) DEBUG Found series Land of the Lost (id: 71177)
2009-01-22 14:47:12,479) DEBUG Found series Lost Worlds (id: 80685)
2009-01-22 14:47:12,480) DEBUG Found series Lost Worlds, Vanished Lives (id: 796
16)
2009-01-22 14:47:12,482) DEBUG Found series Lost (UK) (id: 80595)
2009-01-22 14:47:12,483) DEBUG Found series The Lost Tomb of Jesus (id: 81028)
2009-01-22 14:47:12,483) DEBUG Found series Secrets of Lost Empires (id: 83797)
2009-01-22 14:47:12,484) DEBUG Found series The Secret Of Lost Creek (id: 73162)
2009-01-22 14:47:12,486) DEBUG Found series Xam`d: Lost Memories (id: 82834)
2009-01-22 14:47:12,489) DEBUG Found series The Lost Room (id: 79637)
2009-01-22 14:47:12,490) DEBUG Found series The Lost Tribes (id: 80333)
2009-01-22 14:47:12,490) DEBUG Found series The Lost Saucer (id: 73549)
2009-01-22 14:47:12,492) DEBUG Found series The Lost Gods (id: 82275)
2009-01-22 14:47:12,493) DEBUG Found series WWII: The Lost Color Archives (id: 8
2250)
2009-01-22 14:47:12,494) DEBUG Found series History's Lost and Found (id: 83333)
2009-01-22 14:47:12,496) DEBUG Found series Brats of the Lost Nebula (id: 78687)
2009-01-22 14:47:12,497) DEBUG Found series The Lost World (id: 78457)
2009-01-22 14:47:12,499) DEBUG Found series The Man who Lost his Head (id: 81313
)
2009-01-22 14:47:12,500) DEBUG Found series The Lost Prince (id: 84482)
2009-01-22 14:47:12,502) DEBUG Found series Land of the Lost (1991) (id: 76861)
2009-01-22 14:47:12,503) DEBUG Found series Finder of Lost Loves (id: 73420)
2009-01-22 14:47:12,503) DEBUG Auto-selecting first search result
2009-01-22 14:47:12,503) DEBUG Got Lost, sid 73739
2009-01-22 14:47:12,503) DEBUG Getting all episodes of 73739
2009-01-22 14:47:12,505) DEBUG Retriving URL http://thetvdb.com/api/0629B785CE55
0C8D/series/73739/all/
2009-01-22 14:47:13,773) DEBUG Got series id 73739
Processing :CSI.Miami.S07E13.720p.HDTV.X264-DIMENSION
2009-01-22 14:47:13,775) DEBUG Retriving URL http://www.thetvdb.com/api/0629B785
CE550C8D/mirrors.xml
2009-01-22 14:47:13,775) DEBUG Retriving URL http://www.thetvdb.com/api/0629B785
CE550C8D/mirrors.xml
2009-01-22 14:47:13,778) DEBUG Found mirror <mirror>
<id>1</id>
<mirrorpath>http://thetvdb.com</mirrorpath>
<typemask>7</typemask>
</mirror>
2009-01-22 14:47:13,778) DEBUG Found mirror <mirror>
<id>1</id>
<mirrorpath>http://thetvdb.com</mirrorpath>
<typemask>7</typemask>
</mirror>
2009-01-22 14:47:13,779) DEBUG Found total of 1 mirrors
2009-01-22 14:47:13,779) DEBUG Found total of 1 mirrors
ORIG: CSI Miami
2009-01-22 14:47:13,782) DEBUG Getting show csi miami
2009-01-22 14:47:13,782) DEBUG Getting show csi miami
2009-01-22 14:47:13,782) DEBUG Retriving URL http://thetvdb.com/api/GetSeries.ph
p?seriesname=csi+miami
2009-01-22 14:47:13,782) DEBUG Retriving URL http://thetvdb.com/api/GetSeries.ph
p?seriesname=csi+miami
2009-01-22 14:47:13,789) DEBUG Found series CSI: Miami (id: 78310)
2009-01-22 14:47:13,789) DEBUG Found series CSI: Miami (id: 78310)
2009-01-22 14:47:13,789) DEBUG Auto-selecting first search result
2009-01-22 14:47:13,789) DEBUG Auto-selecting first search result
2009-01-22 14:47:13,789) DEBUG Got CSI: Miami, sid 78310
2009-01-22 14:47:13,789) DEBUG Got CSI: Miami, sid 78310
2009-01-22 14:47:13,790) DEBUG Getting all episodes of 78310
2009-01-22 14:47:13,790) DEBUG Getting all episodes of 78310
2009-01-22 14:47:13,792) DEBUG Retriving URL http://thetvdb.com/api/0629B785CE55
0C8D/series/78310/all/
2009-01-22 14:47:13,792) DEBUG Retriving URL http://thetvdb.com/api/0629B785CE55
0C8D/series/78310/all/
2009-01-22 14:47:15,493) DEBUG Got series id 78310
2009-01-22 14:47:15,493) DEBUG Got series id 78310
D:\Docs\Scripts>
Any idea?
EDIT : edited with the debug output.
Last edited by Nesousx on January 22nd, 2009, 8:49 am, edited 1 time in total.
Re: Autodownload script
Did you download the TVDB files from the download package? Oddly I had to refresh those files today and the zip file I downloaded was corrupt. I clicked on each which shows the code, then click the "raw" button or link, this gives you a clean version in your browser, basically save as to get each file one by one. I was getting all kinds of errors on the TVDB calls until I got one by one clean filesNesousx wrote: Well actually, it doesn't really work.
But it doesn't load anything into sabnzd queue / actual download.
Any idea?
EDIT : edited with the debug output.