How can I get direct youtube video URL? I tried to do this with Chrome Network monitor. I used this video as example: https://www.youtube.com/watch?v=dQw4w9WgXcQ enter image description here With this way i got this URL(It will expire tomorrow):


But the problem is that I can get only with built-in network monitor. I want to know how to do this programmatically? So how services and programs like youtube-dl obtain direct video and audio URL/URI? Can I get video URL with audio and video without using ffmpeg to mux it?

  • 2
    The team behind youtube-dl spends a lot of time reverse engineering Youtube and other sites and figuring that out. You won't get a better answer than by looking at the Python code yourself and trying to understand it.
    – LawrenceC
    Aug 5, 2019 at 16:20

1 Answer 1


The URL you got is a temporary one that only has meaning on your computer. The is no such website as https://r2---sn-bpb5oxu-vqne.googlevideo.com/.

On the other hand, youtube-dl is no longer enough for YouTube videos. YouTube has moved away from direct video play into the streaming of segments. Some videos still use the old system, but many videos are now becoming more of a playlist than one video file.

Usually, the image YouTube shows on the video when you move the cursor over the timeline is that of the segment, as you can see when it doesn't change for a minuscule movement of the cursor.

I already answered a similar question on the post
Trying to download a youtube video, but getting a weird incomprehensible http error, even via tools.

The only solution I found was to use a more recent video downloader than youtube-dl, and the one I recommended was y2mate.com.

  • y2mate is worse than youtube-dl. y2mate.com cannot download this video - youtube.com/watch?v=KHut4-LtmnM but youtube-dl can. Aug 5, 2019 at 16:46
  • It think that the conclusion is that YouTube has a long history and various methods of encoding. I do know that when uploading a new video, its conversion is assigned to some internal YouTube video server, but not all such servers run the same software. You might need to use a number of such utilities and website downloaders, because there doesn't seem to be one that works for all cases.
    – harrymc
    Aug 5, 2019 at 16:51
  • for me, youtube-dl works for all) Aug 5, 2019 at 16:53
  • 1
    Lucky you, but luck doesn't last forever. To be serious: A direct YouTube URL is no longer possible, except perhaps for videos uploaded years ago.
    – harrymc
    Aug 5, 2019 at 16:56
  • hey guys, maybe there's a github-issue opened already in youtube-dl repo about these playlist-based videos? Feb 16, 2020 at 8:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.