Answer the question
In order to leave comments, you need to log in
Download YouTube video via DevTools?
Good day to all! Can you please tell me how can I download YouTube video through DevTools?
I know that can be downloaded through various sites or yt-dlp. But how to do it without them?
In the console only xhr files go. Maybe there is a way to get a link to the video?
Update:
I managed to pull the video from the console as I needed.
1) Choose the video you want.
2) Before starting the video, choose the quality you need.
3) Open Developer tools - Network and run the video for a few seconds
4) In the Network tab, after the video starts playing, files will appear with the name videoplayback?expire=...
Some of these files with the name videoplayback?expire=... refer to video file, and some to the sound.
5) Open the link to the file in a new tab, there will be a window with the video, but there is nothing there.
6) In the address bar at the very end, look for &range=some number-some number. For example, &range=1680777-2230746 and write it as &range=0-99999999999999999. There can be as many nines or other numbers as you like. As I understand it, this is the size of the file in bytes. This will download the entire file.
7) Refresh the page with the changed &range and download the resulting file. It will be either video or audio.
In order not to check all links in a row in order to determine whether it is a video file or an audio file, the format is specified in the content-type on the right in the headers section.
Well, then you glue it through ffmpeg or whatever you like video + audio.
Maybe someone will find it useful.
And so, use yt-dlp)
PS I'm not a programmer.
Answer the question
In order to leave comments, you need to log in
I will quote from the instructions in English. Checked, this method works.
To reach the direct video and audio links: (using Chrome)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question