Example #1
0
 /**
  * 视频播放
  *
  * @param $aid
  * @return $this
  */
 public function info($aid)
 {
     try {
         $aid = str_replace('av', '', trim(strtolower($aid)));
         if (strlen($aid) > 10 || strlen($aid) < 4) {
             return redirect('/')->with('message', 'AV号不大对吧');
         }
         $page = Request::input('page', 1);
         //数据库是否已有记录
         $result = DataAccess::getSave($aid, $page);
         if ($result == null) {
             $bili_util = new BiliUtil();
             $result = $bili_util->getInfo($aid, $page);
             $result = DataAccess::saveNew($result, $aid);
         }
         return view('pusher.play')->with('info', $result)->with('aid', $aid)->with('page', $page);
     } catch (Exception $e) {
         return view('pusher.error')->with('error_content', '视频没有找到的说..');
     }
 }