Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/lnPrQ1FvjiOOOdnsRKpkJ1oV3Ox.jpg","genre_ids":[18],"id":899988,"original_language":"pt","original_title":"Linha","overview":"","popularity":1.453,"poster_path":"/yHyXqcN7sylVFhllhjJEsMTtjRk.jpg","release_date":"2021-07-14","title":"Linha","video":false,"vote_average":8.0,"vote_count":1,"character":"Edi","credit_id":"6196df11af58cb00666645f8","order":0,"media_type":"movie"},{"adult":false,"backdrop_path":"/yYkIg2tNYVjKqIJZeYA2LpWlsAg.jpg","genre_ids":[18],"id":1128864,"original_language":"pt","original_title":"Banzo","overview":"1907. Afonso, a doctor, arrives at Principe Island to cure servants from a cocoa plantation “infected” with Banzo, nostalgia of the slaves, who are dying from starvation and suicide. The group is confined to the forest, where Afonso decides to heal them by trying to understand what is affecting their soul. Will he manage to save them?","popularity":3.686,"poster_path":"/ju8KBJGFOM3gYIEw6laMSymlUUw.jpg","release_date":"2024-12-25","title":"Banzo","video":false,"vote_average":0.0,"vote_count":0,"character":"Murata","credit_id":"6643e1eb6803b72e39328826","order":17,"media_type":"movie"},{"adult":false,"backdrop_path":"/rqI0mDCZS3AgQeXvnzAJWAZ7zfw.jpg","genre_ids":[18],"id":516039,"original_language":"pt","original_title":"Ruth: A Pérola do Índico","overview":"This is the story of a young Mozambican footballer called Eusébio, a gifted athlete destined to great achievements, coveted by rival clubs, Sporting and Benfica, which ends up hiring him. Blackmail, kidnapping attempts, ministers involved, press hysteria and huge money offers make the story of this football transfer into a saga evolving between the two continents. It ends up when the legend begins: with Eusébio’s first match at the Benfica Stadium.","popularity":0.948,"poster_path":"/3zkzOckD1FnAzhin9nPSXql7csi.jpg","release_date":"2018-05-03","title":"Ruth","video":false,"vote_average":6.7,"vote_count":7,"character":"Barman","credit_id":"66fc20fde7811ef6cba688fe","order":19,"media_type":"movie"},{"adult":false,"backdrop_path":"/zfJ92ITa8qYedvC7rtmWpXB6cRe.jpg","genre_ids":[18],"id":259524,"origin_country":["PT"],"original_language":"pt","original_name":"A Fazenda","overview":"","popularity":2.858,"poster_path":"/beb032iToBHadhAR2CJIwM75fay.jpg","first_air_date":"2024-12-06","name":"A Fazenda","vote_average":0.0,"vote_count":0,"character":"","credit_id":"669bff6bf03f5f743795458b","episode_count":1,"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'] ?? [];