Skip to content

Commit

Permalink
Fix for some pirate proxy addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
philborman committed Aug 10, 2018
1 parent 150c3f4 commit abb7fb7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lazylibrarian/torrentparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ def TPB(book=None, test=False):
except ValueError:
seeders = 0

# no point in asking for magnet link if not enough seeders
if minimumseeders < seeders:
# no point in asking for magnet link if not enough seeders
magurl = '%s/%s' % (host, magnet)
# some tpb proxies return absolute path, some return relative
if magnet.startswith('http'):
magurl = magnet
else:
magurl = '%s/%s' % (host, magnet)
result, success = fetchURL(magurl)
if not success:
logger.debug('Error fetching url %s, %s' % (magurl, result))
Expand All @@ -136,7 +140,7 @@ def TPB(book=None, test=False):
'tor_type': 'magnet',
'priority': lazylibrarian.CONFIG['TPB_DLPRIORITY']
})
logger.debug('Found %s. Size: %s' % (title, size))
logger.debug('Found %s. Size: %s: %s' % (title, size, magnet))
next_page = True
else:
logger.debug('Found %s but %s seeder%s' % (title, seeders, plural(seeders)))
Expand Down

0 comments on commit abb7fb7

Please sign in to comment.