popcorn-api icon indicating copy to clipboard operation
popcorn-api copied to clipboard

Include themoviedb ids and cast / credits?

Open jakewaterman51 opened this issue 6 years ago • 0 comments

I'm currently manually using "themoviedb" to make 2 request:

  1. Convert the IMDB ID to a TMDB ID.
  2. Use the TMDB ID to get the directors, writers, creators & cast etc...

Each request takes over a second so it really adds up.

There's no way around that first request but the second one I can do in parallel with the popcorn api request so it's not really a problem.

Alternatively also adding the credits from themoviedb to popcorn api.

A basic PHP example for getting a TMDB ID using an IMDB ID:

$response = file_get_contents("https://api.themoviedb.org/3/find/".$imdb_id."?".http_build_query(array(
	"api_key" => $access_key,
	"language" => "en-US",
	"external_source" => "imdb_id"
)));

if ($section == "movies" && !empty($response->movie_results)) {
	return $response->movie_results[0]->id;
} else if ($section == "shows" && !empty($response->tv_results)) {
	return $response->tv_results[0]->id;
} else {
	return false;
}

jakewaterman51 avatar May 14 '18 14:05 jakewaterman51