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,53,10770],"id":321843,"original_language":"en","original_title":"Unfair Exchanges","overview":"Julie Walters stars as a single mother seemingly haunted by a sinister telephone system that seems to have become an evil intelligence in its own right.","popularity":1.584,"poster_path":"/bD1046pGFGJT9CgohQBrQUQieml.jpg","release_date":"1985-01-20","title":"Unfair Exchanges","video":false,"vote_average":0.0,"vote_count":0,"character":"Dad's Neighbour","credit_id":"613d0376f96a3900435e630a","order":18,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,10749,10770],"id":364642,"original_language":"en","original_title":"Afternoon Off","overview":"Lee, a Chinese man, works as a waiter in a hotel in England, despite speaking very little English. Told that a girl called Iris might be interested in him, on his afternoon off work he buys a box of chocolates and sets off to find her.","popularity":1.676,"poster_path":"/lpPNcQSPNlIQBultYIBCEBdl7nI.jpg","release_date":"1979-02-03","title":"Afternoon Off","video":false,"vote_average":0.0,"vote_count":0,"character":"Old Iris","credit_id":"56263f569251413bda002a87","order":29,"media_type":"movie"},{"adult":false,"backdrop_path":"/vFbaEJ0s2u1ypWztL8hJHWSkpaQ.jpg","genre_ids":[18],"id":48151,"original_language":"en","original_title":"The Terence Davies Trilogy","overview":"In stark black and white, Terence Davies excavates the life of his fictional alter ego, Robert Tucker, in a narrative that slips between childhood, middle age and death, shaping the raw materials of his own life into a rich tapestry of experiences and impressions.","popularity":1.745,"poster_path":"/pTo1YoXi2zVZFqLg1JVJUTnDmet.jpg","release_date":"1983-11-01","title":"The Terence Davies Trilogy","video":false,"vote_average":6.3,"vote_count":15,"character":"","credit_id":"5886165bc3a3681de00004ea","order":26,"media_type":"movie"},{"adult":false,"backdrop_path":"/u8Axl8BaLRoFUhD9HSXLKg6Zijy.jpg","genre_ids":[18],"id":48143,"original_language":"en","original_title":"Death and Transfiguration","overview":"A British man on his deathbed recalls moments from his life.","popularity":1.328,"poster_path":"/8B2uFbr0zd2yNuns1rthMpNXJZV.jpg","release_date":"1983-06-22","title":"Death and Transfiguration","video":false,"vote_average":5.9,"vote_count":22,"character":"","credit_id":"588612a39251413b78000025","order":3,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[35,18,10770],"id":339482,"original_language":"en","original_title":"Intensive Care","overview":"When Denis Midgley's father is rushed to hospital, Midgley drops everything to be by his side. They've never really got on, so Midgley wants to be sure he's there if his father ever regains consciousness. As he hates his job as a schoolteacher, and his home-life with his wife, her senile mother and their insolent teenage son, he has no qualms about lingering around the hospital. But as days turn into weeks, his father obstinately refuses to 'slip away', and Denis' motivation for staying by his father's bedside has more and more to do with Valery, a young nurse.","popularity":1.142,"poster_path":null,"release_date":"1982-11-09","title":"Intensive Care","video":false,"vote_average":0.0,"vote_count":0,"character":"Joyce's Mother","credit_id":"5b33f02f9251413c8e01a812","order":9,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,10770],"id":757994,"original_language":"en","original_title":"Kate: The Good Neighbour","overview":"Kate lives fiercely alone, cut off the from present and haunted by the memories of grief from her past.","popularity":0.638,"poster_path":"/vFUp6tlv5TyTP7Ic52sImazd76S.jpg","release_date":"1980-03-06","title":"Kate: The Good Neighbour","video":false,"vote_average":0.0,"vote_count":0,"character":"Mrs. Lewis","credit_id":"5f984d57d2f5b5003b7f78f4","order":16,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,10770],"id":380615,"original_language":"en","original_title":"Through the Night","overview":"The play tells the story of Christine Potts, who undergoes an unexpected mastectomy, and struggles to cope with the aftermath and the deficiencies of her post-operative care.","popularity":1.12,"poster_path":"/hRcqdiOqgPFrcB6RDGSOJOJIt3i.jpg","release_date":"1975-12-02","title":"Through the Night","video":false,"vote_average":0.0,"vote_count":0,"character":"Joan","credit_id":"6095dc307f0540003bbc63cc","order":29,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18,10770],"id":522508,"original_language":"en","original_title":"Waterloo Sunset","overview":"Grace leaves her old folks' home to return to her birthplace in Lambeth, a place which has changed on the surface but at its heart is still the same.","popularity":0.497,"poster_path":"/qIA8HHEseBJkU1umbWnUC84dF5P.jpg","release_date":"1979-01-23","title":"Waterloo Sunset","video":false,"vote_average":0.0,"vote_count":0,"character":"Woman in Pub","credit_id":"612d3cd5e8a3e1002c6f9551","order":14,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[],"id":1362333,"original_language":"en","original_title":"Rolling Home","overview":"Mr Wyman is an elderly man whose increasingly unreliable memory has landed him in a geriatric ward. Here he is visited by his daughters Val and Molly, and Molly's husband Harold, and looked after by the ward's two male nurses, Vic and Donald, who are in competition for a promotion. Donald needs the money as he and his girlfriend are trying to buy a house but are having difficulty arranging a mortgage. From the window at which he sits, Mr Wyman can see a wall. He repeatedly pesters Donald with questions about what is on the other side. Donald constructs a fantasy of the future he dreams of with his girlfriend: a house and garden inhabited by a married couple.","popularity":0.536,"poster_path":"/qunOytoA7lCfMSmEVjvL7PpyTPg.jpg","release_date":"1982-12-03","title":"Rolling Home","video":false,"vote_average":0.0,"vote_count":0,"character":"Alice","credit_id":"66f5a839773f0a7aa5d5d368","order":5,"media_type":"movie"},{"adult":false,"backdrop_path":"/9cdqi5kNHWpdrRScaUjdVkzuqUB.jpg","genre_ids":[18],"id":9653,"origin_country":["GB"],"original_language":"en","original_name":"Bill Brand","overview":"Following the death of the sitting Labour Party Member of Parliament, Bill Brand is selected as Labour candidate for a Lancashire textile constituency.","popularity":6.055,"poster_path":"/vk68e644fcf8RzPbICqempdp1Xi.jpg","first_air_date":"1976-06-07","name":"Bill Brand","vote_average":6.3,"vote_count":3,"character":"Gladys","credit_id":"5b35b44c0e0a264004027d05","episode_count":1,"media_type":"tv"},{"adult":false,"backdrop_path":"/z8XHFzalmC9vcpk57DUZW95LO0.jpg","genre_ids":[18],"id":47991,"origin_country":["GB"],"original_language":"en","original_name":"Objects of Affection","overview":"A series of plays written by Alan Bennett.","popularity":4.669,"poster_path":"/cdtA5NQnZWn5rpew43hshtQo4vE.jpg","first_air_date":"1982-11-12","name":"Objects of Affection","vote_average":7.0,"vote_count":1,"character":"Alice","credit_id":"5e82caf504b5960017928961","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'] ?? [];