Skip to content

Commit

Permalink
nzbget fixed to use DNZB API for newzbin reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ob0t authored and Andy Furnell committed Aug 18, 2011
1 parent 4513514 commit 83f80de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/lib/nzbget.py
Expand Up @@ -45,8 +45,22 @@ def send(self, nzb):
log.error("Protocol Error: " + e.errmsg)
return False

newzbinuser = self.config.get('newzbin', 'username')
newzbinpass = self.config.get('newzbin', 'password')

try:
r = urllib2.urlopen(nzb.url).read().strip()
if nzb.source == 'newzbin':
newzbinurl = 'http://www.newzbin.com/api/dnzb/'
newzbinargs = { 'username' : newzbinuser,
'password' : newzbinpass,
'reportid' : str(nzb.id) }
log.info('Receiving report ' + str(nzb.id) + ' from newzbin')
newzbindata = urllib.urlencode(newzbinargs)
nzburl = urllib2.Request(newzbinurl, newzbindata)
else:
log.error('Downloading '+nzb.url)
nzburl = nzb.url
r = urllib2.urlopen(nzburl).read().strip()
except:
log.error("Unable to get NZB file.")
return False
Expand Down
1 change: 1 addition & 0 deletions app/lib/provider/yarr/sources/newzbin.py
Expand Up @@ -117,6 +117,7 @@ def find(self, movie, quality, type, retry = False):
new = self.feedItem()
new.id = id
new.type = 'nzb'
new.source = 'newzbin'
new.name = title
new.date = int(time.mktime(parse(date).timetuple()))
new.size = self.parseSize(size)
Expand Down

0 comments on commit 83f80de

Please sign in to comment.