NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Youtube Video Download Code: Now Working & Source Posted

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search


Reply
 
LinkBack Thread Tools
Old 03-26-2009, 05:15 AM THREAD STARTER               #1 (permalink)
Account Closed
 
thestudent's Avatar
Join Date: Aug 2005
Location: Canada
Posts: 491
thestudent is just really nicethestudent is just really nicethestudent is just really nicethestudent is just really nice
 



Youtube Video Download Code: Now Working & Source Posted


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 Code:
<?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>
thestudent is offline   Reply With Quote
Old 06-04-2009, 12:25 AM   #2 (permalink)
Account Closed
Join Date: Dec 2008
Location: Boston, Ma
Posts: 650
CrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to all
 



Marrow Donor Program Animal Rescue Autism Autism
Why this?

if($_POST["youtubeurl"]!=""){

instead of..

if(empty($_POST["youtubeurl"])){

Also, you use double quotes too much, other than that, nice work.
CrackFeed.Com is offline   Reply With Quote
Old 10-01-2009, 07:46 AM   #3 (permalink)
Ik
Quality //
Join Date: Sep 2008
Posts: 911
Ik has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud ofIk has much to be proud of
 


Breast Cancer Save a Life Alzheimer's Wildlife Wildlife
Great. Thank you
Ik is offline   Reply With Quote
Old 07-28-2010, 07:22 PM   #4 (permalink)
NamePros Member
Join Date: Mar 2010
Posts: 43
FostinWD is an unknown quantity at this point
 



is this still working? I'd like to download a youtube video for so long! thanks
FostinWD is offline   Reply With Quote
Old 07-29-2010, 08:42 AM   #5 (permalink)
Freelance Web Designer
 
Janine's Avatar
Join Date: May 2006
Location: Philippines
Posts: 3,019
Janine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond reputeJanine has a reputation beyond repute
 



Cystic Fibrosis Save a Life
Originally Posted by FostinWD View Post
is this still working? I'd like to download a youtube video for so long! thanks
I don't think this method still works; Youtube updated their site now and It's hard to find a website that can really convert the yt videos to flv's.
????: NamePros.com http://www.namepros.com/code/570133-youtube-video-download-code-now-working.html

Janine is offline   Reply With Quote
Old 08-28-2010, 12:48 AM   #6 (permalink)
New Member
Join Date: Aug 2010
Location: US
Posts: 10
iamscottj is an unknown quantity at this point
 



First of all its illegal to download the videos as they have copyright by the owners of the video. Secondly YouTube from time to time update the algorithm. You can never actually help but you may have to update it as it happens. Most of the time its very difficult to track it.
iamscottj is offline   Reply With Quote
Old 09-24-2010, 05:37 AM   #7 (permalink)
New Member
Join Date: Sep 2010
Posts: 10
iamjohnbrown is an unknown quantity at this point
 



The algorithm is changed as stated by iamscottj...

And its really not necessary if you own IDM
iamjohnbrown is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 06:48 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger