【发布时间】:2015-11-23 14:35:40
【问题描述】:
当我将视频上传到 Google 云端硬盘时,它会转换为多种质量并可以通过 youtube 播放器进行流式传输 我的问题是如何使用 php 获取不同质量的直接视频网址。
到目前为止,我尝试使用 file_get_contents,播放器页面并尝试像这样解析代码
$browser = $_SERVER['HTTP_USER_AGENT'];
$options = array('http' => array('user_agent' => $browser));
$context = stream_context_create($options);
$page= file_get_contents($link, false, $context);
$h= explode('"22|',$page);
$h1=$h[1];
$h2=explode(',',$h1);
$hd=$h2[0];
$hdsrc = str_replace('\u003d', '=', $hd);
$hdsrc = str_replace('\u0026', '&', $hdsrc);
$hdsrc = str_replace('%2C', '&', $hdsrc);
$hdsrc = str_replace('\\', '', $hdsrc);
我得到了长网址 xxxxxx.googlevideo.......
但是不能玩!! 任何想法如何获得不同质量的直接视频网址。
PS:我知道直接下载链接,我想要转换后的质量网址。
谢谢
【问题讨论】:
标签: php google-drive-api drive