使用php脚本从youtube视频ID生成流网址。
这是我正在使用的链接:
http://www.youtube.com/get_video_info?el=detailpage&asv=3&video_id= {video_id}
我从此链接获取url_encoded_fmt_stream_map
并对其进行解码以获取网址。如果视频使用密码签名,则我将其解码并生成有效的网址。
它适用于除区域限制以外的所有情况。我的服务器位于美国,无法阻止美国的视频流。
例如:
该视频 https://www.youtube.com/watch?v=DrCI35uAqiw 在美国被屏蔽,因此我从get_video_info
收到此错误:
reason=This+video+contains+content+from+Wediacorp%2C+who+has+blocked+it+in+your+country+on+copyright+grounds.&errordetail=0&errorcode=150&status=fail
如果您有任何解决方案,请分享。
谢谢,
翔太。
最佳答案
免责声明:
You really should only use this method for accessing your own video file content (like if Youtube holds a backup copy). If you just take any multiple videos, you risk closing this option for all of us.
道德咆哮...
代替:http://www.youtube.com/get_video_info?el=detailpage&asv=3&video_id=video_id
尝试以下操作:http://www.youtube.com/get_video_info?&video_id=DrCI35uAqiw
关于php - 带有区域限制的YouTube流fmt_stream_map错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31957546/