This commit is contained in:
parent
6047c36aa3
commit
86fb2ab156
@ -72,8 +72,12 @@ class YtService(_Service):
|
|||||||
|
|
||||||
ydl_opts = self._ydl_config.copy()
|
ydl_opts = self._ydl_config.copy()
|
||||||
ydl_opts["outtmpl"] = file_path.rsplit(".", 1)[0] + ".mp3"
|
ydl_opts["outtmpl"] = file_path.rsplit(".", 1)[0] + ".mp3"
|
||||||
|
|
||||||
with YoutubeDL(ydl_opts) as ydl:
|
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:
|
except Exception as e:
|
||||||
logging.error(f"Download error: {str(e)}", exc_info=True)
|
logging.error(f"Download error: {str(e)}", exc_info=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user