diff --git a/rwx/sw/ytdlp/__init__.py b/rwx/sw/ytdlp/__init__.py index 68ea71a..41750aa 100644 --- a/rwx/sw/ytdlp/__init__.py +++ b/rwx/sw/ytdlp/__init__.py @@ -10,6 +10,7 @@ from rwx import Object from rwx.fs import read_file_yaml from rwx.log import stream as log +EXT = "webm" TIMESTAMP = "%Y%m%d%H%M%S" URL = "https://youtube.com" @@ -128,7 +129,7 @@ def download_video(video_id: str | None) -> None: if video_id: ytdl( { - "format": "bestvideo[ext=webm]+bestaudio[ext=webm]", + "format": "+".join([f"best{av}[ext={EXT}]" for av in ["video", "audio"]]), "outtmpl": "%(id)s.%(ext)s", "postprocessors": [ {