Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default Youtube grabber help

    Would anyone be able to shed some light on this?
    I'm attempting to download video mp4 files from youtube using cURL. I've got the script working so I can download a file from anywhere else, but youtube is just not having it. I've tried setting the user agent and all that malark. Obviously i've got the direct link to the file e.g.
    Code:
    http://www.youtube.com/get_video?video_id=Il1bM6_PWWw&t=vjVQa1PpcFOA2bTs0_IKl-lbhDlaMgcO-B-Ud4KFb2w=&fmt=22
    Going to that link on my computer allows me to download the video fine, so my guess is that youtube are blocking server downloads somehow..
    Here's the cURL snippet.
    PHP Code:
    ini_set('user_agent''Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
    $newfile 'video.mp4';
    $file 'http://www.youtube.com/get_video?video_id=Il1bM6_PWWw&t=vjVQa1PpcFOA2bTs0_IKl-lbhDlaMgcO-B-Ud4KFb2w=&fmt=22';
    $fp fopen (dirname(__FILE__) . '/filedownload/'.$newfile'w+');//This is the file where we save the information
    $ch curl_init($file);//Here is the file we are downloading
    curl_setopt($chCURLOPT_TIMEOUT50);
    curl_setopt($chCURLOPT_FILE$fp);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
    curl_exec($ch);
    curl_close($ch);
    fclose($fp); 
    Thanks for any help.
    MODs, if this against any rules, remove it. Not really sure tbh.
    Last edited by Joe!; 15-07-2010 at 06:33 PM.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  2. #2
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    That direct link doesn't work for me, but instead of using curl have you tried using a socket to get the data?

  3. #3
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    Strangely, that link no longer works for me. I'm not sure if the signature part of the URL expires or is unique to an IP address. That would explain the problem i'm getting on the server I guess, I'll try it on localhost to see
    http://www.youtube.com/get_video?vid...kI2p0c=&fmt=34
    Could you let me know if that works for you, as it works for me now.
    How would I go about using a socket? Don't recall using one before

    edit: using localhost works, so i'll just have to generate the direct link on the server for it to work. Hopefully
    Last edited by Joe!; 15-07-2010 at 07:17 PM.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  4. #4
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    those are only for your session on yt maybe ur ip Wont work for anyone else

    Take a look at another download script

    Lew.
    Im not here to be loved, I love to be hated :-}


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •