Created
September 2, 2008 20:15
-
-
Save ayman/8455 to your computer and use it in GitHub Desktop.
Gets a YouTube FLV Url from the source of a page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming 'response' is the source of a You Tube video page, this will get the flv url | |
var vid = id.substring(3); | |
var r = response; | |
var doc = r.substring(r.indexOf(".swf?video_id=")); | |
var tpoint = r.indexOf("&t="); | |
var doc = r.substring(tpoint, r.indexOf("\"", tpoint)); | |
var url = "http://youtube.com/get_video.php?video_id="; | |
url += vid + doc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment