Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2017-09-14 11:34:01

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

grabbers fix

there is few grabbers sites stop working....i didnt test one by one yet.... i have fix xhamster.
if you find some other email me and i will fix


xhamster fix file_get

on line 112 replace all function get_file() with this code

 private function get_file()
	{
		preg_match('/"sources":{"mp4":[{"url":"(.*?)"isHD":true},/', $this->html, $match);
		if (!isset($match['1']) or !$match['1']) {
			preg_match('/{"url":"(.*?)"480p"},/', $this->html, $match);
			if (!isset($match['1']) or !$match['1']) {
				preg_match('/{"url":"(.*?)":"240p"}]}/', $this->html, $match);
			}
		}
		$replace = "\\";
		if (isset($match['1']) && $match['1']) {		
			return str_replace($replace,'',$match['1']);
		}

		$this->error = $this->errors['file_error'];
	}

Thanks

Last edited by thiva7 (2017-09-14 11:38:47)

Offline

#2 2017-09-15 13:14:20

happylag
Member
Registered: 2016-04-05
Posts: 182

Re: grabbers fix

Do you mean in admin/modules/graber/grabers/xhamster.php to replace

    private function get_file()
    {
  		preg_match("/file: '(.*?)',/", $this->html, $match);
  		if (isset($match['1'])) {
  			return $match['1'];
  		} 
    
  		preg_match('/type=\'video\/mp4\' file="(.*?)"/', $this->html, $match);
  		if (isset($match['1'])) {
  			return $match['1'];
  		} 
    
        $server = null;
        preg_match('/srv=(.*?)\&/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            $server = urldecode($match['1']).'/key=';
        }

        preg_match('/file=(.*?)&/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            if (strpos($match['1'], 'http://') !== false) {
                $server = null;
            }

            return $server.urldecode($match['1']).'.mp4';
        }

        return FALSE;
    }

BY

private function get_file()
	{
		preg_match('/"sources":{"mp4":[{"url":"(.*?)"isHD":true},/', $this->html, $match);
		if (!isset($match['1']) or !$match['1']) {
			preg_match('/{"url":"(.*?)"480p"},/', $this->html, $match);
			if (!isset($match['1']) or !$match['1']) {
				preg_match('/{"url":"(.*?)":"240p"}]}/', $this->html, $match);
			}
		}
		$replace = "\\";
		if (isset($match['1']) && $match['1']) {		
			return str_replace($replace,'',$match['1']);
		}

		$this->error = $this->errors['file_error'];
	}

It doesn't work for me.

Offline

#3 2017-09-15 20:39:06

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

hey,

since i fix grabber my self and am using only 1-3 sites i dont ask adrian for new version.
as i see both codes work for me.

i test each code and get files source

Offline

#4 2017-09-15 21:41:50

happylag
Member
Registered: 2016-04-05
Posts: 182

Re: grabbers fix

Would it be possible to send me the whole xhamster file?

Thank you.

Offline

#5 2017-09-15 22:26:48

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

happylag wrote:

Would it be possible to send me the whole xhamster file?

Thank you.


i cant send you email via asp forum so i put all code here...just copy paste it

<?php
defined('_VALID') or die('Restricted Access!');
class VGraber_xhamster
{
	private $url;
	private $html;
	private $video;
	
	private $error		= FALSE;
	private $errors 	= array(
		'html_error'		=> 'Failed to get html for the requested url!',
		'title_error'		=> 'Failed to get video title!',
		'category_error'	=> 'Failed to get video category!',
		'tags_error'		=> 'Failed to get video tags!',
		'file_error'		=> 'Failed to get video file!'
	);
	
	public function __construct($url)
	{
		$this->url	= $url;
	}
	
	public function process()
	{
		$this->get_html($this->url);
		if (!$this->error) {
			$this->video['title']		= $this->get_title();
			$this->video['description']	= $this->get_description();
			$this->video['tags']		= $this->get_tags();
			$this->video['category']	= $this->get_category();
			$this->video['file']		= $this->get_file();
			$this->video['size']		= $this->get_size();
		}
	}
	
	public function get_video()
	{
		return $this->video;
	}
	
	public function get_html($url)
	{
		if (!$this->html = VCurl::string($url)) {
			$this->error = $this->errors['html_error'];
		}
		
		$this->html	= str_replace(array("\n", "\r"), '', $this->html);
		$this->html = preg_replace('/\s\s+/', ' ', $this->html);
	}
	
	public function is_error()
	{
		return ($this->error) ? TRUE : FALSE;
	}
	
	public function get_error()
	{
		return $this->error;
	}
	
