Pads and myepisodes.com

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
chqshaitan
Newbie
Newbie
Posts: 5
Joined: January 27th, 2009, 5:28 am

Pads and myepisodes.com

Post by chqshaitan »

Hi All,

Thought i would share some success getting Pads / Myepisodes working with Sabnzbd. I know from my own searches that no one has looked into getting pads and sab working, but i spent sometime last night and hacked the pads code so it will submit any found ids to sabnzbd.

I do not know python so excuse the shoddiness of the coding, but eh it works :) Basically download pads from (http://www.piesweb.co.uk/), and setup a profile on myepisodes.com.

Edit the pads code replacing the function called Queue(id) with the following

Code: Select all

def QueueID(id):
        DeBug('trying to connect to http://192.168.11.2:8080/sabnzbd/api?mode=addid&name=' + id + '&pp=3&cat=TV')
	try:
		sabnzbd = urlopen('http://192.168.11.2:8080/sabnzbd/api?mode=addid&name=' + id + '&pp=3&cat=TV')
        except:
                print "Unable to connect to Sabnzb"
                print "Exiting..."
                sys.exit()
Simply change the ip and port to match your own sabnzbd details on both lines. Create a cronjob that runs every hour and hey presto, when a new episode has been found and exists on newzbin, the id will be sent to sabnzbd for downloading.. good eh :D

All thanks to Pie for his hard work in creating pads.
HiDefDog
Newbie
Newbie
Posts: 1
Joined: March 5th, 2009, 1:09 pm

Re: Pads and myepisodes.com

Post by HiDefDog »

That's awesome.  Thank you!
huleboeren
Release Testers
Release Testers
Posts: 114
Joined: January 25th, 2008, 1:10 pm

Re: Pads and myepisodes.com

Post by huleboeren »

That
is
awesome!
:O
Will switch to this if foechers rss feed fails me
zoul
Newbie
Newbie
Posts: 4
Joined: November 21st, 2009, 1:25 pm

Re: Pads and myepisodes.com

Post by zoul »

I've made a few more modifications to pads.py for sabnzbd integration.

The latest version of sabnzbd has both a web username,password and the apikey.

Here's my modified version of the QueueID method:

Code: Select all

def QueueID(id):
	DeBug("QueueID(" + id + ")")
	u = 'http://192.168.15.50:31337/sabnzbd/api?mode=addid&name=' + id + '&pp=3&cat=TV&apikey=YOUR_API_KEY&ma_username=YOUR_USER_NAME&ma_password=YOUR_PASS_WORD'
	DeBug(u)
	try:
		sabnzbd = urlopen(u)
		r = sabnzbd.read().lstrip().rstrip()
		if r == "ok":
			print "ok"
		else:
			print "Failed to queue"
			print "Exitting..."
			sys.exit()
	except:
		print "Unable to connect to Sabnzb"
		print "Exiting..."
		sys.exit()
You can note that I also added a check to see if the return from the sabnzbd call was "ok" or not - if it is "error" or anything else, the script will stop ... so you can resolve the problem.  You'll need to replace 'YOUR_USERNAME_HERE' and 'YOUR_PASSWORD_HERE' with the approriate values ... or remove them if you've disabled this in sabnzb (if you remove them, remove the querystring parameters entirely).  Replae 'YOUR_API_KEY' with the value from sabnzbd Config->General page as well.

I also made a modification to the nzbSearch method, the updated nzbSearch method is as follows:

Code: Select all

def nzbSearch(searchstring,postidlist):
	searchstring = "(" + searchstring + ") -(password)"
	searchurl = FormSearchURL(searchstring)
	DeBug("Searching using feed:\n" + searchurl)
	try:
		nzbin = feedparser.parse(searchurl)
	except:
		print "Unable to connect to " + searchurl
		print "Exiting..."
		sys.exit()
	for postid in nzbin.entries:
		pid = re.compile('.*(\d{7}).*').sub(r'\1',postid.id)
		if CheckPostIDok(pid,postidlist):
			DeBug(pid + " will be added to the queue.")
			queuedpostids.append(pid)
			time.sleep(3)
			return True,pid
	return False,"00000"
The only change to this was the addition of the "searchstring = "(" + searchstring + ") -(password)".  The reason for this addition is that Usenet seems to have become quite the spot for people to attempt to make a few bucks off of TV Shows.  They upload password protected archives and then request that you visit a webpage, take a survey flooded with ads and then hopefully the password is provided to you afterwards.  Obviously SabNZBd can not extract the password-protected archive ... and Newzbin Editors are kind enough to flag it as '(Passworded)' in the title ... so this addition to the search string omits searches containing 'password' in the text.

I made a handful of other changes as well, but they are specific to my setup ...

I may be making a port of pads.py to .NET/C# and providing it as an Installable Windows Service, with a much higher functionality set ... so that some more filtering can be achieved, as well as validation checks against sabnzbd to see if the report was downloaded and processed properly, so that failed downloads are attempted with another Newzbin Report ID, etc ...

I'll post back here if I startup that project and/or get it to a point where it's distributable.
Last edited by zoul on November 21st, 2009, 2:51 pm, edited 1 time in total.
zoul
Newbie
Newbie
Posts: 4
Joined: November 21st, 2009, 1:25 pm

Re: Pads and myepisodes.com

Post by zoul »

....
snubz
Newbie
Newbie
Posts: 5
Joined: December 14th, 2009, 7:31 pm

Re: Pads and myepisodes.com

Post by snubz »

zoul, thanks for the script.  I'm going to try and get this working with my SABnzbd server.
majestic
Newbie
Newbie
Posts: 1
Joined: February 18th, 2010, 11:58 am

Re: Pads and myepisodes.com

Post by majestic »

Hi zoul,

I have been using your moddified version of P.A.D.S since you posted it.  Its been awesome and never failed me.  For that like to say thank you, bit delayed I know but I personaly hate forums :)

Anyway as you probbaly already know that Newzbin is pritty much dead at least for now which means bye bye automatic TV downloading.  I was having a thought and looking at the code earlier (unforntly im no programmer though) but I was wondering if you could adjust this now to download the NZB's from say www.nzbs.org.  There site is currently open to signups again so just quicly grabbed an account.  Not as good as newzbin but it looks like it will do the job nicely. 

So the question is if your still reading here or if anyone else with the skill set, do you think its easy enough to patch pads so that instead of newzbin that it uses the nzb's from nzbs.org instead?  The other alternative I was thinking was using tvnzb.com but I have tried using their RSS feeds and at least atm it fails more then it works.

The only other thing I can see which would need to be adjusted is instead of it getting/using the Newzbin ID's to do the downloading that it would need to just download the nzb's files themselfs into X directory and the queue on sab will pick them up.

Just some random ideas to put onto the table so that we all can get our TV again.

Kind Regards,

Majestic
Post Reply