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

This commit is contained in:
Umiko 2025-05-05 09:00:55 +07:00
parent 6047c36aa3
commit 86fb2ab156

View File

@ -72,8 +72,12 @@ class YtService(_Service):
ydl_opts = self._ydl_config.copy()
ydl_opts["outtmpl"] = file_path.rsplit(".", 1)[0] + ".mp3"
with YoutubeDL(ydl_opts) as ydl:
info = ydl.process_ie_result(info, download=True)
url = info.get('webpage_url')
if not url:
raise errors.ServiceError("No URL provided for download")
ydl.download([url])
except Exception as e:
logging.error(f"Download error: {str(e)}", exc_info=True)