Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":null,"genre_ids":[18],"id":421031,"original_language":"it","original_title":"Le affinità elettive","overview":"Adaptation of Goethe's novel.","popularity":0.895,"poster_path":"/puhDt71t2TjYniZRNSQFnzKO5zU.jpg","release_date":"1978-10-03","title":"Elective Affinities","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"5ebe61393d3557001edffd60","order":17,"media_type":"movie"}],"crew":[{"adult":false,"backdrop_path":"/96kJD9WqICGfAUMWEvpiUMlFaNI.jpg","genre_ids":[27],"id":5425,"original_language":"it","original_title":"Buio Omega","overview":"A disturbed young embalmer digs the grave of his recently deceased girlfriend and brings her body to his family villa with help from his strange housekeeper. But his bouts of insanity are just beginning.","popularity":7.095,"poster_path":"/tel3ZG4zvbsR3PPEQlQxCjvWrd1.jpg","release_date":"1979-11-15","title":"Beyond the Darkness","video":false,"vote_average":6.4,"vote_count":165,"credit_id":"6626e2a9b9a0bd017ad798c9","department":"Production","job":"Production Secretary","media_type":"movie"}]}}
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'] ?? [];