Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/6w4jiiC5PJN4sFjfCRTwkQ0tv5P.jpg","genre_ids":[10770,9648,53,18,80],"id":879818,"original_language":"en","original_title":"A Professor's Vengeance","overview":"When Nicole Atkins returns to graduate school, a previous affair with a married professor is the last thing on her mind. However, someone else on campus has his eye on Nicole, someone who knows all her secrets.","popularity":4.716,"poster_path":"/6sQQBBHhbAPzqnpzejp6xwaTjNX.jpg","release_date":"2021-09-26","title":"A Professor's Vengeance","video":false,"vote_average":6.7,"vote_count":12,"character":"Brandon Davis","credit_id":"6471747b9408ec00c28e23f4","order":3,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,53],"id":985650,"original_language":"en","original_title":"He's Gone","overview":"An 8 year old boy goes missing, its been a year since anyone has seen him... except for the man who took him.","popularity":0.028,"poster_path":"/ilHRoKElGLOnkwbl5kNpVk1TUPV.jpg","release_date":"2016-08-28","title":"He's Gone","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"64de8284d100b614b15a4ed5","order":1,"media_type":"movie"},{"adult":false,"backdrop_path":"/rmNXzt6shUQXJEQpKjxLkZwTZoV.jpg","genre_ids":[28,10752],"id":580431,"original_language":"en","original_title":"Point Man","overview":"A trio of soldiers vow revenge on their platoon when they are left behind enemy lines. When they come across a missing contingent in a Vietnamese village, alliances dissolve and each step forward will come with a price.","popularity":3.356,"poster_path":"/ynjQ0JRs07AZ3zckAazTmYurJ8o.jpg","release_date":"2018-11-09","title":"Point Man","video":false,"vote_average":6.2,"vote_count":16,"character":"Lieutenant Marsh","credit_id":"5f032ffa11c0660039b583c0","order":29,"media_type":"movie"},{"adult":false,"backdrop_path":"/26bcWR5GBpeQVgFuwETmk8NJilL.jpg","genre_ids":[35],"id":155772,"origin_country":["US"],"original_language":"en","original_name":"Rap Sh!t","overview":"Two estranged high school friends from Miami reunite to form a rap group.","popularity":22.119,"poster_path":"/vHkgTxk0YE94AiQIbv8PfJGkxR2.jpg","first_air_date":"2022-07-21","name":"Rap Sh!t","vote_average":5.815,"vote_count":27,"character":"","credit_id":"62e07ee7bbcae000557938ef","episode_count":1,"media_type":"tv"},{"adult":false,"backdrop_path":"/1EfNeTDYlJKGGQptvqibsh6Dan3.jpg","genre_ids":[18],"id":90489,"origin_country":["US"],"original_language":"en","original_name":"David Makes Man","overview":"A 14-year-old prodigy's mother relies on him to find a way out of poverty, but he is haunted by the death of his friend; he must choose between the streets that raised him or the higher education that may offer him a way out.","popularity":7.71,"poster_path":"/a0FZ44UENaQ4aqtCq4zCTjiqe8H.jpg","first_air_date":"2019-08-14","name":"David Makes Man","vote_average":6.7,"vote_count":10,"character":"Ethan","credit_id":"62e07f741dbc880672d04e03","episode_count":1,"media_type":"tv"}],"crew":[{"adult":false,"backdrop_path":null,"genre_ids":[18,53],"id":985650,"original_language":"en","original_title":"He's Gone","overview":"An 8 year old boy goes missing, its been a year since anyone has seen him... except for the man who took him.","popularity":0.028,"poster_path":"/ilHRoKElGLOnkwbl5kNpVk1TUPV.jpg","release_date":"2016-08-28","title":"He's Gone","video":false,"vote_average":0.0,"vote_count":0,"credit_id":"64de8236d100b614b30071a5","department":"Writing","job":"Screenplay","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'] ?? [];