当前位置 : 主页 > 网络编程 > PHP >

bilibili.php

来源:互联网 收集:自由互联 发布时间:2021-06-28
bilibili.php self::API_KEY,'id'=$av,'page'=$page];$info=file_get_contents('http://api.bilibili.com/view?'.http_build_query($query));return $info;}public function getVideo($av,$page=1,$type='flv'){$info = json_decode($this-getInfo($av,$page)
bilibili.php
 self::API_KEY,
			'id'=>$av,
			'page'=>$page
		];
		$info=file_get_contents('http://api.bilibili.com/view?'.http_build_query($query));
		return $info;
	}
	public function getVideo($av,$page=1,$type='flv'){
		$info = json_decode($this->getInfo($av,$page),true);
		$param=[
			"cid"=>$info['cid'],
			"from"=>"local",
			"player"=>"1",
			"otype"=>"json",
			"type"=>$type,
			"quality"=>"100",
			"appkey"=>self::APP_KEY
		];
		$back = $this->getsign($param);
		$cdata = file_get_contents('https://interface.bilibili.com/playurl?'.http_build_query($param).'&sign='.$back);
		return $cdata;
	}
}
$b=new bilibili();
echo $b->getVideo(6198117);
上一篇:keys.php
下一篇:缩略图Thumbnail.class.php
网友评论