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

Question: Order of output from the -e, -g, etc cmd line options? #26651

Closed
joeschmoe40 opened this issue Sep 21, 2020 · 3 comments
Closed

Question: Order of output from the -e, -g, etc cmd line options? #26651

joeschmoe40 opened this issue Sep 21, 2020 · 3 comments

Comments

@joeschmoe40
Copy link

@joeschmoe40 joeschmoe40 commented Sep 21, 2020

I have a script where I use youtube-dl to generate the title, the (long) URL, and the duration of a video. I use the options: -e, --get-duration, and -g

It works fine, but I've noticed that the output (which is redirected to a file with ">") always comes out in the order (3 lines in the output file):

title
url
duration

regardless of the order of the command line options. I.e., I can use the order I listed above (-e first, then --get-duration, then -g) or any other order, but it always come out in the order shown above.

This is fine, of course, and obviously not a bug, but I want to know a) Why this is and b) Can I rely on it (always coming out in that order) ?

Version is 2020.09.06, running under Windows 10.

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Sep 22, 2020

Bueller? Bueller?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 22, 2020

These options are not supposed to be used together in the first place, you should use JSON output instead.

@dstftw dstftw closed this Sep 22, 2020
@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Sep 22, 2020

I have used JSON output from youtube-dl on prior occasions. But that adds complexity.

Is it documented anywhere that you aren't supposed to use more than one of these at a time? Or is that just an opinion?

Anyway, still curious about the answer. Is it deterministic what order they will come out in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.