From e6bf79b444daf4d1d5ef2c2254244adf8d6e8d5c Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Thu, 21 Feb 2013 13:24:45 -0500 Subject: [PATCH] fix spaces --- pirate-get.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pirate-get.py b/pirate-get.py index dcf1318..af111dc 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -6,18 +6,18 @@ import sys import re if(len(sys.argv) == 1): - print "usage: pirate-get " - exit() + print "usage: pirate-get " + exit() q = sys.argv[1] -f = urllib2.urlopen('http://thepiratebay.se/search/'+q.replace(" ", "+")+'/0/7/0') +f = urllib2.urlopen('http://thepiratebay.se/search/' + q.replace(" ", "+") + '/0/7/0') mag = re.findall(""""(magnet\:\?xt=[^"]*)""", f.read()) if mag: - for m in range(len(mag)): - name = re.search("dn=([^\&]*)", mag[m]) - print str(m)+".", urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ") - l = raw_input("Select a link: ") - webbrowser.open(mag[int(l)]) + for m in range(len(mag)): + name = re.search("dn=([^\&]*)", mag[m]) + print str(m) + ".", urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ") + l = raw_input("Select a link: ") + webbrowser.open(mag[int(l)]) else: print "no results"