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