fix: add duration (#3699)

This commit is contained in:
Dag 2023-09-24 00:03:21 +02:00 committed by GitHub
parent d33808ea9e
commit 0dc6c66840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -87,11 +87,15 @@ class PornhubBridge extends BridgeAbstract
$url = $element->find('a', 0)->href;
$item['uri'] = 'https://www.pornhub.com' . $url;
// Duration
$marker = $element->find('div.marker-overlays var', 0);
$duration = $marker->innertext ?? '';
// Content
$videoImage = $element->find('img', 0);
$image = $videoImage->getAttribute('data-src') ?: $videoImage->getAttribute('src');
if ($show_images === true) {
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $image . '"></a>';
$item['content'] = sprintf('<a href="%s"><img src="%s"></a><br>%s', $item['uri'], $image, $duration);
}
$uploaded = explode('/', $image);