public static function getHot() { if (!Cache::has(GlobalVar::$HOT_CACHE)) { $bili_util = new BiliUtil(); $hot_list = $bili_util->getHot(); Cache::add(GlobalVar::$HOT_CACHE, $hot_list, 60 * 5); } else { $hot_list = Cache::get(GlobalVar::$HOT_CACHE); } return $hot_list; }
/** * 取得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); } }
public function test() { $bili_util = new BiliUtil(); $back = $bili_util->getHDVideo('4553207'); dd($back); }