Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/g1fBL5fFVMk9ncQPBcqS0mvTRWx.jpg","genre_ids":[35],"id":1389487,"original_language":"pt","original_title":"História Verdadeira de Natal","overview":"","popularity":0.219,"poster_path":"/txW14czeNqf5lEoTlphC6u5pDug.jpg","release_date":"2023-12-24","title":"História Verdadeira de Natal","video":false,"vote_average":10.0,"vote_count":1,"character":"Fantasma do Natal/Belchior","credit_id":"673a745a3c831a132953c7f1","order":3,"media_type":"movie"},{"adult":false,"backdrop_path":"/yTw9xUsKhV6uy0NrHT4uD0y2OYU.jpg","genre_ids":[35,99],"id":1389762,"original_language":"pt","original_title":"Queima do Judas","overview":"","popularity":0.296,"poster_path":"/8tiRsZHNkjJ5qkS7kVEfchelsU0.jpg","release_date":"2024-08-04","title":"Queima do Judas","video":false,"vote_average":10.0,"vote_count":1,"character":"Maria do Céu","credit_id":"673b616bd17d5c34fbef0376","order":2,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[35,18,10751],"id":1390260,"original_language":"pt","original_title":"Quando A Estrela Brilha...","overview":"","popularity":1.079,"poster_path":null,"release_date":"2024-12-24","title":"Quando A Estrela Brilha...","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"673cb32e60b7b3bc94a0c8fc","order":2,"media_type":"movie"}],"crew":[{"adult":false,"backdrop_path":"/yTw9xUsKhV6uy0NrHT4uD0y2OYU.jpg","genre_ids":[35,99],"id":1389762,"original_language":"pt","original_title":"Queima do Judas","overview":"","popularity":0.296,"poster_path":"/8tiRsZHNkjJ5qkS7kVEfchelsU0.jpg","release_date":"2024-08-04","title":"Queima do Judas","video":false,"vote_average":10.0,"vote_count":1,"credit_id":"673b6112dc4bbc01c691eb7f","department":"Camera","job":"Camera Operator","media_type":"movie"},{"adult":false,"backdrop_path":"/xDBzSpS7WR2GgiQgo14mn7iz0dx.jpg","genre_ids":[35,27,53],"id":1389769,"original_language":"pt","original_title":"A Noite do Terror!","overview":"","popularity":1.582,"poster_path":"/zndvjKahjRkXdCYMZiLg3JZFZeQ.jpg","release_date":"2024-10-31","title":"A Noite do Terror!","video":false,"vote_average":10.0,"vote_count":1,"credit_id":"673b661674a2e6e0237b6984","department":"Camera","job":"Camera Operator","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'] ?? [];