fix: changed dom (#3958)

This commit is contained in:
Dag 2024-02-06 19:32:05 +01:00 committed by GitHub
parent 64f95b4990
commit 6878eb26aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,19 +29,20 @@ class ManyVidsBridge extends BridgeAbstract
} else {
throw new \Exception('nope');
}
$url = sprintf('https://www.manyvids.com/Profile/%s/Store/Videos/', $profile);
$dom = getSimpleHTMLDOM($url);
$el = $dom->find('section[id="app-store-videos"]', 0);
$json = $el->getAttribute('data-store-videos');
$json = html_entity_decode($json);
$data = Json::decode($json, false);
foreach ($data->content->items as $item) {
$videos = $dom->find('div[class^="ProfileTabGrid_card"]');
foreach ($videos as $item) {
$a = $item->find('a', 1);
$uri = 'https://www.manyvids.com' . $a->href;
if (preg_match('#Video/(\d+)/#', $uri, $m)) {
$uid = 'manyvids/' . $m[1];
}
$this->items[] = [
'title' => $item->title,
'uri' => 'https://www.manyvids.com' . $item->preview->path,
'uid' => 'manyvids/' . $item->id,
'content' => sprintf('<img src="%s">', $item->videoThumb),
'title' => $a->plaintext,
'uri' => $uri,
'uid' => $uid ?? $uri,
'content' => $item->innertext,
];
}
}