如何将 TMDB ID 转换为 IMDB ID

How to convert TMDB ID to IMDB ID

这个APIurl:https://api.themoviedb.org/3/tv/1399?api_key=8d6d91941230817f7807d643736e8a49&append_to_response=external_ids 输出包含很多内容的 IMDB ID,包括这个结果:

{"imdb_id":"tt0944947","freebase_mid":"/m/0524b41","freebase_id":"/en/game_of_thrones","tvdb_id":121361,"tvrage_id":24493,"facebook_id":"GameOfThrones","instagram_id":"gameofthrones","twitter_id":"GameOfThrones"}}

我的文件中有此代码:

<?php
$values = info_movie_get_meta( 'ids' );



$seson = info_movie_get_meta( 'temporada' );
$epi = info_movie_get_meta( 'episodio' );

echo '<iframe src="https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id='.$values.'&tmdb=1&tv=1&s='.$seson.'&e='.$epi.'"height="100%"allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0"></iframe>';
?>

这里,$values = TMDB ID(我有TMDB ID需要IMDB),在我提供的API URL https://api.themoviedb.org/3/tv/1399?.... Here 1399 is TMDB ID,... So I will extract the IMDB ID from TMDB ID with this: https://api.themoviedb.org/3/tv/$values?.... 现在,我有这段代码: echo '<iframe src="https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id='.$values.'.....$values 的位置,我想插入 IMDB ID,....我有 TMDB ID,API 将 TMDB 转换为 IMDB,我有 IMDB ID JS 结果,所以我将如何在此处插入唯一的 IMDB ID:echo '<iframe src="https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id=imdbID,......

这很容易。只需获取 file_get_contents 或 CURL 之类的 link,然后使用 json_decode,您就可以访问 IMDB ID 作为变量。

$showID     =1399;
$url        ='https://api.themoviedb.org/3/tv/'.$showID.'?api_key=8d6d91941230817f7807d643736e8a49&append_to_response=external_ids';
$content    =file_get_contents($url,false);
$json       =json_decode($content,true);
$imdbID     =$json['external_ids']['imdb_id'];
$iframeURL  ='https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id='.$imdbID.'&tv=1&s='.$seson.'&e='.$epi;

来晚了,但可能会有帮助

https://api.themoviedb.org/3/movie/{movie_id}/external_ids?api_key=<<api_key>>