From 04e93cad07f3179f6fcf054b760bc80d43e9653c Mon Sep 17 00:00:00 2001 From: TylerCG <117808427+TylerCG@users.noreply.github.com> Date: Mon, 12 May 2025 10:33:25 -0400 Subject: [PATCH] Update download.py --- app/download.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/download.py b/app/download.py index 880cf43..806a880 100644 --- a/app/download.py +++ b/app/download.py @@ -1,7 +1,13 @@ -import os, yt_dlp, json, requests, re +import os, yt_dlp, json, requests, re, logging from bs4 import BeautifulSoup from urllib.parse import urlsplit +logger = logging.getLogger(__name__) + +# Define the hook function +def my_hook(d): + if d['status'] == 'finished': + logging.info(f"Download completed: {d['filename']}") def ebook(url, author): destination = f"/ebooks/{author}" @@ -118,6 +124,7 @@ class dropout(): filename_template = f"{show} - S{int(season):02}E{episode_number} - %(title)s.%(ext)s" dl_opts = { + 'progress_hooks': [my_hook], 'format': 'bestvideo+bestaudio/best', 'audio_quality': '256K', 'paths': {