Skip to content

Instantly share code, notes, and snippets.

@tom-henderson
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tom-henderson/4a3962220360fe432e54 to your computer and use it in GitHub Desktop.
Save tom-henderson/4a3962220360fe432e54 to your computer and use it in GitHub Desktop.
Get magnet links from an eztv show page
import BeautifulSoup
import requests
import subprocess
url = "http://eztv.it/shows/385/louie/"
html = requests.get(url).text
soup = BeautifulSoup.BeautifulSoup(html)
links = soup.findAll(title="Magnet Link")
urls = [link.get('href') for link in links]
for url in urls:
subprocess.Popen(['open', url])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment