Download/Find and Stream Youtube video using Google Chrome Dev Tools

13,659

Yes it is possible (maybe not legal) but I want to explain the technical part (note that I don't download videos from YouTube, there is no reason, as it is always there on the cloud!).

YouTube transmits those streams in bytearrays and if you check for one clear url it doesn't exist. BUT: if you look in the dev tools and trace the network you can find this url.

Take a look at this image: enter image description here

YouTube transmits in separate channels and at runtime puts it all together, using XMLHttpRequest to get the video and audio separately.

All calls which start with videoplayback? are about the video/audio streaming. The videoplayback? Ajax calls always come paired together: content-type= audio/* and content-type= video/* in some order.

You can individuate them from the headers (in the image it looks like content-type= video/* or content-type= audio/*)

To GET FULL AUDIO/VIDEO STREAM THE ONLY THING TO DO IS : Change the parameter RANGE.

The parameter RANGE specifies the segment of this content to stream (which is never normally the entire media since then it wouldn't be streaming, and to avoid downloads from nerd people)

Copy the url which starts with videoplayback? (like is shown in the image). Find the parameter range= at the end of the querystring. The parameter range= is composed of a START and END (eg. range=18096-20098) which are separated by a “-”.

Put 0 (zero) for START and a long number for END like 9999999999 (eg. range=0-999999999999). (Editor note, my guess is that these are the 'seconds' timestamps of the video)

After you have modified this URL, copy and paste it in a new tab in your browser and you can simply download the audio or video.

Get both streams and put them together in some audio/video editing software (eg. NUENDO)

IMPORTANT: Don't change other parameters, as this is a self validating URL.

Share:
13,659
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    Admin almost 2 years

    I want to download/extract videos from youtube using Google Chrome Dev Tools. When I inspect the element, I see this in Dev Tools:

    <video tabindex="-1" class="video-stream html5-main-video" controlslist="nodownload" style="width: 1004px; height: 753px; left: 0px; top: 0px;" src="blob:https://www.youtube.com/db4f4abe-c290-4e61-a904-68435fdd9933"></video>  
    

    I've tried going to Network -> searching for .mp4 and .flv but nothing is showing.

    How can I download using Dev Tools? Also, is there a way to get the video link and have nothing but the video play in a new tab?

    Thanks for your help.

  • G3nt_M3caj
    G3nt_M3caj over 3 years
    Hi @dantechguy editor. Thanks for providing and editing to my answer in a better English. Not your note is not about time is length of bytes that file have. Stay safe ;) Gent
  • ttvd94
    ttvd94 over 3 years
    Then how does download managers and other websites get to generate official google links with audio AND video combined?
  • G3nt_M3caj
    G3nt_M3caj over 3 years
    Open a new question in SO explaining your doubts (as above) then, I’m sure, there is (maybe) an answer for you. The answer above is related to OP question.