[PornhubBridge] Fix travis issues (#1471)

* [PornhubBridge] Fix travis issues
This commit is contained in:
Joseph 2020-02-26 20:34:46 +00:00 committed by GitHub
parent 480694e819
commit fe83d763a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,12 +27,12 @@ class PornhubBridge extends BridgeAbstract {
'name' => 'Sort by', 'name' => 'Sort by',
'type' => 'list', 'type' => 'list',
'values' => array( 'values' => array(
'Most recent' => '', 'Most recent' => '?',
'Most views' => '?o=mv', 'Most views' => '?o=mv',
'Top rated' => '?o=tr', 'Top rated' => '?o=tr',
'Longest' => '?o=lg', 'Longest' => '?o=lg',
), ),
'defaultValue' => '', 'defaultValue' => '?',
), ),
'show_images' => array( 'show_images' => array(
'name' => 'Show thumbnails', 'name' => 'Show thumbnails',
@ -52,7 +52,7 @@ class PornhubBridge extends BridgeAbstract {
$uri = 'https://www.pornhub.com/' . $this->getInput('type') . '/'; $uri = 'https://www.pornhub.com/' . $this->getInput('type') . '/';
switch($this->getInput('type')) { // select proper permalink format per user type... switch($this->getInput('type')) { // select proper permalink format per user type...
case 'model': case 'model':
$uri .= urlencode($this->getInput('q')) . '/videos' . $this->getInput('sort'); break; $uri .= urlencode($this->getInput('q')) . '/videos' . $this->getInput('sort'); break;
case 'users': case 'users':
$uri .= urlencode($this->getInput('q')) . '/videos/public' . $this->getInput('sort'); break; $uri .= urlencode($this->getInput('q')) . '/videos/public' . $this->getInput('sort'); break;
@ -84,13 +84,13 @@ class PornhubBridge extends BridgeAbstract {
// Content // Content
$image = $element->find('img', 0)->getAttribute('data-src'); $image = $element->find('img', 0)->getAttribute('data-src');
if($show_images == TRUE) { if($show_images === true) {
$item['content'] = '<a href="'.$item['uri'].'"><img src="' . $image . '"></a>'; $item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $image . '"></a>';
} }
// date hack, guess upload YYYYMMDD from thumbnail URL (format: https://ci.phncdn.com/videos/201907/25/--- ) // date hack, guess upload YYYYMMDD from thumbnail URL (format: https://ci.phncdn.com/videos/201907/25/--- )
$uploaded = explode('/', $image); $uploaded = explode('/', $image);
$uploaded = strtotime($uploaded[4].$uploaded[5]); $uploaded = strtotime($uploaded[4] . $uploaded[5]);
$item['timestamp'] = $uploaded; $item['timestamp'] = $uploaded;
$this->items[] = $item; $this->items[] = $item;