Search code examples
youtube-dl

How to download and get video informations at the same time in youtube-dl?


In youtube-dl cli, How can i get information about the video (in json output) while the video beign downloaded by the app?

When i use this command:

youtube-dl https://www.youtube.com/watch?v=jNQXAC9IVRw

It only shows me output filename, But what a about the duration, resolution, etc... ?

I do this with 2 requests, But is it possible in on go?

It would be great if it dump the video meta data into a json file as well as output filename, Because i also struggling to pragmatically get the path of downloaded file (i have to use regex)


Solution

  • Just add --print-json in your command line.

    youtube-dl --print-json https://www.youtube.com/watch?v=jNQXAC9IVRw  
    

    This outputs a big JSON, while video is still downloading