	private function get_title()
	{
		preg_match('/<h1 itemprop="name">(.*?)<\/h1>/', $this->html, $match);
		if (isset($match['1']) && $match['1']) {
			return e(strip_tags(str_replace(' - xHamster.com', '', $match['1'])));
		}
		
		$this->error = $this->errors['title_error'];
	}
	
	private function get_description()
	{
		preg_match('/<span>Description:<\/span>(.*?)Comment please/', $this->html, $match);
		if (isset($match['1']) && $match['1']) {
			return e(strip_tags($match['1']));
		}else{
			return $this->get_title();
		}
	}
	
	private function get_tags()
	{
		preg_match('/<span>Categories:<\/span><\/td><td>(.*?)<\/td>/', $this->html, $match);
		if (isset($match['1']) && $match['1']) {
			preg_match_all('/<a title="(.*?)" href="(.*?)">(.*?)<\/a>/', $match['1'], $matches);
			if (isset($matches['3']) && $matches['3']) {
				return $matches['3'];
			}
		}
		
		if (isset($this->video['title']) && $this->video['title'] != '') {
            $array  = explode(' ', utf8_strtolower($this->video['title']));
            $tags   = array();
            foreach ($array as $string) {
                if (strlen($string) >= TAG_MIN_LENGTH) {
                    $tags[] = $string;
                }
            }

            return $tags;
        }
		
		$this->error = $this->errors['tags_error'];
	}
	
	private function get_category()
	{
		
		return '';
	}

   private function get_file()
    {
  		preg_match("/file: '(.*?)',/", $this->html, $match);
  		if (isset($match['1'])) {
  			return $match['1'];
  		} 
    
  		preg_match('/type=\'video\/mp4\' file="(.*?)"/', $this->html, $match);
  		if (isset($match['1'])) {
  			return $match['1'];
  		} 
    
        $server = null;
        preg_match('/srv=(.*?)\&/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            $server = urldecode($match['1']).'/key=';
        }

        preg_match('/file=(.*?)&/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            if (strpos($match['1'], 'http://') !== false) {
                $server = null;
            }

            return $server.urldecode($match['1']).'.mp4';
        }

        return FALSE;
    }
	
	private function get_size()
	{
		if (isset($this->video['file'])) {
			return 0;
		}
	}
}

Offline

#6 2017-09-17 18:18:05

Double_D
Member
From: The Netherlands
Registered: 2014-08-14
Posts: 305
Website

Re: grabbers fix

thanks Thiva wink

Offline

#7 2017-09-19 10:21:43

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

Double_D wrote:

thanks Thiva wink


No problem smile

Offline

#8 2017-09-19 19:06:58

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: grabbers fix

I just tested the grabers on my box for xhamster and redtube. Both are working.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#9 2017-09-19 21:51:01

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

symtab wrote:

I just tested the grabers on my box for xhamster and redtube. Both are working.

Hey

send me last version when u have time.
if i find anything that not working i can make it work...this way u will stop worry about less stuff and work more on dev v3

Offline

#10 2017-09-21 15:57:26

K!ng
Member
Registered: 2013-01-18
Posts: 103
Website

Re: grabbers fix

i copied your xHamster.php and got this message:

Tip!Invalid url! Supported sites: pornhub, redtube, empflix, tnaflix, porn2, pornative, xvideos, pornrabbit, keezmovies, madthumbs, yobt, sextube, slutload, tube8, pornerbros, manhub, deviantclip, xhamster, extremetube!

Offline

#11 2017-09-21 17:07:56

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

K!ng wrote:

i copied your xHamster.php and got this message:

Tip!Invalid url! Supported sites: pornhub, redtube, empflix, tnaflix, porn2, pornative, xvideos, pornrabbit, keezmovies, madthumbs, yobt, sextube, slutload, tube8, pornerbros, manhub, deviantclip, xhamster, extremetube!


this is for grab videos ( source of mp4 ) to host videos not for embed videos.

thats error msg is from mass embed

Offline

#12 2017-11-08 13:26:10

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: grabbers fix

PornHub fix

replace

private function get_file()
{
*
}


with

 private function get_file()
    {
        preg_match('/"quality":"720","videoUrl":"(.*?)"},/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            return utf8_trim(stripslashes($match['1']));
        }

        preg_match('/"quality":"480","videoUrl":"(.*?)"},/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            return utf8_trim(stripslashes($match['1']));
        }

        preg_match('/"quality":"360","videoUrl":"(.*?)"},/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            return utf8_trim(stripslashes($match['1']));
        }

        preg_match('/"quality":"240","videoUrl":"(.*?)"},/', $this->html, $match);
        if (isset($match['1']) && $match['1']) {
            return utf8_trim(stripslashes($match['1']));
        }

        return FALSE;
    }

Offline

Board footer

Powered by FluxBB