-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add _EXTRA_ARGS for various extractors
#1360
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
Conversation
|
Awesome! thanks for doing this, it's a great addition should we add |
Also fix `YOUTUBEDL_EXTRA_ARGS`.
EXTRA_*_ARGS for wget, curl, and singlefile_EXTRA_ARGS for various extractors
|
Looks great! One minor change then I'm ready to merge: @enforce_types
def dedupe(*options: List[str]) -> List[str]:
"""
Deduplicates the given options. Options that come earlier in the list clobber
later conflicting options.
"""
...Can you flip the In my experience, most CLI tools that accept duplicate args take the last arg as the winning one if they see the same arg twice, so I want to follow that convention. Site note: you can invoice me for all your PRs as you submit them, no need to wait till they're merged. 👍 |
Oh cool, I'll take a look at that next. |
|
@pirate I went ahead and added both the |
Summary
This PR adds a way to configure
wget,curl,singlefile,youtube-dl, andchromewithout overriding the default options.The main default options, extra options, and more specific options (like
WGET_USER_AGENT) are all deduplicated. It's assumed that options set with more specificity should take precedence, so something like the--user-agentargument forwgetwill come fromWGET_USER_AGENTinstead of_ARGSor_EXTRA_ARGS, and options set in_EXTRA_ARGStake precedence over_ARGS.This PR might need some more testing with more complex configurations. Hopefully it's simple enough that won't break anything while still being useful, but I'm not a wizard with
curlorwgetso there might be some possibilities I don't know about.Related issues
#1025
Changes these areas