Example #1
0
 /**
  * 取得HD片源
  *
  * @param $cid
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function playHD($cid)
 {
     try {
         $bili_util = new BiliUtil();
         $result = $bili_util->getHDVideo($cid);
         $return_array = ['code' => 'success', 'content' => $result['durl'][0]];
         return response()->json($return_array);
     } catch (Exception $e) {
         $return_array = ['code' => 'error', 'message' => $e->getMessage()];
         return response()->json($return_array);
     }
 }
Example #2
0
 public function test()
 {
     $bili_util = new BiliUtil();
     $back = $bili_util->getHDVideo('4553207');
     dd($back);
 }