fixing yt.py pt5.
Some checks are pending
Build-nightly / docker (push) Waiting to run

This commit is contained in:
Umiko 2025-05-05 09:33:54 +07:00
parent 86fb2ab156
commit a1e9bb6330

View File

@ -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)