Allow contradictory options in various config files #460

Closed
opened 2026-02-20 23:04:41 -05:00 by deekerman · 1 comment
Owner

Originally created by @phihag on GitHub (Jan 12, 2013).

More specific channels (System config < user config < command-line) should override less specific ones.

The parsing process should go like

default_settings = {'template': '%(id)s.%(ext)s'}
settings = default_settings.copy()
args = readArgs('/etc/youtube-dl.conf')
settings.update(parseArgs(args, errmsg='invalid system configuration'))
args = readArgs('~/.config/youtube-dl.conf')
settings.update(parseArgs(args, errmsg='invalid user configuration'))
settings.update(parseArgs(sys.argv))
Originally created by @phihag on GitHub (Jan 12, 2013). More specific channels (System config < user config < command-line) should override less specific ones. The parsing process should go like ``` default_settings = {'template': '%(id)s.%(ext)s'} settings = default_settings.copy() args = readArgs('/etc/youtube-dl.conf') settings.update(parseArgs(args, errmsg='invalid system configuration')) args = readArgs('~/.config/youtube-dl.conf') settings.update(parseArgs(args, errmsg='invalid user configuration')) settings.update(parseArgs(sys.argv)) ```
deekerman 2026-02-20 23:04:41 -05:00
Author
Owner

@dirkf commented on GitHub (Feb 5, 2024):

Nowadays (options.py):

        argv = system_conf + user_conf + custom_conf + command_line_conf
@dirkf commented on GitHub (Feb 5, 2024): Nowadays (`options.py`): ``` argv = system_conf + user_conf + custom_conf + command_line_conf ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#460
No description provided.