parent
198ba69026
commit
b2baaf4191
|
@ -13,7 +13,7 @@ from bottle import static_file
|
||||||
from bottle import SimpleTemplate
|
from bottle import SimpleTemplate
|
||||||
|
|
||||||
from .get import get
|
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):
|
def get_timestamp_of_file(file):
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import sys
|
import sys
|
||||||
from shutil import rmtree
|
|
||||||
from os import remove
|
from os import remove
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
@ -7,7 +6,7 @@ import requests
|
||||||
import bs4
|
import bs4
|
||||||
from gevent import sleep
|
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):
|
def delete_file(path):
|
||||||
sleep(SINGLE_IMAGE_DELETE_AFTER_SECS)
|
sleep(SINGLE_IMAGE_DELETE_AFTER_SECS)
|
||||||
|
@ -52,6 +51,8 @@ def get(url: str, write_dir: str, delete=True):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
error("Could not obtain url for detected image")
|
error("Could not obtain url for detected image")
|
||||||
continue
|
continue
|
||||||
|
if found_url.endswith('ico.jpg'):
|
||||||
|
continue
|
||||||
print(f"Downloading image {count}: {found_url}")
|
print(f"Downloading image {count}: {found_url}")
|
||||||
|
|
||||||
print("Writing image", f"{write_dir}{found_url[-11:]}")
|
print("Writing image", f"{write_dir}{found_url[-11:]}")
|
||||||
|
|
Loading…
Reference in New Issue