better path handling
This commit is contained in:
parent
fb8baf35f4
commit
f197c47a06
@ -21,8 +21,8 @@ def get_timestamp_of_file(file):
|
||||
def album(id):
|
||||
req = IMAGE_CACHE
|
||||
|
||||
get("/a/" + id, req)
|
||||
found_list_file = IMAGE_CACHE + ("/a/" + id).replace('/', '_')
|
||||
get("a/" + id, req)
|
||||
found_list_file = IMAGE_CACHE + ("a/" + id).replace('/', '_')
|
||||
|
||||
with open(found_list_file, 'r') as f:
|
||||
imgs = f.read().split(',')
|
||||
|
@ -25,15 +25,13 @@ def error(msg):
|
||||
def get(url: str, write_dir: str, delete=True):
|
||||
orig_url = url
|
||||
if not url.startswith('https://imgur.com/'):
|
||||
url = 'https://imgur.com' + url
|
||||
found_url = ''
|
||||
found_urls = []
|
||||
found_list_file = ''
|
||||
url = 'https://imgur.com/' + url
|
||||
|
||||
album = False
|
||||
if "gallery" in url:
|
||||
url = url.replace("gallery", "a")
|
||||
if "/a/" in url:
|
||||
if url.startswith("https://imgur.com/a/"):
|
||||
album = True
|
||||
if not url.endswith("blog"):
|
||||
url += "/layout/blog"
|
||||
|
Loading…
Reference in New Issue
Block a user