1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

rearrange a few lines

This commit is contained in:
Viktor Stanchev 2013-02-21 15:31:19 -05:00
parent 8eb9a98dce
commit a507ce3b91

View File

@ -37,8 +37,9 @@ class MyHTMLParser(HTMLParser):
def main():
parser = argparse.ArgumentParser(description='Finds and downloads torrents from the Pirate Bay')
parser.add_argument('q', metavar='search_term', help="The term to search for")
parser.add_argument('--local', dest='database', help="An xml file containing the Pirate Bay database")
def local(args):
xml_str = ''
@ -52,9 +53,6 @@ def main():
f = urllib2.urlopen('http://thepiratebay.se/search/' + args.q.replace(" ", "+") + '/0/7/0')
return re.findall(""""(magnet\:\?xt=[^"]*)""", f.read())
parser.add_argument('q', metavar='search_term', help="The term to search for")
parser.add_argument('--local', dest='database', help="An xml file containing the Pirate Bay database")
args = parser.parse_args()
if args.database:
mags = local(args)