From a507ce3b914e5a1e205340929b8cb9c92c4468e4 Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Thu, 21 Feb 2013 15:31:19 -0500 Subject: [PATCH] rearrange a few lines --- pirate-get.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pirate-get.py b/pirate-get.py index 5db4434..d94b6ff 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -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)