Plugins Plugins can make site-specific changes to the proxy's behavior and parsing mechanisms. You can use plugins to overcome limitations of the base proxy script.


Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2010, 08:07 PM   #11 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 1
benevans9 is on a distinguished road
Default how do i setup jw player to work on my proxy?

Hi there , im having trouble getting youtube to work on my proxy and i heard that if i set jwplayer up i can play youtube videos ? is this true ?
if so how can i do this ?

or is there a alternative way to do this ?

Thank You
benevans9 is offline
Country: New Zealand
 
Reply With Quote
Old 06-26-2010, 05:34 AM   #12 (permalink)
Moderator
 
04blatca's Avatar
 
Join Date: May 2010
Location: United Kingdom
Posts: 214
04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold
Send a message via MSN to 04blatca Send a message via Skype™ to 04blatca
Default

^ Please read above. ^

Originally Posted by benevans9 View Post
Hi there , im having trouble getting youtube to work on my proxy and i heard that if i set jwplayer up i can play youtube videos ? is this true ?
if so how can i do this ?

or is there a alternative way to do this ?

Thank You
04blatca is offline
Country: United Kingdom
 
Reply With Quote
Old 07-05-2010, 12:15 PM   #13 (permalink)
Junior Member
 
Join Date: Jul 2010
Posts: 1
gorkem is on a distinguished road
Default

You made a beatiful script. thanks about that...
But how much time we need to wait about this?
i think it doesn't take so much time to create a solution for youtube...
Many people are using that and we are still waiting for...
gorkem is offline
Country: Turkey
 
Reply With Quote
Old 07-12-2010, 05:28 AM   #14 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 14
jsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the rough
Default

Why bother putting youtube plugin in main release? Very high bandwidth usage for little gain. at least make sure people know its been included by default.

Also how do you deal with the regular updates needed for youtube compatiblity? New release of glype every time plugin needs update? or glype comes with outdated plugin and user must update youtube plugin separately? sounds like big waste of time.

Glype community made youtube plugin work for last few years. why change the system now? some peopple might want youtube but EVERYONE wants main script updated and maintaned. Very frustrating to see all superficial changes but ZERO progress.

please please please please focus on main script!!

/rant
jsmith is offline
Country: United Kingdom
 
Reply With Quote
Old 07-12-2010, 06:58 AM   #15 (permalink)
Moderator
 
04blatca's Avatar
 
Join Date: May 2010
Location: United Kingdom
Posts: 214
04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold04blatca is a splendid one to behold
Send a message via MSN to 04blatca Send a message via Skype™ to 04blatca
Default

Originally Posted by jsmith View Post
Why bother putting youtube plugin in main release? Very high bandwidth usage for little gain. at least make sure people know its been included by default.

Also how do you deal with the regular updates needed for youtube compatiblity? New release of glype every time plugin needs update? or glype comes with outdated plugin and user must update youtube plugin separately? sounds like big waste of time.

Glype community made youtube plugin work for last few years. why change the system now? some peopple might want youtube but EVERYONE wants main script updated and maintaned. Very frustrating to see all superficial changes but ZERO progress.

please please please please focus on main script!!

/rant
I agree with you that the youtube plugin uses a huge amount of resources compared to the gain from it. However, the youtube plugin is very popular in the proxy community as it is a unique feature to have on a proxy.

I assure you that the main focus for glype is on the script, not on the youtube plugin, which is already availiable.
04blatca is offline
Country: United Kingdom
 
Reply With Quote
Old 07-12-2010, 06:59 AM   #16 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 14
jsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the rough
Default YouTube.com

Save as /plugins/youtube.com.php

You also need to download FlowPlayer and make sure the config value in the plugin matches the location of the player.

I tried to upload a .zip of everything needed for easy installation but theres a retarded filesize limit of 97.5 KB on attachments.

Code:
<?php
/*****************************************************************
* Plugin: YouTube
* Description: Replaces YouTube player with FlowPlayer which loads
*              videos through the proxy.
* Author: jsmith
******************************************************************/

// CONFIG 
$_YTconfig['timeout']    = 600;                                   // Max time to spend downloading video (seconds)
$_YTconfig['player_url'] = GLYPE_URL . '/plugins/flowplayer.swf'; // URL to flash player
$_YTconfig['remove_js']  = false;                                 // Remove original scripts from YouTube?
$_YTconfig['no_queue']   = true;                                  // Allows other transfers while video downloads
// END OF CONFIG


