Actualiser api.php
This commit is contained in:
@@ -645,13 +645,24 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'test_dvdfr':
|
case 'test_dvdfr':
|
||||||
$url = "https://www.dvdfr.com/api/search.php?title=" . urlencode($_GET['title'] ?? 'Matrix');
|
$title = urlencode($_GET['title'] ?? 'Matrix');
|
||||||
$html = httpGet($url, 5);
|
$urls = [
|
||||||
echo json_encode([
|
"https://www.dvdfr.com/api/search.php?title={$title}",
|
||||||
'url' => $url,
|
"https://www.dvdfr.com/recherche/films.php?title={$title}",
|
||||||
'http_length' => $html ? strlen($html) : 0,
|
"https://www.dvdfr.com/dvd/search.php?title={$title}",
|
||||||
'snippet' => $html ? substr($html, 0, 300) : 'VIDE/ERREUR'
|
"https://dvdfr.com/api/search.php?title={$title}",
|
||||||
]);
|
"https://www.dvdfr.com/recherche/?q={$title}",
|
||||||
break;
|
];
|
||||||
|
$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;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user