|
|
@ -9,6 +9,7 @@ require_once __DIR__ . '/../../../plugins/Html.php'; |
|
|
|
|
|
|
|
|
|
|
|
Class SiteController extends Controller { |
|
|
|
Class SiteController extends Controller { |
|
|
|
protected $dateIndexCacheKey = 'MainBotDateIndex'; //索引数据的key单独缓存,缓存key为此{cacheKey}_keys |
|
|
|
protected $dateIndexCacheKey = 'MainBotDateIndex'; //索引数据的key单独缓存,缓存key为此{cacheKey}_keys |
|
|
|
|
|
|
|
protected $allFilesCacheKey = 'MainBotAllFiles'; |
|
|
|
protected $noOriginalCtimeFilesCacheKey = 'MainBotNoOriginalCtimeFiles'; |
|
|
|
protected $noOriginalCtimeFilesCacheKey = 'MainBotNoOriginalCtimeFiles'; |
|
|
|
|
|
|
|
|
|
|
|
public function actionIndex() { |
|
|
|
public function actionIndex() { |
|
|
@ -811,7 +812,6 @@ Class SiteController extends Controller { |
|
|
|
$page = $this->get('page', 1); |
|
|
|
$page = $this->get('page', 1); |
|
|
|
$pageSize = $this->get('limit', 100); |
|
|
|
$pageSize = $this->get('limit', 100); |
|
|
|
|
|
|
|
|
|
|
|
// || empty($cacheParentDataId) |
|
|
|
|
|
|
|
if (empty($videoUrl) || empty($videoId) || empty($cateId)) { |
|
|
|
if (empty($videoUrl) || empty($videoId) || empty($cateId)) { |
|
|
|
throw new Exception("缺少参数!", 403); |
|
|
|
throw new Exception("缺少参数!", 403); |
|
|
|
} |
|
|
|
} |
|
|
@ -819,19 +819,23 @@ Class SiteController extends Controller { |
|
|
|
$arr = parse_url($videoUrl); |
|
|
|
$arr = parse_url($videoUrl); |
|
|
|
$videoFilename = basename($arr['path']); |
|
|
|
$videoFilename = basename($arr['path']); |
|
|
|
|
|
|
|
|
|
|
|
//增加文件后缀格式检查,区分:mp4, mov, m3u8 |
|
|
|
//增加文件后缀格式检查,区分:mp4, mov |
|
|
|
$videoExtension = pathinfo($arr['path'], PATHINFO_EXTENSION); |
|
|
|
$videoExtension = pathinfo($arr['path'], PATHINFO_EXTENSION); |
|
|
|
|
|
|
|
|
|
|
|
//支持m3u8地址:/m3u8/?id=xxx |
|
|
|
//支持m3u8地址:/m3u8/?id=xxx |
|
|
|
if ($videoFilename == 'm3u8' && !empty($cacheParentDataId)) { |
|
|
|
if ($videoFilename == 'm3u8') { |
|
|
|
$videoExtension = 'm3u8'; |
|
|
|
$videoExtension = 'm3u8'; |
|
|
|
|
|
|
|
|
|
|
|
//从缓存数据获取文件名 |
|
|
|
//从缓存数据获取文件名 |
|
|
|
$cacheSeconds = 86400; |
|
|
|
if (!empty($cacheParentDataId)) { |
|
|
|
$cachedParentData = Common::getCacheFromFile($cacheParentDataId, $cacheSeconds); |
|
|
|
$cacheSeconds = 86400; |
|
|
|
if (!empty($cachedParentData)) { |
|
|
|
$cachedParentData = Common::getCacheFromFile($cacheParentDataId, $cacheSeconds); |
|
|
|
$m3u8 = $cachedParentData[$videoId]; |
|
|
|
if (!empty($cachedParentData)) { |
|
|
|
$videoFilename = $m3u8['filename'] . '.m3u8'; |
|
|
|
$m3u8 = $cachedParentData[$videoId]; |
|
|
|
|
|
|
|
$videoFilename = $m3u8['filename'] . '.m3u8'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
//TODO: 从索引数据中获取 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|