Tmdb Client Error: {"success":false,"status_code":11,"status_message":"Internal error: Something went wrong, contact TMDb.","combined_credits":{"cast":[{"adult":false,"backdrop_path":"/ghIF9txDO8mXGQIhuzSLSzlnSvh.jpg","genre_ids":[35,18],"id":685691,"original_language":"es","original_title":"Bardo, falsa crónica de unas cuantas verdades","overview":"A renowned Mexican journalist and documentary filmmaker living in Los Angeles, after being named the recipient of a prestigious international award, is compelled to return to his native country, unaware that this simple trip will push him to an existential limit.","popularity":7.976,"poster_path":"/3e6RA0CzFDC0pz5TqiRlbHcsc2n.jpg","release_date":"2022-10-27","title":"BARDO, False Chronicle of a Handful of Truths","video":false,"vote_average":6.954,"vote_count":218,"character":"Carlos Ex colega","credit_id":"61f28e303009aa00ddeed3a9","order":22,"media_type":"movie"},{"adult":false,"backdrop_path":"/ueX7WcPY9sqGLLXdqOWF6ziNmPO.jpg","genre_ids":[27,18],"id":153853,"original_language":"es","original_title":"Halley","overview":"Alberto is dead and can no longer hide it. Make-up and perfume can no longer conceal his quickly decomposing body. Dismayed, he decides to withdraw from the world, whilst forming an unusual friendship with Luly, the manager of the 24-hour gym where he works as a night guard.","popularity":2.729,"poster_path":"/x9BdxHvWnAYkjnYrBoDF77IzwkA.jpg","release_date":"2012-11-01","title":"Halley","video":false,"vote_average":5.6,"vote_count":25,"character":"Mortuario","credit_id":"52fe4b4e9251416c910d63bd","order":2,"media_type":"movie"},{"adult":false,"backdrop_path":"/4fMatdLEIgBuqzHXRkLh2KyVaZL.jpg","genre_ids":[18,53],"id":296865,"original_language":"es","original_title":"Un monstruo de mil cabezas","overview":"When Sonia receives the news that her husband’s cancer has progressed to a critical stage, she races to secure the insurance company’s approval for the care that can help him.","popularity":2.457,"poster_path":"/wToNyO8nPExJGcIEryIj0EEuW3Z.jpg","release_date":"2016-03-30","title":"A Monster with a Thousand Heads","video":false,"vote_average":6.1,"vote_count":32,"character":"Dr. Villalba","credit_id":"54372bb60e0a264a45000243","order":4,"media_type":"movie"},{"adult":false,"backdrop_path":"/sV3ppBVY93GqcWOXypLK0qFS9XJ.jpg","genre_ids":[80],"id":1216625,"original_language":"es","original_title":"Blanca","overview":"","popularity":0.598,"poster_path":"/cuMequxMEXPP4iiqibVPNMvdfzK.jpg","release_date":"2019-05-29","title":"Blanca","video":false,"vote_average":8.0,"vote_count":1,"character":"El Patrón","credit_id":"6577b5b74bfa5400e1561130","order":5,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[18],"id":337467,"original_language":"es","original_title":"Rogelio","overview":"A tragicomic short film imbued with magical realism that revolves around the theme of death, focusing specifically on the Mexican people's bond with the departed.","popularity":0.853,"poster_path":null,"release_date":"2000-01-01","title":"Rogelio","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"553cfed192514114350016ae","order":0,"media_type":"movie"},{"adult":false,"backdrop_path":"/yh3xhoyFdVeIuGdYALgvKTkf3Gq.jpg","genre_ids":[18],"id":75945,"original_language":"es","original_title":"La Otra Familia","overview":"Jean Paul and Chema have been together ten years. They have successful careers, a comfortable home and many friends. But that's all turned turned upside down when close friend Ivana rescues Hendrix from his broken home and asks them to care for the boy. Hendrix's mother Nina is a drug addict who suffers at the hands of her abusive partner Patrick. The men begin to consider making Hendrix part of their family.","popularity":3.503,"poster_path":"/21O9EFTizcWKDndzxaNXQHf5u72.jpg","release_date":"2011-03-25","title":"The Other Family","video":false,"vote_average":6.4,"vote_count":22,"character":"Guardia Centro Rehabilitación","credit_id":"66d269e2a79ddc5fac456416","order":14,"media_type":"movie"},{"adult":false,"backdrop_path":"/AxFbxju0j5D0fEezeK5gLS1Fj1.jpg","genre_ids":[18,27,9648],"id":387827,"original_language":"es","original_title":"Tiempo compartido","overview":"While staying at a tropical resort, a man becomes convinced the American timeshare company running it has an evil plan to take away his loved ones.","popularity":5.389,"poster_path":"/jWwLENF11LVApfrCxjuG936cnID.jpg","release_date":"2018-08-02","title":"Time Share","video":false,"vote_average":5.6,"vote_count":62,"character":"Moises","credit_id":"5a89f0a5c3a36862a7066794","order":7,"media_type":"movie"},{"adult":false,"backdrop_path":"/bQI85ouoSyFozoMcUUTCOOGZ1fY.jpg","genre_ids":[18],"id":71277,"original_language":"es","original_title":"El búfalo de la noche","overview":"Unable to cope with the fact that his girlfriend cheated on him with his best friend, a 22-year-old schizophrenic sets an elaborate revenge plan into motion before taking his own life.","popularity":2.791,"poster_path":"/z9MCUZPV9CRPkNNJDw04hCM0ysC.jpg","release_date":"2007-01-20","title":"The Night Buffalo","video":false,"vote_average":4.8,"vote_count":18,"character":"Pánfilo","credit_id":"5ef305cf6beaea003353549f","order":13,"media_type":"movie"},{"adult":false,"backdrop_path":"/SZmqlD4JEi2EY8XZuaMb0cC7cm.jpg","genre_ids":[],"id":744034,"original_language":"es","original_title":"Así en la Tierra","overview":"After losing his harvest when a meteorite crashes on his farm and at risk of losing his land to a ruthless loan shark, Salvador conspires with the local priest to profit from the townspeople's blind faith by tricking them into believing that the rock is a sign from God.","popularity":0.95,"poster_path":"/u9WqyNtmqMlmjOr1DTHwEQ2HHSA.jpg","release_date":"2020-09-21","title":"Así en la Tierra","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"5f63c3096a2227003a817461","order":1,"media_type":"movie"},{"adult":false,"backdrop_path":null,"genre_ids":[],"id":477021,"original_language":"en","original_title":"Outlaws","overview":"A surreal film within a film about a mysterious drifter and motorcycle stuntman who is hunted by a maniacal Director seeking revenge.","popularity":1.912,"poster_path":"/1fnjpWkB2Jeul0nSVbmrNgStzQx.jpg","release_date":"2015-09-22","title":"Outlaws","video":false,"vote_average":6.0,"vote_count":1,"character":"Circus boss","credit_id":"66e19909ecbf7f6f301c40a0","order":2,"media_type":"movie"},{"adult":false,"backdrop_path":"/pTCJDmLkGmSOLZDxDA4oDkQ6rxP.jpg","genre_ids":[35],"id":65792,"origin_country":["MX"],"original_language":"es","original_name":"El Albergue","overview":"Doña Caridad and Don Tranquilino are cared for by their only daughter, a woman in the middle of menopause who lives with her unfaithful husband.","popularity":7.56,"poster_path":"/8QN9gENkFt3l9RRvNmfIFkL8v85.jpg","first_air_date":"2012-03-12","name":"El Albergue","vote_average":0.0,"vote_count":0,"character":"Licenciado del Hoyo","credit_id":"64d3b09903726400adc5114a","episode_count":140,"media_type":"tv"},{"adult":false,"backdrop_path":"/fsbZAdbojecotA4mpdVOuehpdjO.jpg","genre_ids":[18,10766],"id":92433,"origin_country":["MX"],"original_language":"es","original_name":"La Usurpadora","overview":"A humble young woman allows herself be manipulated by her twin sister to replace her so she can leave with another man.","popularity":18.507,"poster_path":"/fnBu7Ym3WeMZy2goTl3c2YReVqE.jpg","first_air_date":"2019-09-02","name":"The Usurper","vote_average":6.9,"vote_count":315,"character":"Camacho","credit_id":"5d77407d5907de00112c2fd0","episode_count":3,"media_type":"tv"},{"adult":false,"backdrop_path":"/5XruzOFOJRsGW5Ul4VTb5kGAR3c.jpg","genre_ids":[18],"id":93297,"origin_country":["MX"],"original_language":"es","original_name":"Monarca","overview":"After 20 years, Ana María returns to Mexico and vies for control of her family's tequila empire as it threatens to crumble under corruption and secrets.","popularity":19.974,"poster_path":"/oXiTq8dm9ugYjLCKFDnLE4pRMGT.jpg","first_air_date":"2019-09-13","name":"Monarca","vote_average":7.5,"vote_count":134,"character":"Raymundo Martínez","credit_id":"5d7bc8f733ec260013806f9d","episode_count":2,"media_type":"tv"},{"adult":false,"backdrop_path":"/5gadCFtizbuoBXOXKwJIKsXpBN.jpg","genre_ids":[18],"id":255793,"origin_country":["MX"],"original_language":"es","original_name":"Tengo que morir todas las noches","overview":"Snapshot of the sophisticated and exclusive gay nightlife of one of the most emblematic clubs in 1980s’ Mexico City, where people living under the weight of a repressive society that marginalized them felt the need to express an exacerbated sense of freedom. Through the eyes of a young man eager to explore the world and live freely in the capital city, the series recreates a slice of life and a decade that shook the world.","popularity":19.162,"poster_path":"/oi8A9p0g6zjs33pswMGbBYlVP1D.jpg","first_air_date":"2024-06-07","name":"I Have to Die Every Night","vote_average":8.75,"vote_count":28,"character":"Agente Inmobiliario","credit_id":"666539a8847f0585fc9cf772","episode_count":8,"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'] ?? [];