Skip to content

Commit

Permalink
Merge pull request #1539 from philborman/master
Browse files Browse the repository at this point in the history
Fix for some pirate proxy addresses
  • Loading branch information
philborman authored Aug 11, 2018
2 parents ecb451a + abb7fb7 commit bb99887
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 bb99887

Please sign in to comment.