diff --git a/utilities/rule34.xxx-parser.py b/utilities/rule34.xxx-parser.py index 35f4d72..ee72df5 100644 --- a/utilities/rule34.xxx-parser.py +++ b/utilities/rule34.xxx-parser.py @@ -12,6 +12,10 @@ def download_url(url): filename = url.split('/')[-1].replace(" ", "_") path = destination + "/" + filename print("Downloading: " + url + " -> " + path) + if os.path.exists(path): + print("Skipping downloaded content...") + return # skip downloaded content + resp = requests.get(url) open(path, "wb").write(resp.content); @@ -19,7 +23,6 @@ post_count = 0 page = 0 while (not done): - 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: