Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore config files #627

Closed
wants to merge 1 commit into from
Closed

Add option to ignore config files #627

wants to merge 1 commit into from

Conversation

jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 11, 2013

That way if you have set in your config files to use title or other option in the output files, and you specify an output template on the command line, the template is used and you don't get the error: using output template conflicts with using title, video ID or auto number.

@phihag
Copy link
Contributor

phihag commented Jan 11, 2013

While I like the option, we should just fix the bug you mention.

@ghost ghost assigned phihag Jan 11, 2013
@jaimeMF
Copy link
Collaborator Author

jaimeMF commented Jan 11, 2013

I don't think it's a bug, what option would you give more importance: the template or the other options?

@phihag
Copy link
Contributor

phihag commented Jan 11, 2013

The latter one, whichever that is. So we should go ahead and for each list of arguments parse -t, --id, -o and friends, and override the previous configuration.

@jaimeMF
Copy link
Collaborator Author

jaimeMF commented Jan 11, 2013

Does optparse give the order of the options?

@phihag
Copy link
Contributor

phihag commented Jan 11, 2013

Sorry, that wasn't well-expressed. I mean that options in the user configuration file override options in the system config file, and option in on the command-line override options in the configuration file (within reason). 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))

@jaimeMF
Copy link
Collaborator Author

jaimeMF commented Jan 11, 2013

That makes sense, but would it still complain when both template and other option is given on the command line, or would it choose one of them?

@phihag
Copy link
Contributor

phihag commented Jan 12, 2013

It would still complain, unless we change that behavior too. I see little reason of why we would that though.

Documented these issues in #632 and #633.

@phihag phihag closed this Jan 12, 2013
joedborg pushed a commit to joedborg/youtube-dl that referenced this pull request Nov 17, 2020
[pull] master from ytdl-org:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants