php-proxy-app icon indicating copy to clipboard operation
php-proxy-app copied to clipboard

Plugin for Pornhub doesn't work

Open ghost opened this issue 4 years ago • 6 comments

It worked for a long. However, at last few weeks. It displayed video is not available when I open Pornhub with this proxy. Could you help update the Pornhub plugin. Thx!

ghost avatar Aug 04 '19 08:08 ghost

pornhub plugin works just fine for me, it's just not enabled by default. That's what I just found out 😬

Edit $config['plugins'] and add 'Pornhub' to your config.php file.

https://github.com/Athlon1600/php-proxy-app/blob/master/config.php

Athlon1600 avatar Aug 13 '19 01:08 Athlon1600

Sorry, I didn't notice that. It's working now. Thx!😀

ghost avatar Aug 13 '19 02:08 ghost

Oops, I found that plugin only works on pc version. It shows blank on mobile or portal version, I don't know why. Could you take a look? Here is my site: https://vu.qnid.cc

ghost avatar Aug 13 '19 02:08 ghost

Oh, I see. The portable and mobile version of Pornhub don't have #player tag. So I add $playerm = vid_player($url, 400, 216); $content = Html::replace_inner('.playerWrapper', $playerm, $content); I think I simply fixed it.

ghost avatar Aug 15 '19 00:08 ghost

Oh, I see. The portable and mobile version of Pornhub don't have #player tag. So I add $playerm = vid_player($url, 400, 216); $content = Html::replace_inner('.playerWrapper', $playerm, $content); I think I simply fixed it.

It doesn't work for me, I will be appreciated if you can show your code.

ch4rc0al1080 avatar Sep 23 '19 04:09 ch4rc0al1080

Oh, I see. The portable and mobile version of Pornhub don't have #player tag. So I add $playerm = vid_player($url, 400, 216); $content = Html::replace_inner('.playerWrapper', $playerm, $content); I think I simply fixed it.

It doesn't work for me, I will be appreciated if you can show your code.

'<?php

namespace Proxy\Plugin;

use Proxy\Plugin\AbstractPlugin; use Proxy\Event\ProxyEvent;

use Proxy\Html;

class PornhubPlugin extends AbstractPlugin {

protected $url_pattern = 'pornhub.com';

public function onCompleted(ProxyEvent $event){
	$response = $event['response'];
	
	$content = $response->getContent();
	
	if(preg_match('/"videoUrl":"([^"]+)/', $content, $matches)){
		$url = $matches[1];
		$url = str_replace('\\', '', $url);
		
		$player = vid_player($url, 989, 557);
		$content = Html::replace_inner('#player', $player, $content);
		$playerm = vid_player($url, 400, 216);
		$content = Html::replace_inner('.playerWrapper', $playerm, $content);
	}
	
	// too many ads
	$content = Html::remove_scripts($content);
	
	$response->setContent($content);
}

}'

ghost avatar Oct 03 '19 16:10 ghost