mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
Cosmesis
This commit is contained in:
parent
ee8abc5d37
commit
9e227aecfa
@ -1,7 +1,7 @@
|
|||||||
import urllib.parse as parse
|
import urllib.parse as parse
|
||||||
import html.parser as parser
|
import html.parser as parser
|
||||||
|
|
||||||
# create a subclass and override the handler methods
|
|
||||||
class BayParser(parser.HTMLParser):
|
class BayParser(parser.HTMLParser):
|
||||||
title = ''
|
title = ''
|
||||||
q = ''
|
q = ''
|
||||||
|
@ -58,8 +58,8 @@ def parse_cmd(cmd, url):
|
|||||||
ret = [i[0].strip().replace('%s', url) for i in ret]
|
ret = [i[0].strip().replace('%s', url) for i in ret]
|
||||||
ret_no_quotes = []
|
ret_no_quotes = []
|
||||||
for item in ret:
|
for item in ret:
|
||||||
if ((item[0] == "'" and item[-1] == "'") or (
|
if ((item[0] == "'" and item[-1] == "'") or
|
||||||
item[0] == '"' and item[-1] == '"')):
|
(item[0] == '"' and item[-1] == '"')):
|
||||||
ret_no_quotes.append(item[1:-1])
|
ret_no_quotes.append(item[1:-1])
|
||||||
else:
|
else:
|
||||||
ret_no_quotes.append(item)
|
ret_no_quotes.append(item)
|
||||||
@ -125,7 +125,6 @@ def main():
|
|||||||
|
|
||||||
if (config.getboolean('Misc', 'colors') and not args.color
|
if (config.getboolean('Misc', 'colors') and not args.color
|
||||||
or not config.getboolean('Misc', 'colors')):
|
or not config.getboolean('Misc', 'colors')):
|
||||||
#global colored_output
|
|
||||||
pirate.data.colored_output = False
|
pirate.data.colored_output = False
|
||||||
|
|
||||||
if args.save_directory:
|
if args.save_directory:
|
||||||
@ -182,7 +181,8 @@ def main():
|
|||||||
for mirror in mirrors:
|
for mirror in mirrors:
|
||||||
try:
|
try:
|
||||||
print('Trying', mirror, end='... ')
|
print('Trying', mirror, end='... ')
|
||||||
mags, sizes, uploaded, ids = pirate.torrent.remote(args, mirror)
|
mags, sizes, uploaded, ids = pirate.torrent.remote(args,
|
||||||
|
mirror)
|
||||||
except (urllib.error.URLError, socket.timeout,
|
except (urllib.error.URLError, socket.timeout,
|
||||||
IOError, ValueError):
|
IOError, ValueError):
|
||||||
print('Failed', color='WARN')
|
print('Failed', color='WARN')
|
||||||
|
Loading…
Reference in New Issue
Block a user