athlon1600 / php-proxy-plugin-bundle Goto Github PK
View Code? Open in Web Editor NEWPHP-Proxy Plugins made for unblockvideos.com
Home Page: https://unblockvideos.com/
License: MIT License
PHP-Proxy Plugins made for unblockvideos.com
Home Page: https://unblockvideos.com/
License: MIT License
Hi there, I'm wondering how I would enable the new youtube look.
It looks like I could change something in YoutubePlugin.php:
// force old YouTube layout!
public function onBeforeRequest(ProxyEvent $event)
{
$event['request']->headers->set('Cookie', 'PREF=f6=8');
$event['request']->headers->set('User-Agent', 'Opera/7.50 (Windows XP; U)');
}
I have tried removing the Cookie line, and nothing changes, but when I remove/change the User-Agent line, I appear to get the new layout, but it will not fully load. Is there something I can change, or is this not fixable? Thanks in advance!
Hi, I'd really appreciate if someone could make a plugin for Chaturbate.
I fixed Youtube and Pornhub
Youtube now works in
Bug
<?php
namespace Proxy\Plugin;
use Proxy\Event\ProxyEvent;
use Proxy\Html;
use YouTube\YouTubeDownloader;
class YoutubePlugin extends AbstractPlugin
{
protected $url_pattern = 'youtube.com';
// force old YouTube layout!
public function onBeforeRequest(ProxyEvent $event)
{
//$event['request']->headers->set('Cookie', 'PREF=f6=8');
$event['request']->headers->set('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
$event['request']->headers->set('X-YouTube-Client-Name','1');
$event['request']->headers->set('X-YouTube-Client-Version','1.20200731.02.01');
}
public function onCompleted(ProxyEvent $event)
{
$response = $event['response'];
$url = $event['request']->getUrl();
$output = $response->getContent();
if(!preg_match('/pbj=1/',$url))
{
$redirect=$url.(!preg_match('/\?/',$url)?("?"):("&"))."pbj=1";
$response->headers->set('location', proxify_url($redirect, $url));
return;
}
// remove top banner that's full of ads
$output = Html::remove("#header", $output);
// do this on all youtube pages
$output = preg_replace('@masthead-positioner">@', 'masthead-positioner" style="position:static;">', $output, 1);
// data-thumb holds real image when it is available!
$output = preg_replace_callback('/<img[^>]+data-thumb="(.*?)"[^>]*/is', function ($matches) {
// may or may not have src= attribute
$has_src = strpos($matches[0], 'src="') !== false;
// proxified thumb url
$thumb_url = proxify_url($matches[1], false);
if ($has_src) {
// TODO: maybe remove data-thumb too?
$matches[0] = str_replace('data-thumb', 'remove-this', $matches[0]);
return preg_replace('/src="(.*?)"/i', 'src_replaced="1" src="' . $thumb_url . '"', $matches[0]);
}
return preg_replace('/data-thumb="(.*?)"/i', 'src_added="1" src="' . $thumb_url . '"', $matches[0]);
}, $output);
$youtube = new YouTubeDownloader();
// cannot pass HTML directly because all the links in it are already "proxified"...
$links = $youtube->getDownloadLinks($url, "mp4 360, mp4");
if ($links) {
$url = current($links)['url'];
$player = vid_player($url, 640, 390, 'mp4');
// this div blocks our player controls
$output = Html::remove("#theater-background", $output);
// replace youtube player div block with our own
$output = Html::replace_inner("#player-api", $player, $output);
}
// causes too many problems...
$output = Html::remove_scripts($output);
$response->setContent($output);
}
}
Fied
<?php
namespace Proxy\Plugin;
use Proxy\Event\ProxyEvent;
use Proxy\Html;
use Proxy\Plugin\AbstractPlugin;
class PornhubPlugin extends AbstractPlugin
{
protected $url_pattern = 'pornhub.com';
private function get_video_url($page_url){
$_ch = curl_init();
curl_setopt($_ch, CURLOPT_URL, $page_url);
curl_setopt($_ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($_ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($_ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($_ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; Android 10; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36');
$output = curl_exec($_ch);
curl_close($_ch);
preg_match('/"text":"480p","url":"([^"]+)/', $output, $matches);
$url = $matches[1];
$url = str_replace('\\', '', $url);
return $url;
}
public function onCompleted(ProxyEvent $event)
{
$response = $event['response'];
$content = $response->getContent();
//fix thumb
$content = preg_replace_callback('/<img[^>]+src="([^"]+)"[^>]+data-src = "([^"]+)/', function($matches){
return str_replace($matches[1], $matches[2], $matches[0]);
}, $content);
//fix search button
$content = preg_replace('/<div id="btnSearch" class="orangeButton"><i><\/i><\/div>/','<button id="btnSearch" class="orangeButton"><i></i></button>',$content);
$url = $event['request']->getUrl();
if(preg_match('/view_video/',$url)){
$video_url = $this->get_video_url($url);
$content = Html::remove_scripts($content);
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($userAgent, "Windows") || strpos($userAgent, "Mac OS X")){
$player = vid_player($video_url, 989, 557,"mp4");
$content = Html::replace_inner('#player', $player, $content);
}
else{
$player = vid_player($video_url, 400, 216,"mp4");
$content = Html::replace_inner('.playerWrapper', $player, $content);
}
}
else {$content = Html::remove_scripts($content);}
$response->setContent($content);
}
}
Hi buddy, sorry to post up again.
It seems the xhamster plugin has stopped working, the page doesn't seem to load correctly. Don't know if this is just me
I download these plugins like YoutubePlugin.php
and put it in the /plugins
folder, but my site down right away.
Can you tell me how to use it, I can not use composer.
Kinda confused how to add the plugins I added YouTube-Plugin and it broke the whole install
I believe they have updated the player, any help would be amazing please.
Oh also thanks for such a great bit of proxy software, do you have anywhere to make donations to help support future builds ?
Please make some plugins for thease sites for it is widely used but not supported well by php-proxy.
And I wonder how to build a site like unblockvideos.com.....
In utils.php, you use flowplayer to display the proxied YouTube videos (from what I can tell). You get flowplayer from here. Could you please explain this a bit more?
The flowplayer site seems to show that you must purchase flowplayer and makes no mention of free flash versions. How did you come across this and is there a way to keep an eye out for updated versions? Thanks.
I added 'Log' in my config.php
, like this
$config['plugins'] = array(
// 'Cache',
'HeaderRewrite',
'Stream',
// ^^ do not disable any of the plugins above
'Cookie',
'Proxify',
'UrlForm',
// site specific plugins below
'Youtube',
'DailyMotion',
'RedTube',
'XHamster',
'XVideos',
'Twitter',
'Log',
'Xnxx'
);
But it does not working, no /storage
folder exist.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.