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,10402],"id":776896,"original_language":"es","original_title":"Un blues para Teherán","overview":"Different faces show us an Iran where tradition and modernity coexist and confront each other. Erfan Shafei invites us to discover a country through its music and its people. Erfan is a funny and ironic young Kurdish man who wants to become a film director. He sings, writes poetry, lives with his parents and his parrot, but knows nothing about love...","popularity":2.001,"poster_path":"/lfdpfzTBBQjCzmfVSySq7zNLdje.jpg","release_date":"2020-11-26","title":"Tehran Blues","video":false,"vote_average":0.0,"vote_count":0,"character":"","credit_id":"5fda7d76706e56003fd29ace","order":3,"media_type":"movie"}],"crew":[{"adult":false,"backdrop_path":"/cViRWiAgkXcgeIU0PZ46xLNzYXn.jpg","genre_ids":[27,18],"id":1143863,"original_language":"fa","original_title":"شین","overview":"Noushin has returned to Iran after years, upon a request by her severely ill father to find a person that he needs to see. Her father finds this visit the most important duty of his life before passing away. Sheen is about a family secret that has been kept for many years. Shirin, the house maid’s daughter while playing with the owners’ children in the old house, falls in the well in the middle of the yard. Her body was never recovered. Her mother was pushed out of the house. They covered the well and abandoned the house. The family members encountered many unfortunate events throughout the years and didn’t have a happy life. They have returned to ask for forgiveness from a woman who lost her child.","popularity":0.001,"poster_path":"/78gGPpYlAayBIKf5q5RJkI333E7.jpg","release_date":"","title":"Sheen","video":false,"vote_average":0.0,"vote_count":0,"credit_id":"6694d0e20053f970c8899fa7","department":"Directing","job":"Director","media_type":"movie"},{"adult":false,"backdrop_path":"/cViRWiAgkXcgeIU0PZ46xLNzYXn.jpg","genre_ids":[27,18],"id":1143863,"original_language":"fa","original_title":"شین","overview":"Noushin has returned to Iran after years, upon a request by her severely ill father to find a person that he needs to see. Her father finds this visit the most important duty of his life before passing away. Sheen is about a family secret that has been kept for many years. Shirin, the house maid’s daughter while playing with the owners’ children in the old house, falls in the well in the middle of the yard. Her body was never recovered. Her mother was pushed out of the house. They covered the well and abandoned the house. The family members encountered many unfortunate events throughout the years and didn’t have a happy life. They have returned to ask for forgiveness from a woman who lost her child.","popularity":0.001,"poster_path":"/78gGPpYlAayBIKf5q5RJkI333E7.jpg","release_date":"","title":"Sheen","video":false,"vote_average":0.0,"vote_count":0,"credit_id":"6694d0fa27501d1f22bac1cf","department":"Sound","job":"Music","media_type":"movie"},{"adult":false,"backdrop_path":"/cViRWiAgkXcgeIU0PZ46xLNzYXn.jpg","genre_ids":[27,18],"id":1143863,"original_language":"fa","original_title":"شین","overview":"Noushin has returned to Iran after years, upon a request by her severely ill father to find a person that he needs to see. Her father finds this visit the most important duty of his life before passing away. Sheen is about a family secret that has been kept for many years. Shirin, the house maid’s daughter while playing with the owners’ children in the old house, falls in the well in the middle of the yard. Her body was never recovered. Her mother was pushed out of the house. They covered the well and abandoned the house. The family members encountered many unfortunate events throughout the years and didn’t have a happy life. They have returned to ask for forgiveness from a woman who lost her child.","popularity":0.001,"poster_path":"/78gGPpYlAayBIKf5q5RJkI333E7.jpg","release_date":"","title":"Sheen","video":false,"vote_average":0.0,"vote_count":0,"credit_id":"6694d12015f4510e915f652a","department":"Writing","job":"Writer","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'] ?? [];