thestudent
Account Closed
- Impact
- 1
If anyone is interested, here is working code that takes a youtube url as input and redirects the user to download get_video file which is a flv.
PHP:
<?php if($_POST["youtubeurl"]!=""){ $pagecontent = file_get_contents($_POST["youtubeurl"]); preg_match("/v=([^(\&|$)]*)/", $_POST["youtubeurl"],$matches); $VideoID = $matches[1]; preg_match("/\"t\": \"([^(\\\"|$)]*)/", $pagecontent,$matches); $T_ID = $matches[1]; $VideoURL = "http://youtube.com/get_video?video_id=$VideoID&t=$T_ID"; header("Location: " . $VideoURL); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>YouTube Downloader</title> </head> <body> <form action="youtube.php" method="post"> <b>YouTube URL:</b> <input type="Text" name="youtubeurl" size="35" value="http://youtube.com/watch?v=aFgJwRUojKw"> <br> <input type="submit" value="Download Video"> </form> </body> </html>