More logging

This commit is contained in:
MMaker 2025-02-27 11:18:24 -05:00
parent 246de3e29d
commit e2d6cabed5
Signed by: mmaker
GPG Key ID: CCE79B8FEDA40FB2

3
app.py
View File

@ -283,11 +283,14 @@ def proxy(video_id):
logger.info(f"Received request for video ID: {video_id}")
if cache:
logging.info(f"Checking cache for video ID: {video_id}")
cached_html = cache.get(video_id)
if cached_html is not None:
logger.info(f"Using cached response for video ID: {video_id}")
return Response(cached_html, mimetype="text/html") # type: ignore
logging.info(f"Cache miss for video ID: {video_id} - fetching")
# Not in cache or cache expired; fetch from nicovideo.jp
real_url = f"https://www.nicovideo.jp/watch/{video_id}"
params, soup = get_data(video_id, real_url)