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)
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);