// Pass config to Glype
$toSet[CURLOPT_TIMEOUT]     = $_YTconfig['timeout'];
$options['stripJS']         = $_YTconfig['remove_js'];
$CONFIG['queue_transfers'] = !$_YTconfig['no_queue'];


// Pre-parsing applied BEFORE main proxy parser
function preParse($input, $type)
{
    if ($type == 'html') {
    
        // Look for video URL
        if (preg_match('#"fmt_url_map":\s*"([^"]+)"#', $input, $urlMap)) {
            
            // Extract URLs - guess these are quality indicators and corresponding URLs? Not sure though.
            $urls = explode(',', $urlMap[1]);
            
            foreach ($urls as $url) {
            
                // Split by quality|url
                $bits = explode('|', $url);
                
                // Ignore if failed to find both parts
                if (!isset($bits[1])) {
                    continue;
                }
                
                // Save values
                $quality[$bits[0]] = $bits[1];
            
            }

            // Pick lowest quality and use that
            if (isset($quality)) {
                ksort($quality);
                define('VIDEO_URL', rawurldecode(current($quality)));
            }

        }
        
    }
    
    return $input;
}


// Post-parsing applied AFTER main proxy parser.
function postParse($input, $type)
{
    // Should we replace the video player? If HTML page and we have a video URL, yes.
    if ($type == 'html' && defined('VIDEO_URL')) {
        
        // Fetch config
        global $_YTconfig;
        
        // Prepare proxyed URL
        $flvUrl = rawurlencode(proxifyURL(VIDEO_URL));
        
        // Create HTML for own player
        $playerHtml = <<<HTML
<object id="player" width="620" height="380" data="{$_YTconfig['player_url']}" 
    type="application/x-shockwave-flash">
    
    <param name="movie" value="{$_YTconfig['player_url']}" /> 
    <param name="allowfullscreen" value="true" />
    
    <param name="flashvars" 
        value='id=player&config={"clip":"{$flvUrl}"}' />
</object>
HTML;
        $playerHtml .= '<a href="' . proxifyURL(VIDEO_URL) . '">Video</a>';
        
        // Replace YouTube player with our own player
        $input = preg_replace('#<div id="watch-player".*?</div>#s', "<div>$playerHtml</div>", $input, 1);

    }

    return $input;
}
jsmith is offline
Country: United Kingdom
 
Reply With Quote
Old 07-12-2010, 07:31 AM   #17 (permalink)
Moderator
 
Join Date: Jan 2009
Posts: 42
N!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of light
Default

If you or anyone else has made a YouTube plugin then feel free to post it here.

At a guess I'd say YouTube wouldn't be enabled by default on the next release, but I don't know.
N!ck is online now
Country: United Kingdom
 
Reply With Quote
Old 07-12-2010, 02:15 PM   #18 (permalink)
Moderator
 
Join Date: Jan 2009
Posts: 42
N!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of lightN!ck is a glorious beacon of light
Default

Thanks for this jsmith.

I'm currently using forcemdt's horrific one but at least it works. I'll give this one a go tomorrow.
N!ck is online now
Country: United Kingdom
 
Reply With Quote
Old 07-14-2010, 04:17 AM   #19 (permalink)
Senior Member
 
Join Date: Oct 2007
Posts: 162
steven will become famous soon enoughsteven will become famous soon enough
Send a message via AIM to steven Send a message via MSN to steven Send a message via Yahoo to steven
Default

to anyone wanting to code a plugin..


find url parts

/&video_id\=([-a-zA-Z0-9_]{11})&/
/&t\=([-a-zA-Z0-9_]{43})%3D&/

add parts to this

'http://www.youtube.com/get_video?video_id='..'&t='..'='

replace this with your player code

'/'.preg_quote('<div id="watch-player" class="flash-player">','/').'.+'.preg_quote('<!-- end videoextra section -->','/').'/s'
steven is offline
Country: United States
 
Reply With Quote
Old 07-15-2010, 04:53 AM   #20 (permalink)
Junior Member
 
Join Date: Jun 2010
Posts: 14
jsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the roughjsmith is a jewel in the rough
Default

Both. ZIP with everything needed is attached. just extract all files to /plugins/ folder.
Attached Files:
File Type: zip youtube.com.zip (149.1 KB, 81 views)
jsmith is offline
Country: United Kingdom
 
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Refbacks are On



All times are GMT -5. The time now is 08:16 PM.
© 2006-2010 Glype. All Rights Reserved.