don't try to fetch dlsite metadata for non-dlsite works

main
xenofem 2024-01-29 03:01:35 -05:00
parent 3ca4dcc807
commit 309f19574d
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,8 @@ import requests
NUMBER_REGEX = re.compile('[0-9]+')
DLSITE_ID_REGEX = re.compile('^[BR]J[0-9]+$')
IMAGE_FILE_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif', '.tiff']
IGNOREABLE_FILES = ['Thumbs.db', '__MACOSX', '.DS_Store']
@ -69,6 +71,10 @@ async def fetch_async(args):
if res.fetchone() is not None:
continue
if not DLSITE_ID_REGEX.fullmatch(work_id):
print(f"{work_id} doesn't seem to be from DLSite, not attempting to fetch metadata")
continue
print(f'Fetching metadata for {work_id}')
metadata = await api.get_work(work_id)