Youtube签名问题与一些视频

时间:2017-05-08 05:45:51

标签: php video youtube youtube-data-api

当我尝试使用PHP从localhost生成视频下载URL时,它可以在所有视频中自动创建签名。但是当我将我的代码发送到服务器试图生成下载URL(对于相同的视频)时,它没有给Signature提供相同的视频。它为什么会发生?如果视频可以在localhost上创建签名,为什么不在服务器上?究竟是什么错误的?我有点卡住了。

$id = $_GET['id']; //The youtube video ID

parse_str(file_get_contents('http://www.youtube.com/get_video_info?video_id='.$id.'&sts=&asv=3&el=detailpage'),$info); 
$streams = explode(',',$info['url_encoded_fmt_stream_map']); 
parse_str($streams[0], $str);

echo $str['url'];

0 个答案:

没有答案