Actualiser api.php

This commit is contained in:
2026-06-25 13:51:06 +02:00
parent 906e7b2e1d
commit b9c98c7534
+16 -5
View File
@@ -645,13 +645,24 @@ switch ($action) {
break;
case 'test_dvdfr':
$url = "https://www.dvdfr.com/api/search.php?title=" . urlencode($_GET['title'] ?? 'Matrix');
$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);
echo json_encode([
$results[] = [
'url' => $url,
'http_length' => $html ? strlen($html) : 0,
'snippet' => $html ? substr($html, 0, 300) : 'VIDE/ERREUR'
]);
'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;
}
?>