Athlon1600 / php-proxy-app

Web Proxy Application built on php-proxy library ready to be installed on your server
https://www.php-proxy.com/
MIT License
824 stars 518 forks source link

Plugin for Pornhub doesn't work #166

Open ghost opened 5 years ago

ghost commented 5 years ago

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!

Athlon1600 commented 5 years ago

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

ghost commented 5 years ago

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

ghost commented 5 years ago

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 commented 5 years ago

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.

ch4rc0al1080 commented 4 years ago

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.

ghost commented 4 years ago

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);
}

}'