Youtube video source

Apparently im too stupid to get the source URLs of youtube videos. All i can find on this, are either shit or just websites that convert a youtube-link to the source URL.

How the fuck do i get the video source URL?

Attached: brainlet.jpg (645x729, 44K)

Other urls found in this thread:

rg3.github.io/youtube-dl/
twitter.com/SFWRedditVideos

youtube-dl -g [-f format-code]

>>>/sqt/

Actual code, not just some library/service

How so?

>Actual code, not just some library/service
wat

are you from askubuntu? i feel im not dumb enough to answer your question

>rg3.github.io/youtube-dl/
this is what you think about?

What i think about is what server you need to send a request to, and what the server demands. Cant find any detail on that though

>what server
one of googles data centers obviously
>which one
use wireshark

>what server
>r2---sn-8xgn5uxa-i5he.googlevideo.com
>r2---sn-4g5e6nze.googlevideo.com

The prefix seems pretty random, there must be a more convenient server.

Also, it seems to pull from 2 servers

ask google

>post mentions, that i tried to google
>"just google it man"
Not very helpful, are you?

i didn't write that

>"ask google"
then explain, what this is supposed to be

There isn’t a single source URL. YouTube chops the source file in many different blocks and the player merges them seamlessly.

Why?
* You can switch servers in the middle of the video easily.
* You can download only the next few blocks instead of the entire file, saving bandwidth if you don’t watch the entire video.
* There’s also separate video streams and audio streams so you can bump to a higher audio quality without bumping to a higher video quality.
* CDN doesn’t have to cache the entire video, only the blocks people watch the most.
* And many others.

Look it up. It’s called DASH.

*ring-ring* - *ring-ring*
>hey google! it's a me, user, how you do your voodoo?

Thank you for nothing

i wonder if yt uses ffmpeg for it's encoding process

you're very welcome

They likely have fancy custom hardware-accelerated encoders but it’s very possible that ffmpeg is somewhere in the pipeline, probably a custom build.

Thank you, I´ll look it up

it's open source
you can go read through the github repo yourself and see how it does it

Doing that aswell, but the readability of python is horrendous