mobeus00
April 25th, 2009, 11:09 PM
I am currently working on a plugin for asian movies and tv shows (using mysoju.com) it searches stream video source like youtube google video and it also searches torrent and NZB sites. It returns the results and you can choose to watch it now streaming or download for viewing later. I got all of it to work except the NZB part. WIth aaronx help with sabnzb I'm close, I cannt seem to download the nzb file and save it with the .nzb ext so sabnzb will automatically download it. I can down the nzb but I have to change file to an torrent extension. Boxee downloader doesn't seem to know what to do with nzb ext download link.
Any help would be greatly appreciated. After this last hurdle I will release the plugin. Below is the function to get the nzb file but boxee doesn't know to save it like it would if it was a torrent ext.
def getNZB(title):
url = 'http://www.newzleech.com/?group=&minage=&age=&min=50&max=max&q='
i=0
last =len(title)-1
for part in title:
if part != "The" and part != "Movie" and part != "Episode":
if i > 0:
url=url+"+"+part
else:
url=url+part
i=i+1
url=url+'&m=search&adv=1'
print url
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
#good_string=link.decode('utf-8')
subber = re.compile(r'[^A-Za-z0-9<>="/. ?\n]').sub
# then once for each maybe_bad_string
good_string = subber("", link)
good_string = good_string.replace("<b>","")
good_string = good_string.replace("</b>","")
good_string = good_string.replace("?p=","")
p=re.compile('<td class="subject"><a href="(.+?)">(.+?)</a> </td>')
nzb=p.findall(good_string)
if nzb:
for file,title in nzb:
addLink("NZB-"+title,"nzb://www.newzleech.com/?m=gen&dl=1&post="+file, '' )
return 1
else:
return 0
Any help would be greatly appreciated. After this last hurdle I will release the plugin. Below is the function to get the nzb file but boxee doesn't know to save it like it would if it was a torrent ext.
def getNZB(title):
url = 'http://www.newzleech.com/?group=&minage=&age=&min=50&max=max&q='
i=0
last =len(title)-1
for part in title:
if part != "The" and part != "Movie" and part != "Episode":
if i > 0:
url=url+"+"+part
else:
url=url+part
i=i+1
url=url+'&m=search&adv=1'
print url
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
#good_string=link.decode('utf-8')
subber = re.compile(r'[^A-Za-z0-9<>="/. ?\n]').sub
# then once for each maybe_bad_string
good_string = subber("", link)
good_string = good_string.replace("<b>","")
good_string = good_string.replace("</b>","")
good_string = good_string.replace("?p=","")
p=re.compile('<td class="subject"><a href="(.+?)">(.+?)</a> </td>')
nzb=p.findall(good_string)
if nzb:
for file,title in nzb:
addLink("NZB-"+title,"nzb://www.newzleech.com/?m=gen&dl=1&post="+file, '' )
return 1
else:
return 0