本文整理汇总了PHP中getfile函数的典型用法代码示例。如果您正苦于以下问题:PHP getfile函数的具体用法?PHP getfile怎么用?PHP getfile使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetVid
function GetVid($url)
{
if (empty($url)) {
return false;
}
$geturl = getfile($url, 'http://video.sina.com.cn', null);
//手机版
preg_match('#ipad\\_vid\\:\'(.*?)\'#is', $geturl, $key_str);
//电脑版
if (empty($key_str[1])) {
preg_match('#vid\\:\'(.*?)\\|#is', $geturl, $key_str);
}
if (empty($key_str[1])) {
preg_match('#vid\\:\'(.*?)\'#is', $geturl, $key_str);
}
//新浪新闻
if (empty($key_str[1])) {
preg_match('#videoId\\:\'(.*?)\'#is', $geturl, $key_str);
}
//新浪娱乐
// if(empty($key_str[1]))preg_match('#CurrentPlayingVideo[\s]\=[\s](.*?)\'#is', $geturl, $key_str);
if (!empty($key_str[1])) {
$key = $key_str[1];
}
if (empty($key)) {
return false;
}
return $key;
}
示例2: GetVid
function GetVid($url)
{
if (empty($url)) {
return false;
}
$geturl = getfile($url, 'http://www.fun.tv', null);
//网址形式
preg_match('#\\"galleryid\\"\\:(.*?)\\,#is', $geturl, $key_str);
//网址形式
preg_match('#vplay\\.videoid[\\s]\\=[\\s](.*?)\\;#is', $geturl, $videoid);
// //电脑版
// if(empty($key_str[1]))preg_match('#vid\:\'(.*?)\|#is', $geturl, $key_str);
// if(empty($key_str[1]))preg_match('#vid\:\'(.*?)\'#is', $geturl, $key_str);
// //新浪新闻
// if(empty($key_str[1]))preg_match('#videoId\:\'(.*?)\'#is', $geturl, $key_str);
// //新浪娱乐
//// if(empty($key_str[1]))preg_match('#CurrentPlayingVideo[\s]\=[\s](.*?)\'#is', $geturl, $key_str);
if (!empty($key_str[1])) {
$key = $key_str[1];
}
if (!empty($videoid[1])) {
$key .= '_' . $videoid[1];
}
if (empty($key)) {
return false;
}
return $key;
}
示例3: GetVid
function GetVid($url)
{
if (empty($url)) {
return false;
}
preg_match("/\\/v\\/(.*?)\\//i", $url, $ketStr);
if (empty($ketStr)) {
for ($i = 0; $i < 3; $i++) {
$c = getfile($url, $url, null);
if ($c) {
break;
}
}
preg_match("/,vcode:[\\s]+\\'([X]{1}.*?)\\'/i", $c, $ketStr);
if (empty($ketStr)) {
preg_match("/,iid:[\\s]+([0-9]+)/i", $c, $ketStr);
}
}
if (!empty($ketStr[1])) {
$key = $ketStr[1];
}
if (empty($key)) {
return false;
}
return $key;
}
示例4: GetVid
function GetVid($url)
{
if (empty($url)) {
return false;
}
$key = '';
preg_match('/xiyou\\.cntv\\.cn\\/v-([0-9a-z-]+)\\.html/', $url, $keyStr);
if (!empty($keyStr[1])) {
$key = $keyStr[1];
}
if (!empty($key)) {
return $key;
}
for ($i = 0; $i < 3; $i++) {
$c = getfile($url, null, null);
if (!empty($c)) {
break;
}
}
preg_match('/contentid\\"[\\s]+content=\\"([0-9a-z]+)\\">/i', $c, $keyStr);
if (!empty($keyStr[1])) {
preg_match('/videoCenterId\\",\\"([0-9a-z]+)\\"/i', $c, $keyStr);
}
if (!empty($keyStr[1])) {
preg_match('/<!--repaste.video.code.begin-->([0-9a-z]+)<!--repaste.video.code.end-->/i', $c, $keyStr);
}
if (!empty($keyStr[1])) {
$key = $keyStr[1];
}
if (empty($key)) {
return false;
}
return $key;
}
示例5: GetVideo_HTML5
function GetVideo_HTML5($key, $hdstyle)
{
for ($i = 0; $i < 3; $i++) {
$c = getfile('http://m.yinyuetai.com/video/' . $key, 'http://m.yinyuetai.com', null);
preg_match('/videoUrl[\\s]:[\\s]\\"(.*?)\\",/', $c, $mp4);
if (empty($mp4[1])) {
preg_match('/window\\.location\\.herf[\\s]=[\\s]\\"(.*?)\\";/', $c, $mp4);
}
if (empty($mp4[1])) {
preg_match('/video[\\s]preload[\\s]controls[\\s]x-webkit-airplay=\\"allow\\" src=\\"(.*?)\\"/', $c, $mp4);
}
if (empty($mp4[1])) {
preg_match('/a class=\\"video-cover\\"[^>]*href=\\"(.*?)\\">/', $c, $mp4);
}
if (empty($mp4[1])) {
preg_match('/source src=\\"(.*?)\\"/', $c, $mp4);
}
if (!empty($mp4[1])) {
break;
}
}
if (!empty($mp4[1])) {
$video['data'][0]['src'] = $mp4[1];
}
return $video;
}
示例6: GetVideo_FLASH
function GetVideo_FLASH($key, $hdstyle)
{
$banben = date('Y-m-d');
//插件名字
$video['name'] = "☆解析插件-ku6系统☆-" . $banben;
//高清格式信息
$hdstr = array(1 => "normal", 2 => "clear", 3 => "super");
$video['Nowhds'] = $hdstyle >= 0 && $hdstyle < 4 ? $hdstyle : 3;
$video['mixhds'] = 3;
for ($i = 0; $i < 3; $i++) {
$info = getfile('http://v.ku6.com/fetchVideo4Player/' . $key . '.html', 'http://v.ku6.com', null);
if (!empty($info)) {
break;
}
}
$json = json_decode($info);
$data = $json;
if (!empty($data->data->t)) {
$video['subject'] = $data->data->t;
}
//
// $vtimems = $data->vtimems;
// $vtime = $data->vtime;
// $f = $data->f;
// $vtimems = explode(',',$vtimems);
// $vtime = explode(',',$vtime);
// $f = explode(',',$f);
// foreach ($vtime as $value1){
// $video['data'][$i]['bytes'] = $vtimems;
// $video['data'][$i]['duration'] = $vtime;
// $video['data'][$i]['src'] = $f;
// $i++;
// }
// if(!empty($vtimems))$video['data'][$i]['bytes'] = $vtimems;
// if(!empty($vtime))$video['data'][$i]['duration'] = $vtime;
// if(!empty($f))$video['data'][$i]['src'] = $f;
// $i++;
// if(!empty($vtime))$video['data'][$i]['duration'] = $vtime;
// if(!empty($f))$video['data'][$i]['src'] = $f;
// $data->data->vtime = explode(',',$data->data->vtime);
// $data->data->vtimems = explode(',',$data->data->vtimems);
$data->data->f = explode(',', $data->data->f);
$i = 0;
foreach ($data as $value) {
for ($i = 0; $i < count($value->f); $i++) {
// if(!empty($value->vtimems[$i]))$video['data'][$i]['bytes'] = $value->vtimems[$i];
// if(!empty($value->vtime[$i]))$video['data'][$i]['duration'] = $value->vtime[$i];
if (!empty($value->f[$i])) {
$video['data'][$i]['src'] = $value->f[$i];
}
// $i++;
}
}
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}
示例7: get_url_content
function get_url_content($url)
{
$data = getFileContents($url);
if ($data["state"] == "ok") {
return $data["file"];
} else {
return getfile($url);
}
}
示例8: Get_FLVCD
function Get_FLVCD($url, $hdstyle)
{
// HD Style Information
$hdstr = array(0 => "normal", 1 => "high", 2 => "super");
// --END-- HD Style Information
$video['Nowhds'] = $hds = $hdstyle >= 0 && $hdstyle < 3 ? $hdstyle : 2;
$video['mixhds'] = 3;
for ($i = 0; $i < 3; $i++) {
$data = getfile('http://www.flvcd.com/parse.php?kw=' . $url . '&format=' . $hdstr[$hds], 'http://www.flvcd.com/', null);
if (!empty($data)) {
break;
}
}
if (!empty($data)) {
$data = kms_iconv($data, 'GBK', 'UTF-8');
preg_match("/document.title[\\s]+=[\\s]+\"(.*?)\"/i", $data, $datarow);
if (empty($datarow[1])) {
preg_match("/hidden\"[\\s]+name=\"name\"[\\s]+value=\"(.*?)\"/i", $data, $datarow);
}
if (empty($datarow[1])) {
preg_match("/hidden\"[\\s]+name=\"filename\"[\\s]+value=\"(.*?)\"/i", $data, $datarow);
}
if (!empty($datarow[1])) {
$video['subject'] = $datarow[1];
}
preg_match("/<input[\\s]+type=\"hidden\"[\\s]+name=\"inf\"[\\s]+value=\"(.*?)\"\\/>/i", $data, $str);
if (empty($str[1])) {
preg_match_all("/<BR><a[\\s]+href=\"(.*?)\"/i", $data, $str2);
}
if (empty($str2[1]) && empty($str[1])) {
preg_match_all("/<a[\\s]+href=\"(.*?)\"[\\s]+target=\"_blank\"[\\s]+class=\"link/i", $data, $str2);
}
if (!empty($str)) {
$part = array_filter(explode("|", $str[1]), "strlen");
}
if (!empty($str2)) {
$part = array_filter($str2[1], "strlen");
}
if (empty($part)) {
return false;
}
$i = 0;
foreach ($part as $value) {
$video['data'][$i]['src'] = $value;
$i++;
}
}
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}
示例9: GetVideo_HTML5
function GetVideo_HTML5($key, $hdstyle, $userkey)
{
if (hostmd5key() != $userkey) {
$video['data'][0]['src'] = '对不起您的授权码错误,暂不能提供解析!';
return $video;
exit;
} else {
for ($i = 0; $i < 3; $i++) {
$token = getfile('http://api.lyhaoyu.cn/Index.php/Index/index/License/token/' . $userkey, '', null);
if (!empty($token)) {
break;
}
}
$token = json_decode($token);
$keytime = $token[0]->keytime;
if ($keytime <= date('Y-m-d')) {
$video['data'][0]['src'] = '对不起您的许可码已过期,暂不能提供解析!';
return $video;
exit;
}
$whtime = $token[0]->whtime;
$banben = "2015-04-24";
if ($whtime <= $banben) {
$video['data'][0]['src'] = '对不起您的维护期已过期,暂不能使用此版本!';
return $video;
exit;
}
}
// 插件名字
$video['name'] = "☆宁哥解析插件-bilibili系统☆";
//高清格式信息
$hdstr = array(0 => "720P", 1 => "350", 2 => "1080P", 3 => "1000");
$video['Nowhds'] = $hds = $hdstyle >= 0 && $hdstyle < 4 ? $hdstyle : 2;
$video['mixhds'] = 4;
//加载信息
$info = getfile('http://www.bilibili.com/m/html5?cid=' . $key, 'http://www.bilibili.com', null);
preg_match('#src\\"\\:\\"(.*?)\\"\\}#i', $info, $vurl);
if (empty($vurl[1])) {
$info = getfile('http://www.bilibili.com/m/html5?aid=' . $key, 'http://www.bilibili.com', null);
}
preg_match('#src\\"\\:\\"(.*?)\\"\\}#i', $info, $vurl);
$i = 0;
if (!empty($vurl[1])) {
$video['data'][$i]['src'] = str_replace('&', '&', $vurl[1]);
}
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}
示例10: getfile
function getfile($path, $dbxClient)
{
$fileOrfolder = $dbxClient->getMetadataWithChildren($path);
if (sizeof($fileOrfolder["contents"] > 0)) {
$f = 0;
foreach ($fileOrfolder["contents"] as $content) {
if ($content["is_dir"] != 1) {
echo '<li>' . $content["path"] . '</li>';
} else {
$f = 1;
getfile($content["path"], $dbxClient);
}
}
if ($f == 0) {
return;
}
}
}
示例11: GetVid
function GetVid($url)
{
if (empty($url)) {
return false;
}
preg_match("/^http\\:\\/\\/static\\.video\\.qq\\.com\\/TPout\\.swf\\?[0-9a-z&=_-]*vid=(\\w+)/i", $url, $ketStr);
if (empty($ketStr)) {
$geturl = getfile($url, 'http://v.qq.com', null);
preg_match('#vid:"([0-9a-z]+)"#is', $geturl, $key_str);
}
if (!empty($key_str[1])) {
$key = $key_str[1];
}
if (empty($key)) {
return false;
}
return $key;
}
示例12: GetVideo_HTML5
function GetVideo_HTML5($key, $hdstyle)
{
// 插件名字
//http://vv.video.qq.com/geturl?vid=
$content = getfile('http://vv.video.qq.com/geturl?vid=' . $key . '&otype=json', 'http://v.qq.com');
preg_match('~QZOutputJson\\s*=\\s*(.*);~iUs', $content, $info);
$json = json_decode($info[1]);
$vd = $json->vd->vi[0];
$url = $vd->url;
$i = 0;
if (!empty($url)) {
$video['data'][$i]['src'] = $url;
}
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}
示例13: GetVideo_HTML5
function GetVideo_HTML5($key, $hdstyle)
{
$info = getfile('http://www.wasu.cn/Api/getPlayInfoById/id/' . $key . '/datatype/xml', 'http://www.wasu.cn', null);
preg_match('#<video>(.*)</video>#i', $info, $vurl);
$getkey = getfile('http://www.wasu.cn/Play/show/id/' . $key, 'http://www.wasu.cn', null);
preg_match("#playKey[\\s]=[\\s]'(.*)',_playTitle#i", $getkey, $urlkey);
$url = 'http://www.wasu.cn/Api/getVideoUrl/id/' . $key . '/url/' . $vurl[1] . '/key/' . $urlkey[1] . '/';
$content = getfile($url, 'http://s.wasu.cn/', null);
preg_match('#<video><!\\[CDATA\\[(.*)\\]\\]></video>#i', $content, $vurl);
if (empty($vurl[1])) {
return;
}
$i = 0;
//视频标题
$video['data'][$i]['src'] = $vurl[1] . '?version=MIPlayer_V1.3.2';
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}
示例14: get
function get($m)
{
/*{{{*/
require_once 'api/function.getfile.php';
$param0 = $m->getParam(0);
$file = $param0->scalarval();
if ($m->getNumParams() == 2) {
$param1 = $m->getParam(1);
$format = $param1->scalarval();
}
if ($format != "raw" && $format != "gzip") {
$format = "raw";
}
$data = getfile($file, $format);
if (!$data || empty($data)) {
$error = "Could not read file: {$file}, in format: {$format}";
return new XML_RPC_Response(0, $GLOBALS['XML_RPC_erruser'], $error);
}
return new XML_RPC_Response(new XML_RPC_Value($data, $GLOBALS['XML_RPC_Base64']));
}
示例15: GetVideo_HTML5
function GetVideo_HTML5($key, $hdstyle)
{
for ($i = 0; $i < 3; $i++) {
$info = getfile('http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=' . $key, 'http://www.cntv.cn', null);
if (!empty($info)) {
break;
}
}
$json = json_decode($info);
$data = $json;
$video['data'][0]['bpsrc'] = $data->hls_url;
if (empty($video['data'][0]['src'])) {
$video['data'][0]['src'] = $data->hls_url;
$video['data'][0]['bpsrc'] = null;
}
if (empty($video['data'][0]['src'])) {
return false;
}
return $video;
}