Sign up here and you can log into the forum!

Pornhub 2.0

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

Re: Pornhub 2.0   

Postby foxer » Sun Aug 28, 2011 6:32 am

Thanks for reporting guys.
I've had a quick look and it seems tube8 have made changes on their site that break the plugin. I will look for a solution next week and post an update when it will be working again.

You can see the relevant messages in /tmp/umsp-log.txt
Code: Select all
2011.08.28 17:31:32 tube8.php - *** Downloading video http://www.tube8.com/teen/kristina-rose-in-innocent-high/1389571/
2011.08.28 17:31:33 tube8.php - Couldn't find video_url in http://www.tube8.com/teen/kristina-rose-in-innocent-high/1389571/. Maybe the page format has changed
foxer
WDTVer
 
Posts: 48
Joined: Wed Nov 24, 2010 9:45 am

Re: Pornhub 2.0   

Postby pobs123 » Sun Aug 28, 2011 9:27 am

It is not the most elegant solution - but I have a workaround for Tube8.

in tube8.php, I changed the code from:

Code: Select all
if(preg_match("/flashvars\.video_url\s*=\s*\"([^\"]+)\"/", $html, $match)){
   $video_url = urldecode($match[1]);
   _logDebug("Got video url $video_url");
   $parsed = parse_url($video_url);
       proxyGet($parsed['host'], $parsed['path'],$parsed['query']);
}
else{
   //couldn't find video
   _logError("Couldn't find video_url in $uri. Maybe the page format has changed");
}


to

Code: Select all
if(preg_match("/flashvars\.video_url\s*=\s*\"([^\"]+)\"/", $html, $match)){
   $video_url = urldecode($match[1]);
   _logDebug("Got video url $video_url");
   $parsed = parse_url($video_url);
       proxyGet($parsed['host'], $parsed['path'],$parsed['query']);
}
else{
   //couldn't find video
   $pos = strpos($html, "videourl");
   if ($pos === false) {
      _logError("Couldn't find video_url in $uri. Maybe the page format has changed");
   }
   else{
      $posStart = strpos($html, "\"", $pos);
      if ($posStart === false) {
         _logError("Could not find beginning quote");
      }
      else{
         $posEnd = strpos($html, "\"", $posStart + 1);
         if ($posEnd === false) {
            _logError("Could not find ending quote");
         }
         else{
            $video_url = urldecode(substr($html, $posStart + 1, $posEnd - $posStart - 1));
            _logDebug("Got video url $video_url");
            $parsed = parse_url($video_url);
                proxyGet($parsed['host'], $parsed['path'],$parsed['query']);
         }
      }

   }

}
pobs123
Supporter
 
Posts: 84
Joined: Thu Dec 30, 2010 10:40 am

Re: Pornhub 2.0   

Postby foxer » Sun Aug 28, 2011 10:11 pm

THanks for the patch pops, but I've fixed it in a more elegant way by changing the regular expression that used to match the video URL.
The updated version is already uploaded. You can update and give it a try. If there are still issues, let me know.

Oh, and next time this happens, post on the Tube8 thread, since I am subscribed to all of them. :)
foxer
WDTVer
 
Posts: 48
Joined: Wed Nov 24, 2010 9:45 am

Re: Pornhub 2.0   

Postby pobs123 » Mon Aug 29, 2011 8:59 am

Yes, I thought about changing the RegEx, but I was not sure if other pattern matching was dependent on it. So I decided the safest way to "patch" it - was to put it in the else condition.

Thanks - I'll test it when I get home tonight.
pobs123
Supporter
 
Posts: 84
Joined: Thu Dec 30, 2010 10:40 am

Re: Pornhub 2.0   

Postby S4bb3 » Sun Apr 29, 2012 1:13 am

This plugin does not work.
S4bb3
Donor
 
Posts: 41
Joined: Fri Apr 30, 2010 10:01 pm

Re: Pornhub 2.0   

Postby pobs123 » Mon Apr 30, 2012 6:46 pm

Pornhub changed their page. Here is a fix for it:

in /tmp/umsp-plugins/pornhub/pornhub.php

Change a line of code from:
Code: Select all
if(preg_match("/video_url\",\"([^\"]+)\"/", $html, $match)){

to:
Code: Select all
if(preg_match("/video_url\":\"([^\"]+)\"/", $html, $match)){
pobs123
Supporter
 
Posts: 84
Joined: Thu Dec 30, 2010 10:40 am

Re: Pornhub 2.0   

Postby recliq » Tue May 01, 2012 1:31 am

commited fix to svn (r627), thanks pob123.
Reboot your WDTV to get the updated plugin.
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5034
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Pornhub 2.0   

Postby pobs123 » Tue May 01, 2012 5:20 am

Thanks - recliq
pobs123
Supporter
 
Posts: 84
Joined: Thu Dec 30, 2010 10:40 am

Re: Pornhub 2.0   

Postby foxer » Thu Aug 16, 2012 11:47 am

Seems pornhub was broken again. They added some extra tags to their html. Uploaded fixed version - enjoy.
foxer
WDTVer
 
Posts: 48
Joined: Wed Nov 24, 2010 9:45 am

Re: Pornhub 2.0   

Postby foxer » Tue Oct 16, 2012 7:13 am

I have three bad news and a good news...

Bad news 1: The plugin is broken.
Bad news 2: Nobody complained.
Bad news 3: Pornhub now encrypts the URLs for the video, the same as tube8.
Good news: I fixed it. Used the same approach as bagira for tube8. They use the video title as encryption key. Reboot to get the newer version

Try it out - if it doesn't work, let me know.
foxer
WDTVer
 
Posts: 48
Joined: Wed Nov 24, 2010 9:45 am

PreviousNext

Return to UMSP Plugins

Who is online

Users browsing this forum: No registered users and 0 guests