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

Parameter to output video information (special sequences as in output template) #22442

Closed
vladflorinchelaru opened this issue Sep 17, 2019 · 1 comment
Labels

Comments

@vladflorinchelaru
Copy link

@vladflorinchelaru vladflorinchelaru commented Sep 17, 2019

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2019.09.12.1
  • I've searched the bugtracker for similar feature requests including closed ones

Create a parameter to be passed such that youtube-dl will output info about the video. This would be of big help to 3rd party tools that can get the info easier. When the parameter is passed to youtube-dl, along with the URL, the output should be listing ALL the special sequences that are valid.
Additionally, it should output also the thumbnail URL, all available formats (-F) and best audio, best video, and overall best formats.
Not applicable sequences would be either skipped or shown as null.
Example: youtube-dl.exe "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --get-info
Output:

ID = dQw4w9WgXcQ
Title = Rick Astley - Never Gonna Give You Up (Video)
URL = https://www.youtube.com/watch?v=dQw4w9WgXcQ
Ext = mp4
[...]
Chapter = null //or skip altogeter
[...]
Thumbnail URL = https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg
Formats
249 webm audio only tiny 49k , opus @ 50k (48000Hz), 1.18MiB
250 webm audio only tiny 65k , opus @ 70k (48000Hz), 1.55MiB
140 m4a audio only tiny 130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 3.27MiB
251 webm audio only tiny 136k , opus @160k (48000Hz), 3.28MiB
394 mp4 256x144 144p 92k , av01.0.00M.08, 25fps, video only, 2.16MiB
160 mp4 256x144 144p 108k , avc1.4d400c, 25fps, video only, 2.00MiB
278 webm 256x144 144p 126k , webm container, vp9, 25fps, video only, 2.44MiB
395 mp4 426x240 240p 212k , av01.0.00M.08, 25fps, video only, 4.60MiB
242 webm 426x240 240p 218k , vp9, 25fps, video only, 4.16MiB
133 mp4 426x240 240p 258k , avc1.4d4015, 25fps, video only, 4.43MiB
396 mp4 640x360 360p 386k , av01.0.01M.08, 25fps, video only, 8.20MiB
243 webm 640x360 360p 392k , vp9, 25fps, video only, 7.11MiB
134 mp4 640x360 360p 463k , avc1.4d401e, 25fps, video only, 8.81MiB
244 webm 854x480 480p 632k , vp9, 25fps, video only, 10.33MiB
397 mp4 854x480 480p 704k , av01.0.04M.08, 25fps, video only, 13.92MiB
135 mp4 854x480 480p 767k , avc1.4d401e, 25fps, video only, 12.38MiB
247 webm 1280x720 720p 1096k , vp9, 25fps, video only, 18.06MiB
136 mp4 1280x720 720p 1155k , avc1.4d401f, 25fps, video only, 16.33MiB
398 mp4 1280x720 720p 1436k , av01.0.05M.08, 25fps, video only, 27.96MiB
248 webm 1920x1080 1080p 2658k , vp9, 25fps, video only, 55.18MiB
137 mp4 1920x1080 1080p 4323k , avc1.640028, 25fps, video only, 69.12MiB
18 mp4 640x360 360p 600k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 15.18MiB (best)
Best = 18
Bestaudio = 251
Bestvideo = 137

This parameter will take precedence over any other parameter, and the video will not be downloaded. The only exception would be "-o" through which a file can be specified. If such is the case, youtube-dl will output everything to that file instead of the console. This mode would be preferred because the console might not support Unicode characters (ăîâșț). The parameter itself might have different modes of work:
--get-info plain would output plain text, <sequence> = <value> as the example from before.
--get-info json would output data in json format.
--get-info xml would output data in xml
--get-info nbt would output data in Notch's named binary tag format and so on...
Both text-based and binary-based formats can be used.

This functionality is nonetheless currently attainable through something like youtube-dl <URL> -o %(NAME)s --get-filename but to get ALL sequences it is required to run a youtube-dl instance for each. This eats a lot of RAM and by using --get-info we can improve running time of 3rd party programs.
Also, 3rd party programs might choose to use youtube-dl through CLI instead of integrating it in itself because in this way youtube-dl can be updated independently of the GUI program.

Thanks a lot for reading! (If I knew python, I would have done it myself.)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 18, 2019

Parse JSON output.

@dstftw dstftw closed this Sep 18, 2019
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.