这个url: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 (我有需要IMDB的TMDB ID ),在我提供的API URL https://api.themoviedb.org/3/tv/1399上?这里1399是TMDB ID,...因此,我将使用以下命令从TMDB ID中提取IMDB ID:https://api.themoviedb.org/3/tv/$values?....现在,我有这样的代码:echo '<iframe src="https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id='.$values.'.....
代替$values
,我想插入IMDB,...我有TMDB ID,可以转换成TMDB to IMDB的接口,我在JS结果中有IMDB ID,那么我将如何在这里插入唯一的IMDB ID : echo '<iframe src="https://videospider.in/getvideo?key=Ez99ULqORLkSi7LH&video_id=imdbID,......
发布于 2021-03-05 16:39:27
这相当简单。只需抓取file_get_contents或CURL之类的链接,然后使用json_decode,您就可以将IMDB作为变量进行访问。
$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://stackoverflow.com/questions/59815357
复制相似问题