Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/qbrMrdQoeern6bRG9te2FZBGv0M.jpg","genre_ids":[14,878,28],"id":38219,"original_language":"it","original_title":"Il mondo di Yor","overview":"In prehistoric times, the muscular Yor saves his cave-babe from a dinosaur just before they get zapped into the future to battle bad guys in the familiar desolate wasteland.","popularity":4.717,"poster_path":"/8cMkOOHlJaeQKgGPakxc6sEHHKJ.jpg","release_date":"1983-08-19","title":"Yor, the Hunter from the Future","video":false,"vote_average":4.4,"vote_count":49,"character":"","credit_id":"5a3c48510e0a264cbc239eb8","order":16,"media_type":"movie"},{"adult":false,"backdrop_path":"/ky7IbwrjM4gmUPsPh4egXSBAYfL.jpg","genre_ids":[10765,10759],"id":206476,"origin_country":["IT"],"original_language":"it","original_name":"Il Mondo di Yor","overview":"A warrior seeks his true origins in a seemingly prehistoric wasteland.","popularity":3.147,"poster_path":"/lrzGlgSgF60pcr17t0Zl1UGwNIF.jpg","first_air_date":"1983-07-01","name":"The World of Yor","vote_average":0.0,"vote_count":0,"character":"","credit_id":"62da55fee10f4603722f2e3c","episode_count":4,"media_type":"tv"}],"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'] ?? [];