jiffyspop Posted January 11, 2009 Share Posted January 11, 2009 Ok well what I am trying to do is make a you tube grabber that grabs video from you tube. This is my code <?php $OUTPUT = rand(1000,9999); $BASEURL = "http://youtube.com/get_video.php?="; $url = $_POST['url']; $wget = "/usr/bin/wget"; $tmp = "$OUTPUT.tmp"; $tmp2 = "$OUTPUT"; $txt = "$OUTPUT.txt"; $flv = "$OUTPUT.flv"; $BASEURL = "http://youtube.com/get_video.php?"; $get_base = "$wget $url -O $tmp > /dev/null 2>&1"; $get_info = "grep watch_fullscreen $tmp > $txt"; $videourl = `sed "s;.*\(video_id.\+\)&title.*;\1;" $txt`; $fullurl = "$BASEURL $videourl"; $get_flv = "$wget $fullurl -O $flv > /dev/null 2>&1"; if(isset($_POST['Submit']) && $_POST['Submit'] == "Get It") { // Do your popen on the perl script here, along with anything else } else { //Put your form code here, along with a Submit button with a "value" of "Get It" exec( "$get_base" ); exec( "$get_info" ); exec( "$get_flv" ); echo done; } ?> <html> <body> <form name="form1" method="post" action=""> <div class="aa"><div class="la">Video IRL</div><div class="ra"><INPUT name="url" type="text" id="url"></div></div> <div class="aa"><div class="la"> </div><div class="ra"><input type="submit" name="Submit" value="Submit"></div></div> <div class="aa"></div> </form> </body> </htm> well I can make it grep the watch full screen but i cant get it to read and strip it so i can do a wget any ideas would be awsom Quote Link to comment https://forums.phpfreaks.com/topic/140374-you-tube-grabber-php-client-side/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.