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

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);