mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
Fix unbound local error
This commit is contained in:
parent
b8f922ae6e
commit
2b1112258e
@ -306,8 +306,8 @@ def print_search_results(mags, sizes, uploaded):
|
|||||||
|
|
||||||
torrent_name = parse.unquote(name.group(1)).replace('+', ' ')
|
torrent_name = parse.unquote(name.group(1)).replace('+', ' ')
|
||||||
# enhanced print output with justified columns
|
# enhanced print output with justified columns
|
||||||
print('{:4} {:5} {:5} {:5.1f} {:5.1f} {:3}'
|
print('{:4} {:5} {:5} {:5.1f} {:5.1f} {:3} '
|
||||||
' {:<11} {:{length}}'.format(m, no_seeders, no_leechers,
|
'{:<11} {:{length}}'.format(m, no_seeders, no_leechers,
|
||||||
ratio, float(sizes[m][0]),
|
ratio, float(sizes[m][0]),
|
||||||
sizes[m][1], uploaded[m],
|
sizes[m][1], uploaded[m],
|
||||||
torrent_name[:columns],
|
torrent_name[:columns],
|
||||||
@ -438,7 +438,7 @@ def main():
|
|||||||
if args.database:
|
if args.database:
|
||||||
mags = local(args)
|
mags = local(args)
|
||||||
else:
|
else:
|
||||||
mirrors = ['http://thepiratebay.se']
|
mags, mirrors = [], ['http://thepiratebay.se']
|
||||||
try:
|
try:
|
||||||
opener = request.build_opener(NoRedirection)
|
opener = request.build_opener(NoRedirection)
|
||||||
f = opener.open('https://proxybay.info/list.txt', timeout=5)
|
f = opener.open('https://proxybay.info/list.txt', timeout=5)
|
||||||
@ -458,7 +458,7 @@ def main():
|
|||||||
except URLError:
|
except URLError:
|
||||||
print('Failed', color='WARN')
|
print('Failed', color='WARN')
|
||||||
|
|
||||||
if not mags or len(mags) == 0:
|
if not mags:
|
||||||
print('No results')
|
print('No results')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user