-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Allow passing different arguments to different postprocessors #27723
base: master
Are you sure you want to change the base?
Conversation
Stripped down to minimum required code from: yt-dlp/yt-dlp@1b77b34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also could be beneficial to have common args
for each post-processor entry in postprocessors
list for providing arguments programmatically for post-processors known beforehand right away without bothering with postprocessor_args
.
@dstftw I assume you are talking about API access. In that case, it would be beyond the scope of this PR |
dc106fd
to
9335537
Compare
i think that passing arguments to all post-processors should no longer be encouraged(with the |
One may need to pass different args to different post-processors based on the same program. |
just to clarify my requested change, instead of introducing and encouraging users to use |
Suggesting using |
this happened when there wasn't another way to specify arguments for a specific post-processor, so when both posibilities are available the user should:
while the |
@remitamine I get your point and I have an idea how to implement this. But first we need to decide what should happen if the user passes both a
True, but sending the args to all PP is the current behaviour. So we must maintain an option to still do it. We could maybe discourage the user from using default by either:
imo, a simple warning is sufficient. But I will go with you guys' decision |
if it's going to be added, i think both arguments should be used, if a user uses both the
passing arguments to all post-processor is still allowed by not using any prefix and it will be kept only for backward compatibility(ex: users already having the option in their config file). |
@remitamine I will implement your suggestions tonight and let you know |
50c26fb
to
92651cd
Compare
@remitamine I added the ability to use general program prefix like Additionally, you can also give the arguments much more specifically by using I have not yet updated the documentation to reflect these changes. Honestly, I am not entirely sure how to explain the feature in a simple way. Please give me suggestions if you have any Also, I noticed that
|
as it now allowed to use the
|
The same way all switches are handled. The latter arguments override the former
If you pass it with a single switch, it is passed as-is. If you pass it seperately, the latter takes priority. For example,
I don't understand what you mean. Could you provide example? |
|
hm.. I looked through the code again and this case is not properly handled. I will make a commit to fix it. Here's how I think this should work: (
should result in:
Let me know if this a reasonable approach or changes need to be made |
i think to preserve the current behaviour, the arguments would be passed to all PPs including the ones that are using specific prefixes. |
I don't think it should work like that. It shouldn't be a issue that the new syntax, when used, is overriding the old one. Also, this allows passing args easily to all PP except a specific one. Eg: |
this inconsitent with the behaviour that you've described in you're example:
where the ffmpeg command will combine the program specific args and the PP specific args, while in the example i described the options are not combined. |
I assume you mean this:
There is no PP specific args given in that
No, it is exactly how I specified it
If Please explain what you find inconsistent with it |
as i think of the prefixes, i think of them as classes from the most specfic to the more generic:
but i think you're considiring
|
Yes, there is no reasonable way to say which of PP/exe is more specific. First I also thought of simply combining all the args. This is also the easiest to code. But it would make it very difficult for the user to override previous args.
If you still think that is the way to go, I can modify the code to be so. |
a program is not bound to only a specific PP, there nothing that prevents |
I could argue the same in reverse. But that is beside the point. Honestly, what we are discussing is simply convention and I don't have any strong preference either way. As one of the core maintainers of this project, it is up to you to decide how it should behave. Any of the behaviors we discussed are easy to implement and not too different in usage. We simply need to decide on a convention. Maybe discuss with @dstftw and finalize how the behaviour should be, and I will make it so.
For the time being, I am going to commit this behaviour |
If PP+exe args is specifically given, only it used. Otherwise, PP and exe args are combined. If none of the PP, exe or PP+exe args are given, the default is used
as i'm not the one who started the review process, i'm not even trying to make a full review here(otherwise i would'nt use just comments and would've used the GitHub requested changes process), again, what i have provided untill now are just suggestions, there where some points that i wanted to be taken into considiration. |
* Added `PP+exe:args` syntax If `PP+exe:args` is specifically given, only it used. Otherwise, `PP:args` and `exe:args` are combined. If none of the `PP`, `exe` or `PP+exe` args are given, `default` is used `Default` is purposely left undocumented since it exists only for backward compatibility * Also added proper handling of args in `EmbedThumbnail` Related: ytdl-org/youtube-dl#27723
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
Allow passing different arguments to different postprocessors like this:
For backward compatibility,
--postprocessor-args <args>
is equivalent to:Closes #27593 #26863