This url returns a huge html page which is for watching the video.
http://www.youtube.com/watch?v=some_id
I can't go through all the HTML tags and get the right url to the actual video. I believe there is a url from where the actual video stream is coming. I expect it to be something like,
http://www.youtube.com/get_the_video?id=some_id
Or,
http://www.youtube.com/get_the_video/some_id.mp4
I can't find any information about the correct url for the video.
Is this how YouTube maintain it's video link or their is something else?
Do they always change the url?
I want to do something like this in HTML to play the video.
<video width="320" height="240" controls autoplay>
<source src="http://www.youtube.com/get_the_video?id=some_id" type="video/mp4">
</video>
(I am new to how YouTube works. Need some guidance)
You can use youtube-dl to download or get the stream url from YouTube.
to download a video,
youtube-dl http://www.youtube.com/watch?v=some_id
or
youtube-dl some_id
to get the stream url, do
youtube-dl -g http://www.youtube.com/watch?v=some_id
Basically the url is parsed from the html source code of the original page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With