|
|
@ -150,8 +150,7 @@ Class FrontApiController extends SiteController { |
|
|
|
|
|
|
|
|
|
|
|
//保存分享视频到任务文件 |
|
|
|
//保存分享视频到任务文件 |
|
|
|
protected function saveBotTask($url) { |
|
|
|
protected function saveBotTask($url) { |
|
|
|
$task_dir = realpath(__DIR__ . '/../../../runtime/' |
|
|
|
$task_dir = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['task_dir']; |
|
|
|
. FSC::$app['config']['tajian']['task_dir']); |
|
|
|
|
|
|
|
if (!is_dir($task_dir)) { |
|
|
|
if (!is_dir($task_dir)) { |
|
|
|
mkdir($task_dir, 0755, true); |
|
|
|
mkdir($task_dir, 0755, true); |
|
|
|
} |
|
|
|
} |
|
|
@ -164,9 +163,7 @@ Class FrontApiController extends SiteController { |
|
|
|
//保存分享视频到tag分类 |
|
|
|
//保存分享视频到tag分类 |
|
|
|
//TODO: 如果高并发,需要避免数据被覆盖的问题 |
|
|
|
//TODO: 如果高并发,需要避免数据被覆盖的问题 |
|
|
|
protected function saveVideoToTag($url, $tagName) { |
|
|
|
protected function saveVideoToTag($url, $tagName) { |
|
|
|
$tag_dir = realpath(__DIR__ . '/../../../www/' |
|
|
|
$tag_dir = __DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'] . '/' . FSC::$app['config']['tajian']['tag_dir']; |
|
|
|
. FSC::$app['config']['content_directory'] |
|
|
|
|
|
|
|
. '/' . FSC::$app['config']['tajian']['tag_dir']); |
|
|
|
|
|
|
|
if (!is_dir($tag_dir)) { |
|
|
|
if (!is_dir($tag_dir)) { |
|
|
|
mkdir($tag_dir, 0755, true); |
|
|
|
mkdir($tag_dir, 0755, true); |
|
|
|
} |
|
|
|
} |
|
|
@ -193,7 +190,7 @@ Class FrontApiController extends SiteController { |
|
|
|
|
|
|
|
|
|
|
|
protected function sign($params, $token) { //对参数做MD5签名 |
|
|
|
protected function sign($params, $token) { //对参数做MD5签名 |
|
|
|
ksort($params); |
|
|
|
ksort($params); |
|
|
|
return md5( json_encode($params, JSON_UNESCAPED_SLASHES) . $token ); |
|
|
|
return md5( json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . $token ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//提交视频抓取任务到HeroUnion英雄联盟 |
|
|
|
//提交视频抓取任务到HeroUnion英雄联盟 |
|
|
@ -223,8 +220,7 @@ Class FrontApiController extends SiteController { |
|
|
|
|
|
|
|
|
|
|
|
//保存快捷方式 |
|
|
|
//保存快捷方式 |
|
|
|
protected function saveUrlShortCut($task_id, $task_url) { |
|
|
|
protected function saveUrlShortCut($task_id, $task_url) { |
|
|
|
$data_dir = realpath(__DIR__ . '/../../../runtime/' |
|
|
|
$data_dir = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['data_dir']; |
|
|
|
. FSC::$app['config']['tajian']['data_dir']); |
|
|
|
|
|
|
|
if (!is_dir($data_dir)) { |
|
|
|
if (!is_dir($data_dir)) { |
|
|
|
mkdir($data_dir, 0755, true); |
|
|
|
mkdir($data_dir, 0755, true); |
|
|
|
} |
|
|
|
} |
|
|
@ -244,8 +240,7 @@ eof; |
|
|
|
|
|
|
|
|
|
|
|
//保存描述文件:标题和图片 |
|
|
|
//保存描述文件:标题和图片 |
|
|
|
protected function saveDescriptionFiles($task_id, $task_data) { |
|
|
|
protected function saveDescriptionFiles($task_id, $task_data) { |
|
|
|
$data_dir = realpath(__DIR__ . '/../../../runtime/' |
|
|
|
$data_dir = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['data_dir']; |
|
|
|
. FSC::$app['config']['tajian']['data_dir']); |
|
|
|
|
|
|
|
if (!is_dir($data_dir)) { |
|
|
|
if (!is_dir($data_dir)) { |
|
|
|
mkdir($data_dir, 0755, true); |
|
|
|
mkdir($data_dir, 0755, true); |
|
|
|
} |
|
|
|
} |
|
|
|