Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube video download URL

I wrote a program that gets youtube video URL and downloads it
Up today I did this:
1. get video "token" from "/get_video_info?video_id=ID" like:

http://www.youtube.com/get_video_info?video_id=jN0nWjvzeNc   

2. Download Video by requesting it from "/get_video?video_id=ID&t=TOKEN&fmt=FORMAT_ID" like:

http://www.youtube.com/get_video?video_id=jN0nWjvzeNc&t=vjVQa1PpcFMgAK0HB1VRbinpVOwm29eGugPh3fBi6Dg%3D&fmt=18   

But this doesn't work anymore!
What is the new download URL?

Thanks

like image 553
Ariyan Avatar asked Jul 22 '10 17:07

Ariyan


2 Answers

Actually I'm working on the similar project that downloading the video file from youtube. I find that the get_video might be blocked by Youtube. so instead of using get_video., I use the video info retrieved from get_video_info and extract it to get the video file url.

Within the get_video_info, there are url_encoded_fmt_stream_map. After encoding it, you can find url and signature value of every video with different format. So the file url is like [url value]+'&signature='+[sig value].

Additionally I find the following topic that using same method with mine. Hope it can help you.

Can't Download from youtube

If you are interested about how to downloading youtube video file, there is a small program written by me to demonstrate the process. You are free to use it.

https://github.com/johnny0614/YoutubeVideoDownload

like image 174
yujohnnyzhou Avatar answered Sep 23 '22 04:09

yujohnnyzhou


Add &asv=2 to the end of the URL.

like image 45
rossy Avatar answered Sep 20 '22 04:09

rossy