diff --git a/api.php b/api.php index dd036bf..36ff9a8 100644 --- a/api.php +++ b/api.php @@ -645,13 +645,24 @@ switch ($action) { break; case 'test_dvdfr': - $url = "https://www.dvdfr.com/api/search.php?title=" . urlencode($_GET['title'] ?? 'Matrix'); - $html = httpGet($url, 5); - echo json_encode([ - 'url' => $url, - 'http_length' => $html ? strlen($html) : 0, - 'snippet' => $html ? substr($html, 0, 300) : 'VIDE/ERREUR' - ]); - break; + $title = urlencode($_GET['title'] ?? 'Matrix'); + $urls = [ + "https://www.dvdfr.com/api/search.php?title={$title}", + "https://www.dvdfr.com/recherche/films.php?title={$title}", + "https://www.dvdfr.com/dvd/search.php?title={$title}", + "https://dvdfr.com/api/search.php?title={$title}", + "https://www.dvdfr.com/recherche/?q={$title}", + ]; + $results = []; + foreach ($urls as $url) { + $html = httpGet($url, 5); + $results[] = [ + 'url' => $url, + 'length' => $html ? strlen($html) : 0, + 'code' => $html ? substr(strip_tags($html), 0, 150) : 'ERREUR' + ]; + } + echo json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); + break; } ?> \ No newline at end of file