<commit_before>from bs4 import BeautifulSoup
import requests, shutil, random, string

def randomword(length):
   return ''.join(random.choice(string.lowercase) for i in range(length))

def download_img(url):
	ext = url.split(".").lower()[-1];
	filename = randomword(10)
	response = requests.get(url, stream=True)
	with open(filename + '.'+ ext, 'wb') as out_file:
	    shutil.copyfileobj(response.raw, out_file)
	del response
	print(filename + " " + url)
 	pass 

#url = "http://boards.4chan.org/wg/thread/5933467/beautiful-girl-thread"
url = raw_input('Enter your input:')
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data)

links = soup.find_all("a", class_="fileThumb")
for link in links:
	download_img("http:" + link.get('href'))<commit_msg>Fixed bad use of lower function, now the scrapper saves the file with the original extension<commit_after>from bs4 import BeautifulSoup
import requests, shutil, random, string

def randomword(length):
   return ''.join(random.choice(string.lowercase) for i in range(length))

def download_img(url):
	ext = url.split(".")[-1]
	filename = randomword(10)
	response = requests.get(url, stream=True)
	with open(filename + '.'+ ext, 'wb') as out_file:
	    shutil.copyfileobj(response.raw, out_file)
	del response
	print(filename + " " + url)
 	pass 

#url = "http://boards.4chan.org/wg/thread/5933467/beautiful-girl-thread"
url = raw_input('Enter your input:')
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data)

links = soup.find_all("a", class_="fileThumb")
for link in links:
	download_img("http:" + link.get('href'))
{'fraction_non_alphanumeric': 0.14962121212121213, 'fraction_numerical': 0.015151515151515152, 'mean_word_length': 5.11969111969112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4755151', 'n_tokens_mistral': 568, 'n_tokens_neox': 544, 'n_words': 134}