rssVideos: Use yt_dlp config when possible

This commit is contained in:
Geoffrey Frogeye 2022-03-27 15:18:41 +02:00
parent df6ab139af
commit 224345c04d
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -472,7 +472,9 @@ class RVDatabase:
@property @property
def ytdl_opts(self) -> dict: def ytdl_opts(self) -> dict:
return {"format": self.args.format, "allsubtitles": self.args.subtitles} # Get user/system options
_, _, _, ydl_opts = yt_dlp.parse_options()
return ydl_opts
@property @property
def ytdl_dry_opts(self) -> dict: def ytdl_dry_opts(self) -> dict:
@ -634,21 +636,6 @@ def get_args() -> configargparse.Namespace:
# TODO Envrionment variables # TODO Envrionment variables
# TODO Allow to ask # TODO Allow to ask
# How to download
parser.add(
"--format",
help="Use this format to download videos."
+ " See FORMAT SELECTION in youtube-dl(1)",
env_var="RSS_VIDEOS_FORMAT",
default="bestvideo+bestaudio/best",
)
parser.add(
"--subtitles",
help="Download all subtitles",
env_var="RSS_VIDEOS_SUBTITLES",
action="store_true",
)
parser.add( parser.add(
"action", "action",
nargs="?", nargs="?",