Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/cjRlBXjfevMG3MvTjYi7om9XFuR.jpg","genre_ids":[16],"id":970867,"original_language":"fr","original_title":"Dounia et la Princesse d'Alep","overview":"Forced to leave Syria because of the war, Dounia and her grandparents go in search of a new safe haven. As she traverses the world in search of asylum, Dounia draws strength from the wisdom of the ancient world, brought to light by her grandmother's magic nigella seeds.","popularity":5.533,"poster_path":"/ghbylpaqHeZcVaxxenx67jTva06.jpg","release_date":"2023-02-01","title":"Dounia and the Princess of Aleppo","video":false,"vote_average":7.6,"vote_count":13,"character":"Sami (voice)","credit_id":"644f59952fccee02dcce16de","order":12,"media_type":"movie"},{"adult":false,"backdrop_path":"/gzRFN3Cic5f519pd6Mw0j8oiZ3S.jpg","genre_ids":[18],"id":1359461,"original_language":"fr","original_title":"Rituels sous un ciel écarlate","overview":"A lone gunman perched on a rooftop grows bored while awaiting his next victim. A mother records a video for an audition for a televised singing competition. A young girl carries water containers and must cross a dangerous area before nightfall. Distant explosions echo, nothing alarming. Time stands still, allowing the three figures to find refuge in their luminous dreams. The sun will set soon, carrying them away. Rituals Under a Scarlet Sky tells the tale of a daily life where hope survives despite the tragedy that attempts to engulf it.","popularity":1.593,"poster_path":"/hdcYJVuNqzgj4mTEHQW6LFsljML.jpg","release_date":"2024-10-11","title":"Rituals Under a Scarlet Sky","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"66ee49f14a7f0b18b025da4c","order":2,"media_type":"movie"}],"crew":[]}}
96 'Content-Type' => 'application/json;charset=utf-8',
97 'Authorization' => sprintf('Bearer %s', Configurator::$instance->get('tmdb'))
98 ];
99
100 // Append language preference to headers to avoid adult content
101 $headers['Accept-Language'] = 'en-US'; // Example: Set language preference to English
102
103 // Make the GET request with headers
104 $resp = EasyCurl::setHeaders($headers)->get(...$args);
105
106 // Check if response status is not 200 OK
107 if ($resp->getStatus() != 200) {
108 throw new TmdbClientException('Tmdb Client Error: ' . $resp->getBody(), $resp->getStatus());
109 }
110
111 // Check for adult content in response (assuming TMDB API supports such filtering)
112 $jsonResponse = json_decode($resp->getBody(), true);
113
114
115 return $resp;
116 }
117
118
119 public function getGenre(): array
120 {
121 return $this->request('genre/' . $this->getType() . '/list')['genres'] ?? [];