jmbannon / ytdl-sub

Lightweight tool to automate downloading and metadata generation with yt-dlp
https://ytdl-sub.readthedocs.io
GNU General Public License v3.0
1.9k stars 71 forks source link

Allow to override config values from the command line #1010

Open ajimix opened 5 months ago

ajimix commented 5 months ago

I'm trying to override config working_directory when calling the command line but looks like it's not possible:

Trying like this:

ytdl-sub --config config.yaml --configuration.working_directory ".ytdl-sub-downloads-abcd" dl --tv --url "https://www.youtube.com/watch?v=abc1234"

Gives error: ytdl-sub: error: argument subparser: invalid choice: '.ytdl-sub-downloads-abcd' (choose from 'sub', 'dl', 'view')

Tried also:

ytdl-sub --config config.yaml dl --configuration.working_directory ".ytdl-sub-downloads-abcd" --tv --url "https://www.youtube.com/watch?v=abc1234"

That gives error: Validation error in cli-dl-b3683b3c: 'cli-dl-b3683b3c' contains the field 'configuration' which is not allowed. Allowed fields: _view, audio_extract, chapters, date_range, download, embed_thumbnail, file_convert, filter_exclude, filter_include, format, match_filters, music_tags, nfo_tags, output_directory_nfo_tags, output_options, overrides, preset, regex, split_by_chapters, subtitles, throttle_protection, video_tags, ytdl_options

jmbannon commented 2 months ago

What is the end-goal of overriding the working dir?

ajimix commented 2 months ago

@jmbannon I’m trying to download several individual videos on demand, which can happen in parallel. I’m using an API built on top of ytdl-sub.

So each new instance of ytdl-sub needs a different working directory

jmbannon commented 2 months ago

Got it. Perhaps we can make it so if no working directory is specified, it will use a random temp folder each time

ajimix commented 2 months ago

@jmbannon yes that would be great