我已经将json解码为php数组:
$text = "http://www.youtube.com/watch?v=i62Zjga8JOM";
$last_url = "http://youtubeinmp3.com/fetch/?format=JSON&video=".$text;
$mp3_url = file_get_contents($last_url);
$var = json_decode($mp3_url, true);
$echo $var['link'];
不显示此格式的链接:
https://www.youtubeinmp3.com/download/get/?i=BUuT86WbAYpsj2zvLfkSb2%2BrQxjGl0bRMwnZiGFPR6pXuO1FXOec0doOUcihuH1yTinl2YgaypX3nnsahxx5KA%3D%3D
如果您打开此网址,则会下载文件。但在这个代码上它只显示s链接而不是内容! 我怎么能这样做?
答案 0 :(得分:0)
$text = "http://www.youtube.com/watch?v=i62Zjga8JOM";
$last_url = "http://youtubeinmp3.com/fetch/?format=JSON&video=".$text;
$mp3_url = file_get_contents($last_url);
$var = json_decode($mp3_url, true);
echo "<audio src=".$var['link']." controls></audio>";