mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
fix single video playlists
This commit is contained in:
parent
a4078dd336
commit
668595908b
1 changed files with 2 additions and 0 deletions
|
@ -52,6 +52,8 @@ class Video:
|
||||||
# Retrieve info before downloading
|
# Retrieve info before downloading
|
||||||
with youtube_dl.YoutubeDL() as ytdl:
|
with youtube_dl.YoutubeDL() as ytdl:
|
||||||
info = await loop.run_in_executor(executor, functools.partial(ytdl.extract_info, self.ytdl_url, download=False))
|
info = await loop.run_in_executor(executor, functools.partial(ytdl.extract_info, self.ytdl_url, download=False))
|
||||||
|
if "entries" in info:
|
||||||
|
info = info["entries"][0]
|
||||||
file_id = info.get("title", str(hash(self.ytdl_url)))
|
file_id = info.get("title", str(hash(self.ytdl_url)))
|
||||||
file_id = re.sub(r"(?:\/|\\|\?|\*|\"|<|>|\||:)", "_", file_id)
|
file_id = re.sub(r"(?:\/|\\|\?|\*|\"|<|>|\||:)", "_", file_id)
|
||||||
if os.path.exists(f"opusfiles/{file_id}.opus"):
|
if os.path.exists(f"opusfiles/{file_id}.opus"):
|
||||||
|
|
Loading…
Reference in a new issue