fix(download): check local file correctly
Browse files- download_images.py +3 -1
download_images.py
CHANGED
@@ -61,7 +61,9 @@ def fetch_posts_to_queue():
|
|
61 |
(post_id, file_url, file_ext) = post
|
62 |
|
63 |
# Check if the file already exists
|
64 |
-
if os.path.exists(
|
|
|
|
|
65 |
continue
|
66 |
|
67 |
# Check if the file_ext is an image
|
|
|
61 |
(post_id, file_url, file_ext) = post
|
62 |
|
63 |
# Check if the file already exists
|
64 |
+
if os.path.exists(
|
65 |
+
os.path.join(OUT_DIR, f"{post_id % 1000:04d}", f"{post_id}.{file_ext}")
|
66 |
+
):
|
67 |
continue
|
68 |
|
69 |
# Check if the file_ext is an image
|