1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Might as well skip converting

This commit is contained in:
Steffo 2019-03-26 19:08:22 +01:00
parent 0b7219f27a
commit 88b2a9c5e3

View file

@ -154,7 +154,7 @@ class YoutubeDLVideo(Video):
"""Generate the filename of the video.""" """Generate the filename of the video."""
if self.info is None: if self.info is None:
raise errors.VideoInfoUnknown() raise errors.VideoInfoUnknown()
return "./opusfiles/{}.opus".format(re.sub(r'[/\\?*"<>|!:]', "_", self.info.get("title", self.info["id"]))) return "./opusfiles/{}.mp4".format(re.sub(r'[/\\?*"<>|!:]', "_", self.info.get("title", self.info["id"])))
def ready_up(self): def ready_up(self):
"""Download the video.""" """Download the video."""
@ -171,10 +171,10 @@ class YoutubeDLVideo(Video):
logger.info(f"Starting youtube_dl download of {repr(self)}") logger.info(f"Starting youtube_dl download of {repr(self)}")
with youtube_dl.YoutubeDL({"noplaylist": True, with youtube_dl.YoutubeDL({"noplaylist": True,
"format": "best", "format": "best",
"postprocessors": [{ # "postprocessors": [{
"key": 'FFmpegExtractAudio', # "key": 'FFmpegExtractAudio',
"preferredcodec": 'opus' # "preferredcodec": 'opus'
}], # }],
"outtmpl": self.get_filename(), "outtmpl": self.get_filename(),
"quiet": True}) as ytdl: "quiet": True}) as ytdl:
ytdl.download([self.url]) ytdl.download([self.url])