mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
Style changes
Respect 80 characters limit
This commit is contained in:
parent
cc2459b338
commit
d799d4b5e7
@ -340,10 +340,11 @@ def print_descriptions(chosen_links, mags, site, identifiers):
|
|||||||
desc = re.sub(r'<a href="\s*([^"]+?)\s*"[^>]*>(\s*)([^<]+?)(\s*'
|
desc = re.sub(r'<a href="\s*([^"]+?)\s*"[^>]*>(\s*)([^<]+?)(\s*'
|
||||||
r')</a>', r'\2[\3](\1)\4', desc)
|
r')</a>', r'\2[\3](\1)\4', desc)
|
||||||
|
|
||||||
print('Description for "' + torrent_name + '":', color='zebra_1')
|
print('Description for "%s":' % torrent_name, color='zebra_1')
|
||||||
print(desc, color='zebra_0')
|
print(desc, color='zebra_0')
|
||||||
|
|
||||||
def print_fileLists(chosen_links, mags, site, identifiers):
|
|
||||||
|
def print_file_lists(chosen_links, mags, site, identifiers):
|
||||||
for link in chosen_links:
|
for link in chosen_links:
|
||||||
path = '/ajax_details_filelist.php'
|
path = '/ajax_details_filelist.php'
|
||||||
query = '?id=' + identifiers[int(link)]
|
query = '?id=' + identifiers[int(link)]
|
||||||
@ -360,7 +361,7 @@ def print_fileLists(chosen_links, mags, site, identifiers):
|
|||||||
name = re.search(r'dn=([^\&]*)', mags[int(link)][0])
|
name = re.search(r'dn=([^\&]*)', mags[int(link)][0])
|
||||||
torrent_name = parse.unquote(name.group(1)).replace('+', ' ')
|
torrent_name = parse.unquote(name.group(1)).replace('+', ' ')
|
||||||
|
|
||||||
print('Files in "' + torrent_name + '":', color='zebra_1')
|
print('Files in "%s":' % torrent_name, color='zebra_1')
|
||||||
cur_color = 'zebra_0'
|
cur_color = 'zebra_0'
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
@ -452,7 +453,8 @@ def main():
|
|||||||
mags, mirrors = [], ['https://thepiratebay.se']
|
mags, mirrors = [], ['https://thepiratebay.se']
|
||||||
try:
|
try:
|
||||||
opener = request.build_opener(NoRedirection)
|
opener = request.build_opener(NoRedirection)
|
||||||
f = opener.open('https://proxybay.info/list.txt', timeout=default_timeout)
|
f = opener.open('https://proxybay.info/list.txt',
|
||||||
|
timeout=default_timeout)
|
||||||
if f.getcode() != 200:
|
if f.getcode() != 200:
|
||||||
raise IOError('The pirate bay responded with an error.')
|
raise IOError('The pirate bay responded with an error.')
|
||||||
mirrors.extend([i.decode('utf-8').strip()
|
mirrors.extend([i.decode('utf-8').strip()
|
||||||
@ -497,8 +499,9 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Very permissive handling
|
# Very permissive handling
|
||||||
# Check for any occurances or d, f, p or q
|
# Check for any occurances or d, f, p s, or q
|
||||||
cmd_code_match = re.search(r'([hdfpq])', l, flags=re.IGNORECASE)
|
cmd_code_match = re.search(r'([hdfpsq])', l,
|
||||||
|
flags=re.IGNORECASE)
|
||||||
if cmd_code_match:
|
if cmd_code_match:
|
||||||
code = cmd_code_match.group(0).lower()
|
code = cmd_code_match.group(0).lower()
|
||||||
else:
|
else:
|
||||||
@ -528,7 +531,7 @@ def main():
|
|||||||
elif code == 'd':
|
elif code == 'd':
|
||||||
print_descriptions(choices, mags, site, identifiers)
|
print_descriptions(choices, mags, site, identifiers)
|
||||||
elif code == 'f':
|
elif code == 'f':
|
||||||
print_fileLists(choices, mags, site, identifiers)
|
print_file_lists(choices, mags, site, identifiers)
|
||||||
elif code == 'p':
|
elif code == 'p':
|
||||||
print_search_results(mags, sizes, uploaded)
|
print_search_results(mags, sizes, uploaded)
|
||||||
elif not l:
|
elif not l:
|
||||||
|
Loading…
Reference in New Issue
Block a user