Actualiser api.php

This commit is contained in:
2026-06-24 16:03:04 +02:00
parent 594bd0c301
commit 808a1ad406
-9
View File
@@ -109,10 +109,6 @@ function extractYear($dateStr) {
function fetchDVDFr($ean, $pdo) {
if (empty($ean) || strlen($ean) < 8) return null;
$cacheKey = 'dvdfr_html_' . md5($ean);
$cached = getCache($pdo, $cacheKey);
if ($cached) return $cached;
$ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
// Étape 1 : Recherche par EAN sur le site DVDfr
@@ -243,11 +239,6 @@ function fetchDVDFr($ean, $pdo) {
return trim(strip_tags(html_entity_decode($val, ENT_QUOTES | ENT_HTML5, 'UTF-8')));
}, $result);
// Mise en cache si on a au moins une donnée
if (!empty($result['poster']) || !empty($result['publisher'])) {
setCache($pdo, $cacheKey, $result, 'dvdfr');
}
return (!empty($result['poster']) || !empty($result['publisher'])) ? $result : null;
}