mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
fix spaces
This commit is contained in:
parent
031d057cb7
commit
e6bf79b444
@ -9,14 +9,14 @@ if(len(sys.argv) == 1):
|
|||||||
print "usage: pirate-get <search query>"
|
print "usage: pirate-get <search query>"
|
||||||
exit()
|
exit()
|
||||||
q = sys.argv[1]
|
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())
|
mag = re.findall(""""(magnet\:\?xt=[^"]*)""", f.read())
|
||||||
|
|
||||||
if mag:
|
if mag:
|
||||||
for m in range(len(mag)):
|
for m in range(len(mag)):
|
||||||
name = re.search("dn=([^\&]*)", mag[m])
|
name = re.search("dn=([^\&]*)", mag[m])
|
||||||
print str(m)+".", urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ")
|
print str(m) + ".", urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ")
|
||||||
l = raw_input("Select a link: ")
|
l = raw_input("Select a link: ")
|
||||||
webbrowser.open(mag[int(l)])
|
webbrowser.open(mag[int(l)])
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user