Firstly, I want to tell you that coding is working fine.
Mirror server
This is because Google uses a mirrored server with the googlevideo.com domain name during download, download, and streaming.
You get access to the video image in streaming mode. You will get only this mirror link. Youtube videos located inside this mirror server.
Same as Vimeo using akamaized.net mirror server
Refer to SO POST for details.
Decoding Link to a video with a mirror URL
Thus, in this state, we need to have a unique YouTube video identifier and can be accessed by adding the url https://www.youtube.com/watch?v=id_here
To decode a unique identifier from this mirror, url is not possible, since the SO response
They added this mirror server concept to provide some security.
In accordance with section 5B of the T & C .. section here - http://www.youtube.com/static?template=terms
Downloading YouTube content does not meet the requirements of the YouTube Tears service.
There are some private APIs such as PSYouTubeExtractor .
I think you need to have the url of the video to download.
Saranjith
source share