Git Product home page Git Product logo

php-proxy-plugin-bundle's People

Contributors

athlon1600 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php-proxy-plugin-bundle's Issues

New YouTube layout

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!

Chaturbate Plugin?

Hi, I'd really appreciate if someone could make a plugin for Chaturbate.

Fix Youtube and Pornhub

I fixed Youtube and Pornhub

Youtube

Youtube now works in

  • Homepage
  • Trending
  • Video Page

Bug

  • Can't do search action
<?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);
	}
}

Pornhub

Fied

  • Thumb
  • Search button on PC
  • Video page on PC
<?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);
	}
}

Xhamster has stopped working,

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

How to use these plugins?

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.

Xhamster plugin has stopped working

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 ?

Youtube Plugin Doesn't Work

Hi,

Youtube plugin seems to not working. Is it just me or youtube changes somethings? When i tried to enter youtube on proxy, I got empty page.

screen shot 2017-09-11 at 12 44 07

Question about flowplayer in utils.php

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.

LogPlugin does not work ?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.