File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Proxy \Plugin ;
4
+
5
+ use Proxy \Plugin \AbstractPlugin ;
6
+ use Proxy \Event \ProxyEvent ;
7
+
8
+ use Proxy \Html ;
9
+
10
+ class XnxxPlugin extends AbstractPlugin {
11
+
12
+ protected $ url_pattern = 'xnxx.com ' ;
13
+
14
+ public function onCompleted (ProxyEvent $ event ){
15
+ $ response = $ event ['response ' ];
16
+
17
+ $ content = $ response ->getContent ();
18
+
19
+ $ content = preg_replace_callback ('/<img[^>]+src="([^"]+)"[^>]+data-src="([^"]+)/i ' , function ($ matches ){
20
+ return str_replace ($ matches [1 ], $ matches [2 ], $ matches [0 ]);
21
+ }, $ content );
22
+
23
+ if (preg_match ('/VideoUrlHigh\( \'([^ \']+)/ ' , $ content , $ matches )){
24
+ $ url = $ matches [1 ];
25
+
26
+ $ player = vid_player ($ url , 938 , 476 );
27
+
28
+ $ content = Html::replace_inner ('#video-player-bg ' , $ player , $ content );
29
+ }
30
+
31
+ // too many ads
32
+ $ content = Html::remove_scripts ($ content );
33
+ $ response ->setContent ($ content );
34
+ }
35
+
36
+ }
You can’t perform that action at this time.
0 commit comments