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)