Compare commits

..

No commits in common. "36af51955568dde5cb7d67603421cf542ee43287" and "5d43a97562ce085492a1b016264f7f83d51d23de" have entirely different histories.

1 changed files with 0 additions and 32 deletions

View File

@ -1,32 +0,0 @@
import requests
import json
import os
tags = str(input("Enter tags: "))
destination = str(input("Enter the directory you want dowload to (the directory will be created if not exists): "))
done = False
def download_url(url):
if not os.path.exists(destination):
os.makedirs(destination)
filename = url.split('/')[-1].replace(" ", "_")
path = destination + "/" + filename
print("Downloading: " + url + " -> " + path)
resp = requests.get(url)
open(path, "wb").write(resp.content);
while (not done):
post_count = 0
page = 0
response = requests.get("https://api.rule34.xxx/index.php?page=dapi&s=post&json=1&q=index&tags=" + tags + "&pid=" + str(page) + "");
content = json.loads(response.content)
for entry in content:
post_count = post_count + 1
download_url(entry["file_url"])
if post_count < 100:
page = page + 1
post_count = 0
else:
done = True