From 4f8ab2e77370e7368eb4c2fc84fd20768f5c324a Mon Sep 17 00:00:00 2001 From: TylerCG <117808427+TylerCG@users.noreply.github.com> Date: Mon, 12 May 2025 10:52:09 -0400 Subject: [PATCH] Update download.py --- app/download.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/download.py b/app/download.py index 1495b5d..d4050b4 100644 --- a/app/download.py +++ b/app/download.py @@ -2,9 +2,6 @@ import os, yt_dlp, json, requests, re, logging from bs4 import BeautifulSoup from urllib.parse import urlsplit -# Setup logging -logging.basicConfig(filename='/data/logs/syllabus.log', level=logging.INFO, - format='%(asctime)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) # Define the hook function @@ -200,6 +197,7 @@ class dropout(): filename_template = f"{show} - S00E{episode_number} - %(title)s.%(ext)s" dl_opts = { + 'progress_hooks': [my_hook], 'format': 'bestvideo+bestaudio/best', 'audio_quality': '256K', 'paths': { @@ -252,7 +250,7 @@ class dropout(): class youtube(): def ydl(url, location): - dl_ops = {'paths': {'temp': '/temp', 'home': location}, 'outtmpl': '%(uploader)s/%(title)s.%(ext)s'} + dl_ops = {'progress_hooks': [my_hook],'paths': {'temp': '/temp', 'home': location}, 'outtmpl': '%(uploader)s/%(title)s.%(ext)s'} if dl_ops['paths']['home'] == '/podcasts': dl_ops['format'] = 'bestaudio/best[ext=mp3]' dl_ops['postprocessors'] = [{