Skip to content

Instantly share code, notes, and snippets.

@prongs
Created May 11, 2014 21:30
Show Gist options
  • Save prongs/df4cd5e9b84ff7f44d49 to your computer and use it in GitHub Desktop.
Save prongs/df4cd5e9b84ff7f44d49 to your computer and use it in GitHub Desktop.
gotdownloader
from bs4 import BeautifulSoup as bs
from StringIO import StringIO
import gzip
import urllib2
import os
s = bs(gzip.GzipFile(fileobj=StringIO(urllib2.urlopen("http://kickass.to/search/game%20of%20thrones/?from=opensearch").read())).read())
magnet = s.find_all('table')[1].find_all('tr')[1].find_all('a')[3]['href']
print magnet
os.system("start \"\" \"%s\"" % magnet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment