Do not render icos accidentally

Removed unused imports
This commit is contained in:
Kevin F 2021-10-04 19:35:55 +00:00
parent 198ba69026
commit b2baaf4191
2 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,7 @@ from bottle import static_file
from bottle import SimpleTemplate
from .get import get
from .config import IMAGE_CACHE, SINGLE_IMAGE_DELETE_AFTER_SECS, ALBUM_DELETE_AFTER_SECS, template_dir
from .config import IMAGE_CACHE, template_dir
def get_timestamp_of_file(file):

View File

@ -1,5 +1,4 @@
import sys
from shutil import rmtree
from os import remove
from threading import Thread
@ -7,7 +6,7 @@ import requests
import bs4
from gevent import sleep
from .config import SINGLE_IMAGE_DELETE_AFTER_SECS, ALBUM_DELETE_AFTER_SECS
from .config import SINGLE_IMAGE_DELETE_AFTER_SECS
def delete_file(path):
sleep(SINGLE_IMAGE_DELETE_AFTER_SECS)
@ -52,6 +51,8 @@ def get(url: str, write_dir: str, delete=True):
except KeyError:
error("Could not obtain url for detected image")
continue
if found_url.endswith('ico.jpg'):
continue
print(f"Downloading image {count}: {found_url}")
print("Writing image", f"{write_dir}{found_url[-11:]}")