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":[99],"id":834928,"original_language":"ko","original_title":"N번방: 악의 평범성, 그리고 디지털 공간","overview":"This hour-long documentary explains what happened in the Nth room chat rooms, how girls fell prey to the perpetrators, and how the digital world and social media platforms provide an optimal environment for online sex offenses to take place.","popularity":0.736,"poster_path":"/8cr1DYr9Tcbkx49Qn1qUQ4Xc2jT.jpg","release_date":"2021-05-28","title":"The Nth Room case: The Making of a Monster","video":false,"vote_average":4.0,"vote_count":3,"character":"Victim","credit_id":"62b1ce4990cf5100630fcbbd","order":0,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[99],"id":834928,"original_language":"ko","original_title":"N번방: 악의 평범성, 그리고 디지털 공간","overview":"This hour-long documentary explains what happened in the Nth room chat rooms, how girls fell prey to the perpetrators, and how the digital world and social media platforms provide an optimal environment for online sex offenses to take place.","popularity":0.736,"poster_path":"/8cr1DYr9Tcbkx49Qn1qUQ4Xc2jT.jpg","release_date":"2021-05-28","title":"The Nth Room case: The Making of a Monster","video":false,"vote_average":4.0,"vote_count":3,"character":"Team Flame","credit_id":"62b1cf6fbf0f6305f6f8ee29","order":15,"media_type":"movie"},{"adult":false,"backdrop_path":"/omR72a5GQYY07YyNTw6Px8nY6HK.jpg","genre_ids":[18,35,10765],"id":209502,"origin_country":["KR"],"original_language":"ko","original_name":"오늘도 사랑스럽개","overview":"Hae-na who is bound to inherit her family curse which is turning into a dog after getting her first kiss. The only way to break the curse is to get a second kiss. The problem is the guy who gave Hae-na her first kiss is afraid of dogs.","popularity":36.2,"poster_path":"/yzrgREOGseOgCtPbfoE3uW9Xuvq.jpg","first_air_date":"2023-10-11","name":"A Good Day to be a Dog","vote_average":8.2,"vote_count":42,"character":"Teacher","credit_id":"6531a89348138200ff77b7a4","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'] ?? [];