From 68b2c322bcb6027647f0171d2db2a87417cc4786 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Mon, 15 Jan 2024 19:13:45 +0300 Subject: [PATCH 1/2] Sometimes yt-dlp does not provide final filename. --- app/Download.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Download.py b/app/Download.py index dafccd35..19e5bff1 100644 --- a/app/Download.py +++ b/app/Download.py @@ -298,6 +298,13 @@ class Download: self.info.eta = status.get('eta') if self.info.status == 'finished' and 'filename' in status and self.info.format != 'thumbnail': - self.info.file_size = os.path.getsize(status.get('filename')) + try: + self.info.file_size = os.path.getsize( + status.get('filename')) + except FileNotFoundError: + log.warning( + f'File not found: {status.get("filename")}') + self.info.file_size = None + pass await self.notifier.updated(self.info) From 436b34bea082dd7345d36d94abcc61a9e7a5c75d Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Mon, 15 Jan 2024 19:30:24 +0300 Subject: [PATCH 2/2] Updated playlist log count to show title and id. --- app/DownloadQueue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DownloadQueue.py b/app/DownloadQueue.py index 463af79d..9f6bf7f8 100644 --- a/app/DownloadQueue.py +++ b/app/DownloadQueue.py @@ -65,7 +65,7 @@ class DownloadQueue: etype = entry.get('_type') or 'video' if etype == 'playlist': entries = entry['entries'] - log.info(f'playlist detected with {len(entries)} entries') + log.info(f'Found [{len(entries)}] new entries for [{entry.get("id")}: {entry.get("title")}].') playlist_index_digits = len(str(len(entries))) results = [] for index, etr in enumerate(entries, start=1):