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,36],"id":1133441,"original_language":"en","original_title":"The Marcus Garvey Story","overview":"Explore the tumultuous life of Marcus Mosiah Garvey Jr., a Jamaican political activist and advocate for Black Nationalism. From founding UNIA-ACL and finding prosperity through economic ventures to navigating financial hardships, assassination attempts, and politically motivated criminal charges, Garvey's impactful odyssey throughout Jamaica and America left an enduring imprint on history.","popularity":2.592,"poster_path":"/oMeD5XFzEJjvyEKpmTCcMf05b3t.jpg","release_date":"","title":"The Marcus Garvey Story","video":false,"vote_average":0.0,"vote_count":0,"character":"Amy Ashwood Garvey","credit_id":"659c22472dc44e0256e63437","order":11,"media_type":"movie"},{"adult":false,"backdrop_path":"/5B4V8KINcjbMHFHEevxHo65UBAR.jpg","genre_ids":[27,35],"id":1031441,"original_language":"en","original_title":"Campsite Killer","overview":"Jessica is watching a movie with her new boyfriend Chad, while a serial killer is on the loose in town. Could Chad be the killer? That's what Jessica’s best friend Bradley tries to warn her about, interfering with her date at every step. As for Chad, he's really interested in taking Jessica camping for the weekend.","popularity":1.171,"poster_path":"/niWksa61fB5wypOcMrjmu1WcQGE.jpg","release_date":"2012-10-22","title":"Campsite Killer","video":false,"vote_average":7.0,"vote_count":1,"character":"Jessica","credit_id":"633b5fe415794a0092672b44","order":1,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,9648],"id":315537,"original_language":"en","original_title":"Prism","overview":"A troubled young man's father resurfaces fifteen years after his unexplained disappearance, forcing the son to piece together a disjointed past that could destroy what's left of his fragile sanity.","popularity":2.84,"poster_path":"/kEjGDF9vPlriusVkZKQwrqVy7ZV.jpg","release_date":"2015-04-04","title":"Prism","video":false,"vote_average":7.7,"vote_count":3,"character":"Anne","credit_id":"55d431ec92514102d8001446","order":10,"media_type":"movie"},{"adult":false,"backdrop_path":"/1Jb4mIgSUQmQQTxzT1ZGDbhJ0k4.jpg","genre_ids":[35],"id":103679,"origin_country":["US"],"original_language":"en","original_name":"Keeping It 100","overview":"A comedy about 4 girlfriends, from different worlds who keep it 100 percent real about men, sex, love, and the every day struggles of life in L.A.. No censors, no filters, and no apologies.","popularity":7.526,"poster_path":"/yiMKzx2iAAulBNaxrTkoHqtkMOr.jpg","first_air_date":"2016-07-03","name":"Keeping It 100","vote_average":0.0,"vote_count":0,"character":"Tina","credit_id":"5ec43db2e635710022ca8ae7","episode_count":12,"media_type":"tv"}],"crew":[{"adult":false,"backdrop_path":"/5B4V8KINcjbMHFHEevxHo65UBAR.jpg","genre_ids":[27,35],"id":1031441,"original_language":"en","original_title":"Campsite Killer","overview":"Jessica is watching a movie with her new boyfriend Chad, while a serial killer is on the loose in town. Could Chad be the killer? That's what Jessica’s best friend Bradley tries to warn her about, interfering with her date at every step. As for Chad, he's really interested in taking Jessica camping for the weekend.","popularity":1.171,"poster_path":"/niWksa61fB5wypOcMrjmu1WcQGE.jpg","release_date":"2012-10-22","title":"Campsite Killer","video":false,"vote_average":7.0,"vote_count":1,"credit_id":"633b5bebcfe48f0092db446f","department":"Writing","job":"Writer","media_type":"movie"},{"adult":false,"backdrop_path":"/1Jb4mIgSUQmQQTxzT1ZGDbhJ0k4.jpg","genre_ids":[35],"id":103679,"origin_country":["US"],"original_language":"en","original_name":"Keeping It 100","overview":"A comedy about 4 girlfriends, from different worlds who keep it 100 percent real about men, sex, love, and the every day struggles of life in L.A.. No censors, no filters, and no apologies.","popularity":7.526,"poster_path":"/yiMKzx2iAAulBNaxrTkoHqtkMOr.jpg","first_air_date":"2016-07-03","name":"Keeping It 100","vote_average":0.0,"vote_count":0,"credit_id":"5ec44c5b8e2e0000212095df","department":"Writing","episode_count":12,"job":"Writer","media_type":"tv"},{"adult":false,"backdrop_path":"/1Jb4mIgSUQmQQTxzT1ZGDbhJ0k4.jpg","genre_ids":[35],"id":103679,"origin_country":["US"],"original_language":"en","original_name":"Keeping It 100","overview":"A comedy about 4 girlfriends, from different worlds who keep it 100 percent real about men, sex, love, and the every day struggles of life in L.A.. No censors, no filters, and no apologies.","popularity":7.526,"poster_path":"/yiMKzx2iAAulBNaxrTkoHqtkMOr.jpg","first_air_date":"2016-07-03","name":"Keeping It 100","vote_average":0.0,"vote_count":0,"credit_id":"5ec44a1a37b3a90021199fac","department":"Creator","job":"Creator","media_type":"tv"}]}}
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'] ?? [];