Esempio n. 1
0
function postParse($input, $type)
{
    switch ($type) {
        case 'html':
            # Create URL to JW Player
            $player_url = GLYPE_URL . '/player.swf';
            # Generate URL to flv file through proxy script
            $flvUrl = rawurlencode(proxyURL(sprintf('%s', videourl)));
            # Generate HTML for the flash object with our new FLV URL
            $html = "<embed src=\"{$player_url}\" width=\"640\" height=\"360\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=640&height=360&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
            if (!defined('videourl')) {
                $html = '<div style="color:#333;font-size:24px">This video cannot be displayed.</div>';
            }
            # Add our own player into the player div
            $input = preg_replace('#<div id="player".*?<div id="watch7-main-container">#s', '<div id="player"><div id="player-api" class="player-width player-height off-screen-target" style="overflow: hidden;">' . $html . '</div></div><div id="watch7-main-container">', $input, 1);
            $input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
            $input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl157150.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl127661.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_as3-vfl128003.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl127661.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl142129.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl142129.swf#s', '' . $player_url . '', $input, 1);
            break;
    }
    return $input;
}
Esempio n. 2
0
function postParse($input, $type)
{
    switch ($type) {
        case 'html':
            if (!defined('video_url')) {
                return $input;
            }
            # Create URL to JW Player
            $player_url = GLYPE_URL . '/player.swf';
            # Generate URL to flv file through proxy script
            $flvUrl = rawurlencode(proxyURL(sprintf('%s', video_url)));
            # Generate HTML for the flash object with our new FLV URL
            $html = "<embed src=\"{$player_url}\" width=\"640\" height=\"360\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=640&height=360&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
            # Add our own player into the player div
            $input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container">', $input, 1);
            $input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container">', $input, 1);
            $input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container"><div id="watch-video" class=" "><script>if \\(window.yt.timing\\) \\{yt.timing.tick\\(\'bf\', \'\'\\)\\;\\}</script><div id="watch-player" class="flash-player">' . $html . '</div></div></div><div id="watch-main"></div>', $input, 1);
            $input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
            $input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl157150.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl127661.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_as3-vfl128003.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl127661.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl142129.swf#s', '' . $player_url . '', $input, 1);
            $input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl142129.swf#s', '' . $player_url . '', $input, 1);
            break;
    }
    return $input;
}
Esempio n. 3
0
function preParse($html, $type)
{
    if (stripos($html, 'loadingError')) {
        header("Location: " . proxyURL('http://mail.google.com/mail/?ui=html'));
        exit;
    }
    return $html;
}
Esempio n. 4
0
function preParse($html, $type)
{
    if (stripos($html, 'JavaScript required to sign in')) {
        header("Location: " . proxyURL('https://mid.live.com/si/login.aspx'));
        exit;
    }
    return $html;
}
Esempio n. 5
0
function postParse($input, $type)
{
    switch ($type) {
        case 'html':
            if (defined('videourl')) {
                # Create URL to JW Player
                $player_url = GLYPE_URL . '/player.swf';
                # Generate URL to flv file through proxy script
                $flvUrl = rawurlencode(proxyURL(sprintf('%s', videourl)));
                # Generate HTML for the flash object with our new FLV URL
                $html = "<embed src=\"{$player_url}\" width=\"1280\" height=\"720\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=1280&height=720&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
                # Replace video player
                $input = preg_replace('#<div id="player-api"([^>]*)>.*<div class="clear"#s', '<div id="player-api"$1>' . $html . '</div></div><div class="clear"', $input, 1);
            }
            break;
    }
    return $input;
}
Esempio n. 6
0
/*****************************************************************
* Execute the request
******************************************************************/
# Initiate cURL wrapper request object with our cURL options
$fetch = new Request($toSet);
# And make the request
$document = $fetch->go($URL);
/*****************************************************************
* Handle aborted transfers
******************************************************************/
if ($fetch->abort) {
    switch ($fetch->abort) {
        # Do a redirection
        case 'redirect':
            # Proxy the location
            $location = proxyURL($fetch->headers['location'], $flag);
            # Do not redirect in debug mode
            if (DEBUG_MODE) {
                $fetch->redirected = '<a href="' . $location . '">' . $fetch->headers['location'] . '</a>';
                break;
            }
            # Go there
            header('Location: ' . $location, true, $fetch->status);
            exit;
            # Send back a 304 Not modified and stop running the script
        # Send back a 304 Not modified and stop running the script
        case 'not_modified':
            header("HTTP/1.1 304 Not Modified", true, 304);
            exit;
            # 401 Authentication (HTTP authentication hooks not available in all PHP versions
            # so we have to use our method)
Esempio n. 7
0
         }
         # Current bit
         $bit = pow(2, $i);
         # Set bitfield
         if (!empty($_POST[$name])) {
             setBit($bitfield, $bit);
         }
         # Increase index
         ++$i;
     }
     # Save new bitfield in session
     $_SESSION['bitfield'] = $bitfield;
     # Save valid entry
     $_SESSION['no_hotlink'] = true;
     # Redirect to target
     redirect(proxyURL($url, 'norefer'));
     break;
     /*************************************************************
      * Agree to our SSL warning.
      **************************************************************/
 /*************************************************************
  * Agree to our SSL warning.
  **************************************************************/
 case 'sslagree':
     # Flag our SSL warnedness
     $_SESSION['ssl_warned'] = true;
     # Return to previous page
     $redirectTo = isset($_SESSION['return']) ? $_SESSION['return'] : 'index.php';
     # Clear session return value
     unset($_SESSION['return']);
     # Redirect
Esempio n. 8
0
function css_src($input)
{
    return 'src=' . $input[1] . proxyURL($input[2]) . $input[1];
}
Esempio n. 9
0
function proxifyURL($url, $givenFlag = false)
{
    return proxyURL($url, $givenFlag);
}
Esempio n. 10
0
<?
/*******************************************************************
* Glype is copyright and trademark 2007-2016 UpsideOut, Inc. d/b/a Glype
* and/or its licensors, successors and assigners. All rights reserved.
*
* Use of Glype is subject to the terms of the Software License Agreement.
* http://www.glype.com/license.php
******************************************************************/

define('mobilemail',proxyURL('http://m.yahoo.com/mail'));
if(stripos($toLoad,'mail.yahoo.com')){header('Location: '.mobilemail);exit;}
function preParse($html,$type){
	if($type=='html') {
		$html = preg_replace('#r/(m6|lk|l6|m7|m2|l4)#', mobilemail, $html);
	}
	return $html;
}