Last active
August 29, 2015 14:01
-
-
Save Shadey/49d9d36f0dbc402690a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/python | |
import sys | |
import urllib | |
from bs4 import BeautifulSoup as BS | |
if len(sys.argv) != 2: | |
print "Usage: %s thread_url"%(sys.argv[0]) | |
sys.exit() | |
soup=BS(urllib.urlopen(sys.argv[1]).read()) | |
for link in soup.find_all("p", class_="fileinfo"): | |
src = "https://lainchan.org"+link.find_next("a")['href'].encode("UTF-8") | |
filename = src.split("/")[-1].encode("UTF-8") | |
print "Getting %s" % src | |
urllib.urlretrieve(src,filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment