Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/8cdn0GAsQrXnoFx8rhR6Qcgappy.jpg","genre_ids":[99,16,36,10770],"id":820233,"original_language":"fr","original_title":"Napoléon : la destinée et la mort","overview":"May 5, 1821. Napoleon Bonaparte, deposed emperor exiled on the island of St. Helena, is about to take his last breath. The son of a Corsican family, he has been close to death on many occasions since, as a young captain in the revolutionary army, he seized Toulon from the royalists in 1793.","popularity":1.811,"poster_path":"/5esBlA0mU9vbUpZ7kZLZcsHWnmF.jpg","release_date":"2021-04-24","title":"Napoleon: Destiny and Death","video":false,"vote_average":7.2,"vote_count":5,"character":"Self - Writer","credit_id":"60cdb02f9c24fc0058b10d74","order":7,"media_type":"movie"},{"adult":false,"backdrop_path":"/nYBJRpc6wkS6KDaoONXNdnwZWe7.jpg","genre_ids":[10764,10767],"id":130797,"origin_country":["FR"],"original_language":"fr","original_name":"Salut les Terriens !","overview":"","popularity":35.808,"poster_path":"/6aUK15tb5sYuRFHFbEkyMunCYQX.jpg","first_air_date":"2006-11-04","name":"Salut les Terriens !","vote_average":3.5,"vote_count":3,"character":"Self (guest)","credit_id":"61105be4168935005e1d1b95","episode_count":1,"media_type":"tv"},{"adult":false,"backdrop_path":"/wkmh7WClhfU7DQdti6lEFH0qLT3.jpg","genre_ids":[10767],"id":30243,"origin_country":["FR"],"original_language":"fr","original_name":"Apostrophes","overview":"Apostrophes was a live, weekly, literary, prime-time, talk show on French television created and hosted by Bernard Pivot. It ran for fifteen years (724 episodes) from January 10, 1975, to June 22, 1990, and was one of the most watched shows on French television (around 6 million regular viewers). It was broadcast on Friday nights on the channel France 2 (which was called \"Antenne 2\" from 1975 to 1992). The hourlong show was devoted to books, authors and literature. The format varied between one-on-one interviews with a single author and open discussions between four or five authors.","popularity":110.459,"poster_path":"/8sAKVFRZDoZa51a60BO24Pf6jnb.jpg","first_air_date":"1975-01-10","name":"Apostrophes","vote_average":8.5,"vote_count":2,"character":"Self","credit_id":"63b59460c56d2d0096d603eb","episode_count":5,"media_type":"tv"}],"crew":[{"adult":false,"backdrop_path":null,"genre_ids":[35],"id":756940,"original_language":"fr","original_title":"La veste rouge","overview":"A young boy is bewitched by a girl he sees by the pool.","popularity":0.717,"poster_path":"/4mVF3efuDDG2tBZlND4JmRmMKlz.jpg","release_date":"2003-04-29","title":"The Red Jacket","video":false,"vote_average":3.0,"vote_count":2,"credit_id":"5f9431aee8131d004f501df7","department":"Writing","job":"Screenplay","media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[35],"id":756940,"original_language":"fr","original_title":"La veste rouge","overview":"A young boy is bewitched by a girl he sees by the pool.","popularity":0.717,"poster_path":"/4mVF3efuDDG2tBZlND4JmRmMKlz.jpg","release_date":"2003-04-29","title":"The Red Jacket","video":false,"vote_average":3.0,"vote_count":2,"credit_id":"5f9431c1e8131d00335000a0","department":"Writing","job":"Novel","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'] ?? [];