Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > Anti-Cheat Software & Programming > Web and Scripting > PHP

- Sponsored Advertisement -
http://www.myfpscheats.com/

Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
You are Unregistered, please register to gain Full access.    
Reply
 
Thread Tools

Download from youtube (NEW API, June/July 2010)
Old 07-03-2010, 10:46 AM   #1
My household appliance is on drugs. Horrible.

s0beit's Avatar

Join Date: Oct 2005
Location: ALWAYS WON NEVER DEFEAT
Posts: 812
Reputation: 70378
Rep Power: 796
s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 46,529, Level: 32
Points: 46,529, Level: 32 Points: 46,529, Level: 32 Points: 46,529, Level: 32
Activity: 2.2%
Activity: 2.2% Activity: 2.2% Activity: 2.2%
Last Achievements
Download from youtube (NEW API, June/July 2010)

Youtube changed their api so all examples using "get_video" are now broken.

here.

PHP Code:
<?php

    $watch_id 
$_GET'watch' ];
    
    function 
parse_swf_config$content )
    {
        
$ret = array();
        
        
$e1 explode','$content );
        
        foreach( 
$e1 as $e )
        {
            
$e2 explode'|'$e );
            
            
array_push$ret, array( 'fmt' => $e2[0], 'url' => $e2[1] ) );
        }
        
        
        return 
$ret;
    }

    function 
get_youtube_swf_info$id )
    {
        
$ch curl_init"http://www.youtube.com/watch?v=" $id );
        
        
curl_setopt$chCURLOPT_RETURNTRANSFER);
        
curl_setopt$chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" );
        
        
$d curl_exec$ch );
        
        
curl_close$ch );
        
        if( 
preg_match'#var swfConfig = \{(.*)\};#'$d$f ) )
        {
            return 
json_decode'{' $f[1] . '}'true );
        }
        
        return 
FALSE;
    }

    echo( 
"<div align=\"center\">" );

    
$new_data get_youtube_swf_info$watch_id );
    
    if( 
$new_data == FALSE )
    {
        die( 
"Unable to parse youtube swf parameters...<br />" );
    }
    
    
$par_conf parse_swf_config$new_data['args']['fmt_url_map'] );
    
    foreach( 
$par_conf as $video )
    {
        echo( 
"<a href=\"{$video['url']}\">Download \"{$new_data['args']['rv.2.title']}\" at fmt={$video['fmt']}</a><br />" );
    }
    
    echo( 
"</div>" );

?>
__________________
s0beit is offline

Reply With Quote


Old 07-04-2010, 12:50 AM   #2
My household appliance is on drugs. Horrible.

s0beit's Avatar

Threadstarter
Join Date: Oct 2005
Location: ALWAYS WON NEVER DEFEAT
Posts: 812
Reputation: 70378
Rep Power: 796
s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!s0beit has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 46,529, Level: 32
Points: 46,529, Level: 32 Points: 46,529, Level: 32 Points: 46,529, Level: 32
Activity: 2.2%
Activity: 2.2% Activity: 2.2% Activity: 2.2%
Last Achievements
by the way, i found out that the "$new_data['args']['rv.2.title']" is not reliable, since it is related videos and in fact not the actual video which i somehow did not catch in my test but the code to grab the FMT based links works 100%.

In my more complex version which you can see here, i now use this:

PHP Code:
        function GetTitle()
        {
            if( 
preg_match'#<meta name=\"title\" content=\"(.*)\">#'$this->cachedpage$f ) )
            {
                return 
$f[1];
            }
            
            return 
"Unable to parse title";
        } 
EDIT: Also for some reason the code works on my localhost but not very well on my box, i think this could be because im getting different session data from my box and im unable to load it with my ip. Working to fix this.

DOUBLE EDIT: It is indeed session based and whats "resolved" on one computer can not be used on another, i will need to tunnel the file or make a client-based application (like desktop app), either way, you will NEED to run this file on localhost until i post a more complex method.
__________________

Last edited by s0beit; 07-04-2010 at 12:59 AM.
s0beit is offline

Reply With Quote

Old 09-07-2010, 02:09 PM   #3
n00bie

Martz's Avatar

Join Date: Sep 2010
Posts: 1
Reputation: 10
Rep Power: 18
Martz has made posts that are generally average in quality
Nice
Martz is offline

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
2010, api, download, june or july, youtube
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 03:19 PM.