35 Comments to “Download Youtube Videos using PHP Code”

  1. Michael Kamleitner

    May 29th, 2008

    thx for using phptube! a link back to my original work would be appreciated, thx!

    http://nonsmokingarea.com/blog/2007/06/16/phptube-youtube-api-for-video-upload-download/

  2. mohan

    Jun 4th, 2008

    Nice Info ! I am looking for it! thanks For the download !!

    Regards.,
    http://itbuddy.blogspot.com

  3. Kumar

    Jun 4th, 2008

    Wow nice Techie Blog ! See my techie blog http://itbuddy.blogspot.com if you are interested ! Nice Site !

  4. Jime

    Jun 11th, 2008

    I have tested the code, but i find it can not work?

    Fatal error: Cannot instantiate non-existent class: http_request in XXXX/test/phptube.php on line 59

  5. Mustafa Jalil

    Jun 22nd, 2008

    I got the same error! any solution ?

    Thanks and Regards,
    MJ

  6. Sajith M.R

    Jun 22nd, 2008

    Download again, and Try. The Error is Corrected :)

  7. Jime

    Jun 22nd, 2008

    I have tested the code again, but i find it still not work?
    Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in XXXXXX/test/Request.php on line 49

  8. lalit

    Jun 30th, 2008

    I have tested the code and get the following error, any solution?
    Fatal error: Call to undefined function: file_put_contents() in /XXXXX/youtube-download-php/functions.php on line 19

  9. ni

    Jul 5th, 2008

    I tested the code with neither getting an error nor an usefull download link

    that was an result
    http://www.youtube.com/get_video?video_id=krBXrzk7s-E&t=OEgsToPDskIkst6hx14l1qjVyUt5EIkL./flvs/krBXrzk7s-E.flv

  10. Zak

    Jul 9th, 2008

    Jime,

    You will get that error if you try to use php4. You must use php5.

    Zak

  11. Christian

    Aug 26th, 2008

    thanks very helpful, i was just about to pull my hair off

  12. toby

    Aug 26th, 2008

    let me try this script.. thanks and more power to you..

  13. Sayli

    Oct 6th, 2008

    This code really helped me to download youtube videos. Thanks a lot.

  14. aditya nair

    Oct 13th, 2008

    Hi Sajith ;

    I downloaded the Code and hosted it online.
    But I get the following Errors.

    http://www.youtube.com/get_video?video_id=4ahyHfNqquQ&t=OEgsToPDskKM-mv5HqJ4v5wxk8gyY4sA
    PHP Error Message

    Warning: set_time_limit() has been disabled for security reasons in /home/a3272311/public_html/youtubedownloaderphp/functions.php on line 13

    Free Web Hosting

    PHP Error Message

    Warning: file_put_contents(./flvs/4ahyHfNqquQ.flv) [function.file-put-contents]: failed to open stream: No such file or directory in /home/a3272311/public_html/youtubedownloaderphp/functions.php on line 19

    Free Web Hosting
    ./flvs/4ahyHfNqquQ.flv

  15. Sajith M.R

    Oct 13th, 2008

    To solve : set_time_limit() >> Got to your php.ini file and make the safe mode off. SAFE_MODE = Off

    Make the root dir full permission 777

    Thats all..

  16. Navjot Singh

    Nov 7th, 2008

    Now I want to use your plugin to achieve the following:

    I have a blog which shows videos from youtube. Now I want to autogenerate download links for each video beneath the post. This is what I did:

    1. Uploaded the folder in blog’s root directory.
    2. Opened header.php of theme file and put:
    3. Opened single.php and did the following:
    $url = get_post_meta($post->ID, ‘url’, true);
    $pattern = getPatternFromUrl($url);

    and for generating the download link did:

    <a href=”" target=”_blank”>Download Video

    Now where am I wrong since it says undefined function: getPatternFromUrl

    AM I including the wrong file?

    Can you help me out?

  17. Navjot Singh

    Nov 7th, 2008

    No problem…found another script…also code was messed up in my last comment.

  18. srinivasan

    Dec 13th, 2008

    Hi , for this same functionality does any one have samples in Java?? Quick help req!!

  19. domowy budżet

    Jan 7th, 2009

    Thanks for the code. I will use it on my site :)

  20. Ekla

    Jan 8th, 2009

    Just Now I have downloaded the zip and testing now. First time I was getting some error and warning. But, now I have downloaded 1 flv successfully.

    I tried with the url http://in.youtube.com/watch?v=EBM854BTGL0 .
    But in code default youtube path
    $url = “http://www.youtube.com/watch?v=”.$video_id;
    It works when I changed this to
    $url = “http://in.youtube.com/watch?v=”.$video_id;

    So, I think class “HTTP_Request” have no follow redirection facility. And I shall get same problem if the path become like us. or uk. etc….
    Using libCURL would be better ?
    Any Idea about my opinion?

  21. Youtube Downloader

    Jan 16th, 2009

    Download YouTube Videos as MP4 Files:

    Just access the website http://www.kucus.com and paste the Youtube RUL then click the “Submit” button to download.

  22. sintu

    Mar 2nd, 2009

    Hello,

    i want to add a option “Add video” in my project. i am currentally working on symfony frame work with php 5 and my sql data base. so my question is “is this code will work on my web project” if no then plz help me to dounload a video

  23. ghprod

    Mar 15th, 2009

    thnx for this script

    u r rock man :)

  24. Spidey

    Mar 22nd, 2009

    wweeeewww amazing……

  25. [...] reading here: PHP Code for Downloading Youtube Videos | Share and [...]

  26. munawer

    May 7th, 2009

    HI sajith,

    The youtube downloader you specified here http://www.googleneedle.com is not down loadable link now.Which returns a blank page instead of download.Same situation is happened to me now.i have hosted my code here
    http://munawer.1free.ws/youtube/.
    which is working in local machine perfectly.In server it returns the downloadable Url just as in ur site..

    Any idea!!

    Thanks

  27. Saravanan.K

    May 14th, 2009

    HI
    Urgent plz help me, thanks in advance

    This youtube download code will be perfectly work on in my local wamp server.But it does not work in my client server.

    I modified the GrabFlvFromYoutube( $pattern ) funaction as

    function GrabFlvFromYoutube( $pattern )
    {
    require_once (”phptube.php”);
    $tube = new PHPTube ();

    $flv_http_path = $tube->download($pattern) ;

    return $flv_http_path;
    }
    My server link is;

    http://64.94.137.212/eego/SDHK/WIDGET%20API/youtube_download/index.php?url=http://www.youtube.com/watch?v=o3kA7G3hZbg

    i need only the download url. i got it in my local, in server it doesn’t download the file. nothing dispaly if i put url in browser, thanks in advance

  28. Munawer

    Jun 1st, 2009

    YouTube Kills Our Video Download Tool
    see here.

    http://cli.110mb.com/k/

  29. Akshay

    Jul 29th, 2009

    You can check out the script for free php youtube downloader over here

    http://softloads.in/scripts/ultimate-youtube-grabber-script/

  30. pixy

    Sep 4th, 2009

    Thanks for the code! Here is a website where you can easily download YouTube videos in different formats.

  31. Neo Cambell

    Dec 16th, 2009

    Thank you very much for sharing this one.

  32. cigarette

    Jan 21st, 2010

    Exactly i want! Thank you!

  33. [...] Videofiles bietet die API nicht an. Da habe ich mir die paar Codezeilen von Michael Kamleitner und Sajith M.R zu Nutze [...]

  34. Rara

    Feb 8th, 2010

    thank you, i will use phpcodedownloading fla youtube

  35. ambitos

    Mar 5th, 2010

    Thank you man. I will use your php code for find youtube flv files. Thanks (c# – php :) )


Leave a Reply