Created
June 30, 2019 08:48
-
-
Save Xevion/d88cf0f1f7cdc396b37c98c19067f849 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
import requests, os, sys | |
def flatten(thing): | |
final = [] | |
for item in thing: | |
final.extend(flatten(item)) if type(item) == list else final.append(item) | |
return final | |
nums = "0123456789" | |
filename = "2619{}" | |
url = "https://nhentai.net/g/2619{}/" | |
buildreplace = [[str(char1)+str(char2) for char2 in nums] for char1 in nums] | |
buildreplace = flatten(buildreplace) | |
build = [(filename.format(num), url.format(num)) for num in buildreplace] | |
for url in build: | |
file = open(os.path.join(sys.path[0], url[0]), 'w+', encoding='utf-8') | |
response = requests.get(url[1]) | |
file.write(response.text) | |
file.close() | |
if 'RiceKrispieTreatsAdvertisement' in response.text: | |
print(url) | |
print('File Written - {}'.format(url[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment