Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/nRG8pFaqrXwX0f4RE3HQoZ69HI9.jpg","genre_ids":[35],"id":329263,"original_language":"de","original_title":"Fack ju Göhte 2","overview":"Dissatisfied with his new work at the Goethe-Gesamtschule, Mr. Müller is tired of early mornings and correcting exams. Meanwhile, director Gerster strives to be a symbol of the new company. To do so, her attempts to improve the school's image involve revoking the partnership from the Schillergymnasium with a Thai school. In a last-ditch saving grace, Mr. Müller, Mrs. Schnabelstedt, and the 10b must take a trip to Thailand.","popularity":5.687,"poster_path":"/wbpmtx3XUZIwHA8sVqWpHyTIV0V.jpg","release_date":"2015-09-10","title":"Suck Me Shakespeer 2","video":false,"vote_average":6.4,"vote_count":936,"character":"Noel","credit_id":"56d07b559251413e6a006880","order":23,"media_type":"movie"},{"adult":false,"backdrop_path":"/lpOvK1dYq9fCkgI9TlsSjIAnGiC.jpg","genre_ids":[18],"id":301376,"original_language":"de","original_title":"Unter der Sonne","overview":"August 1984. During summer vacation Victor stays with his aunt and cousin. The incident at the bridge might not have happened, if it wasn't for his crush on his fifteen-year-old cousin Denise or his fear of the neighbors dog.","popularity":0.635,"poster_path":"/5kOGPfggIkQQiMWHQjwfylBJc8Q.jpg","release_date":"2006-01-25","title":"Under the Sun","video":false,"vote_average":5.6,"vote_count":5,"character":"Viktor","credit_id":"5a2246db92514103300ad56d","order":0,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[10770,10749,35],"id":109806,"original_language":"de","original_title":"Klick ins Herz","overview":"","popularity":1.069,"poster_path":"/hu7R7IUpQdEPGkxqOw9KGeAnrdd.jpg","release_date":"2009-11-23","title":"Klick ins Herz","video":false,"vote_average":5.4,"vote_count":5,"character":"Ben Schubert","credit_id":"5c1439c4c3a36866cc360145","order":5,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[80],"id":295927,"original_language":"de","original_title":"Tödlicher Rausch","overview":"","popularity":0.68,"poster_path":"/y2KDQVZcYbmbSBMWmmspYoBbZCd.jpg","release_date":"2011-12-11","title":"Tödlicher Rausch","video":false,"vote_average":2.0,"vote_count":1,"character":"Basti","credit_id":"5c62f7460e0a267dfd986694","order":11,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[80],"id":40627,"origin_country":["DE"],"original_language":"de","original_name":"Kommissarin Lucas","overview":"","popularity":15.714,"poster_path":"/xKBynIPwsGZr193yHpK1YSUL7a4.jpg","first_air_date":"2003-03-01","name":"Kommissarin Lucas","vote_average":5.7,"vote_count":3,"character":"Peter","credit_id":"60ce5afca199a600409982cd","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'] ?? [];