From 6878eb26aa97413ad6f04e8d15f831c65f964c32 Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 6 Feb 2024 19:32:05 +0100 Subject: [PATCH] fix: changed dom (#3958) --- bridges/ManyVidsBridge.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/bridges/ManyVidsBridge.php b/bridges/ManyVidsBridge.php index df4996e6..21ad950f 100644 --- a/bridges/ManyVidsBridge.php +++ b/bridges/ManyVidsBridge.php @@ -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('', $item->videoThumb), + 'title' => $a->plaintext, + 'uri' => $uri, + 'uid' => $uid ?? $uri, + 'content' => $item->innertext, ]; } }