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,10770],"id":421389,"original_language":"sh","original_title":"Adam i Eva","overview":"A TV film based on single act drama written by Miroslav Krleza, that belongs to his expressionist phase. It was first published in 1922, and then regularly as a part of collection of plays called \"Legends\". By giving them this primordial biblical names, in this drama Krleza speaks about the intricate relation between two lovers, while interweaving reality and unreality, giving wider context of human relations to everything.","popularity":1.189,"poster_path":null,"release_date":"1969-04-06","title":"Adam and Eve","video":false,"vote_average":0.0,"vote_count":0,"character":"Mladić","credit_id":"58023a4e9251417c90001758","order":5,"media_type":"movie"},{"adult":false,"backdrop_path":"/AvPIyRFWpQkZIvxOOmKGmajNADb.jpg","genre_ids":[18],"id":233290,"origin_country":["YU"],"original_language":"sh","original_name":"Sam čovjek","overview":"An adaptation of Ivo Kozarčanin's novel of the same name and consists of four episodes. The protagonist is a young official named Valentin, and the plot shows his childhood, growing up and a disastrous marriage that will end in murder.","popularity":4.323,"poster_path":"/4JXx8lW6xWAFOzIX8G7wIgxIHq4.jpg","first_air_date":"1970-05-13","name":"The Man Himself","vote_average":0.0,"vote_count":0,"character":"","credit_id":"66f957eb393cda1d1dcc4f90","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'] ?? [];