From a1e9bb6330040015af3e4d68e3e5799e54e83a87 Mon Sep 17 00:00:00 2001 From: Umiko Date: Mon, 5 May 2025 09:33:54 +0700 Subject: [PATCH] fixing yt.py pt5. --- bot/services/yt.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bot/services/yt.py b/bot/services/yt.py index b660ae7..0d2251d 100644 --- a/bot/services/yt.py +++ b/bot/services/yt.py @@ -74,10 +74,8 @@ class YtService(_Service): ydl_opts["outtmpl"] = file_path.rsplit(".", 1)[0] + ".mp3" with YoutubeDL(ydl_opts) as ydl: - url = info.get('webpage_url') - if not url: - raise errors.ServiceError("No URL provided for download") - ydl.download([url]) + dl = get_suitable_downloader(info)(ydl, ydl_opts) + dl.download(file_path, info) except Exception as e: logging.error(f"Download error: {str(e)}", exc_info=True)