Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/o4PZDAsrMy0Gsxuybe5EHj0vjPM.jpg","genre_ids":[18,10752],"id":38379,"original_language":"pl","original_title":"Austeria","overview":"During a pogrom in Poland on the eve of World War I, a group of Jews seek refuge from the Cossacks. The fugitives hide out in a rural inn, terrified that they may be given away at any moment.","popularity":4.939,"poster_path":"/w1wtxV7MWCnsTEqahwiADEu4z52.jpg","release_date":"1983-03-28","title":"Austeria","video":false,"vote_average":6.8,"vote_count":18,"character":"Hasid","credit_id":"638640731b157d00b7877c38","order":31,"media_type":"movie"},{"adult":false,"backdrop_path":"/5ymJuqUWwQZ7yq63UE8DNpFBELr.jpg","genre_ids":[10752,18,53],"id":336050,"original_language":"hu","original_title":"Saul fia","overview":"In the horror of 1944 Auschwitz, a prisoner forced to burn the corpses of his own people finds moral survival trying to save from the flames the body of a boy he takes for his son, seeking to give him a proper jewish burial.","popularity":15.399,"poster_path":"/9ZcX6NjCJam5uwkooXffhHI29Lj.jpg","release_date":"2015-06-11","title":"Son of Saul","video":false,"vote_average":7.2,"vote_count":1056,"character":"Rabbi Frankel","credit_id":"5ba6b80dc3a3680e500188da","order":4,"media_type":"movie"},{"adult":false,"backdrop_path":"/nHEfc1ukpsYMmILr79QrClYNma.jpg","genre_ids":[18,10752],"id":73686,"original_language":"de","original_title":"In Darkness","overview":"A dramatization of one man's rescue of Jewish refugees in the Nazi-occupied Polish city of Lvov. In Darkness tells the true story of Leopold Soha who risks his own life to save a dozen people from certain death. Initially only interested in his own good, the thief and burglar hides Jewish refugees for 14 months in the sewers of the Nazi-occupied town of Lvov (formerly Poland).","popularity":17.374,"poster_path":"/cRm30D0tBvMLXjtoKuaUteBZ4nv.jpg","release_date":"2011-09-15","title":"In Darkness","video":false,"vote_average":6.984,"vote_count":182,"character":"Jacob Berestycki","credit_id":"5ba6b8d4c3a3680e5801666b","order":7,"media_type":"movie"}],"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'] ?? [];