From c5a23a5d5ad2829ed0f312e784b1f5963d1b7e2c Mon Sep 17 00:00:00 2001 From: Alex Shnitman Date: Wed, 26 Apr 2023 17:56:29 +0300 Subject: [PATCH] fix download filename (closes #252) --- app/ytdl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/ytdl.py b/app/ytdl.py index f4f1709..d10756d 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -71,7 +71,11 @@ class Download: )}) def put_status_postprocessor(d): if d['postprocessor'] == 'MoveFiles' and d['status'] == 'finished': - self.status_queue.put({'status': 'finished', 'filename': d['info_dict']['_filename']}) + if '__finaldir' in d['info_dict']: + filename = os.path.join(d['info_dict']['__finaldir'], os.path.basename(d['info_dict']['filepath'])) + else: + filename = d['info_dict']['filepath'] + self.status_queue.put({'status': 'finished', 'filename': filename}) ret = yt_dlp.YoutubeDL(params={ 'quiet': True, 'no_color': True,