|
|
|
@ -139,6 +139,9 @@ Class FrontApiController extends SiteController {
@@ -139,6 +139,9 @@ Class FrontApiController extends SiteController {
|
|
|
|
|
$done = $done && $this->saveVideoToTag($shareUrl, $tagName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存任务日志 |
|
|
|
|
$this->saveTaskLog($shareUrl, $title, $tagName); |
|
|
|
|
|
|
|
|
|
//调用HeroUnion联盟接口,提交新的数据抓取任务 |
|
|
|
|
if (!empty(FSC::$app['config']['heroUnionEnable'])) { |
|
|
|
|
$platformName = Html::getShareVideosPlatform($shareUrl); |
|
|
|
@ -190,6 +193,29 @@ Class FrontApiController extends SiteController {
@@ -190,6 +193,29 @@ Class FrontApiController extends SiteController {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存任务日志 |
|
|
|
|
protected function saveTaskLog($url, $title, $tagName) { |
|
|
|
|
$logFile = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['task_log']; |
|
|
|
|
|
|
|
|
|
$saved = true; |
|
|
|
|
try { |
|
|
|
|
$fp = fopen($logFile, 'a'); |
|
|
|
|
|
|
|
|
|
$content = array( |
|
|
|
|
'url' => $url, |
|
|
|
|
'title' => $title, |
|
|
|
|
'tag' => $tagName, |
|
|
|
|
'created' => time(), |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
fwrite($fp, json_encode($content) . "\n"); |
|
|
|
|
}catch(Exception $err) { |
|
|
|
|
$saved = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $saved; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function sign($params, $token) { //对参数做MD5签名 |
|
|
|
|
ksort($params); |
|
|
|
|
return md5( json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . $token ); |
|
|
|
|