Skip to content

Commit

Permalink
glype-1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentclee committed Jul 13, 2019
1 parent 4919dc1 commit 9b12716
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# INSTALLATION INSTRUCTIONS
# ------------------------------------------------------------------------------

1. Upload the contents of the /glype-1.4.5/ folder to the desired directory on your server.
1. Upload the contents of the /glype-1.4.6/ folder to the desired directory on your server.
2. Visit the URL of your Glype Admin Control Panel (i.e. http://www.domain.com/admin.php).
3. Set the desired options and save your settings.
2 changes: 1 addition & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
define('ADMIN_URI', $_SERVER['PHP_SELF']);

# Define the current admin version
define('ADMIN_VERSION', '1.4.5');
define('ADMIN_VERSION', '1.4.6');

# Start buffering
ob_start();
Expand Down
2 changes: 1 addition & 1 deletion cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
$line = rtrim($line);

// Split by tab
$details = explode(' ', $line);
$details = explode("\t", $line);

// Check valid split, expecting 7 items
if ( count($details) != 7 ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
******************************************************************/

# Current version - no need to change this!
$themeReplace['version'] = 'v1.4.5';
$themeReplace['version'] = 'v1.4.6';

# Look for a config.php in the /themes/themeName/ folder
if ( ! defined('MULTIGLYPE') && file_exists($tmp = GLYPE_ROOT . '/themes/' . $CONFIG['theme'] . '/config.php') ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function deleteAllCookies($array, $prefix='') {
}

# Split by tab
$details = explode(' ', $line);
$details = explode("\t", $line);

# Check valid split, expecting 7 items
if ( count($details) != 7 ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@

# Settings file version for determining compatability with admin
# tool.
$CONFIG['version'] = '1.4.5';
$CONFIG['version'] = '1.4.6';

//---PRESERVE ME---
// Anything below this line will be preserved when the admin control panel rewrites
Expand Down
27 changes: 14 additions & 13 deletions plugins/youtube.com.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function preParse($input, $type) {
switch($type) {
case 'html':
if (preg_match('#url_encoded_fmt_stream_map["\']:\s*["\']([^"\'\s]*)#', $input, $stream_map)) {
define('stream_map', $stream_map[1]);
preg_match("/^([a-z0-9_]*=)/i", $stream_map[1], $yt_sep);
$urls = preg_split('/'.$yt_sep[1].'/', $stream_map[1]);
if (!high_quality) {$urls = array_reverse($urls);}
Expand All @@ -30,18 +29,10 @@ function preParse($input, $type) {
$url = str_replace('\u0026', '&', $url);

if (strpos($url,'video/x-flv')===false) {continue;}

$url = preg_replace('#;.*$#', '', $url);
$url = preg_replace('#,.*$#', '', $url);

if ($yt_sep[1]=='sig=') {
preg_match("/^([^&]*)/", $url, $yt_sig);
$url.='&signature='.$yt_sig[1];
} else {
preg_match("/sig=([^&]*)/", $url, $yt_sig);
$url.='&signature='.$yt_sig[1];
}

if ($yt_sep[1]=='itag=') {
preg_match("/^([^&]*)/", $url, $yt_itag);
$url = preg_replace('#itag=[^&]*&#', '', $url);
Expand All @@ -53,7 +44,15 @@ function preParse($input, $type) {
$url.='&itag='.$yt_itag[1];
}

# $url = preg_replace('#&fallback_host=[^&]*#', '', $url);
if ($yt_sep[1]=='sig=') {
preg_match("/^([^&]*)/", $url, $yt_sig);
$url.='&signature='.$yt_sig[1];
} elseif (preg_match("/sig=([^&]*)/", $url, $yt_sig)) {
$url.='&signature='.$yt_sig[1];
} elseif (preg_match("/\bs=([^&]*)/", $url, $yt_sig)) {
continue;
}

$url = preg_replace('#^.*url=#', '', $url);

define('videourl', $url);
Expand Down Expand Up @@ -84,7 +83,6 @@ function preParse($input, $type) {
function postParse($input, $type) {
switch($type) {
case 'html':
if(!defined('videourl')) {return $input;}

# Create URL to JW Player
$player_url = GLYPE_URL . '/player.swf';
Expand All @@ -94,8 +92,11 @@ function postParse($input, $type) {
# 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>.*?</div>#s', '<div id="player"><div id="player-api" class="player-width player-height">' . $html .'</div></div>', $input, 1);
$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);
Expand Down

0 comments on commit 9b12716

Please sign in to comment.