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