feat: add metadata workbench and shared seo rules

This commit is contained in:
root
2026-04-18 20:23:30 +08:00
parent 2ea87050a5
commit cec1fdbc69
44 changed files with 5488 additions and 68 deletions

View File

@@ -219,6 +219,16 @@ class VideoInfoPage extends BasePage
'v_play_url' => $sortedPlayUrl,
];
$arrMetadataBackfill = $this->getVideoModel()->buildEmptyMetadataBackfillSet(
$arrExistsVideo,
$arrPageVideo,
'douban_crawler'
);
if (!empty($arrMetadataBackfill)) {
$arrUpdate = array_merge($arrUpdate, $arrMetadataBackfill);
}
$this->getVideoModel()->updateOne(
['v_name' => $arrPageVideo['v_name']],
['$set' => $arrUpdate]

View File

@@ -246,6 +246,16 @@ class VideoInfoPage extends BasePage
'v_play_url' => $sortedPlayUrl,
];
$arrMetadataBackfill = $this->getVideoModel()->buildEmptyMetadataBackfillSet(
$arrExistsVideo,
$arrPageVideo,
'fengchao_crawler'
);
if (!empty($arrMetadataBackfill)) {
$arrUpdate = array_merge($arrUpdate, $arrMetadataBackfill);
}
$this->getVideoModel()->updateOne(
['v_name' => $arrPageVideo['v_name']],
['$set' => $arrUpdate]

View File

@@ -233,6 +233,16 @@ class VideoInfoPage extends BasePage
'v_name_en' => zhToPinYin($arrPageVideo['v_name']),
];
$arrMetadataBackfill = $this->getVideoModel()->buildEmptyMetadataBackfillSet(
$arrExistsVideo,
$arrPageVideo,
'maotai_crawler'
);
if (!empty($arrMetadataBackfill)) {
$arrUpdate = array_merge($arrUpdate, $arrMetadataBackfill);
}
$this->getVideoModel()->updateOne(
['v_name' => $arrPageVideo['v_name']],
['$set' => $arrUpdate]

View File

@@ -252,6 +252,16 @@ class VideoInfoPage extends BasePage
'v_play_url' => $sortedPlayUrl,
];
$arrMetadataBackfill = $this->getVideoModel()->buildEmptyMetadataBackfillSet(
$arrExistsVideo,
$arrPageVideo,
'wuxian_crawler'
);
if (!empty($arrMetadataBackfill)) {
$arrUpdate = array_merge($arrUpdate, $arrMetadataBackfill);
}
$this->getVideoModel()->updateOne(
['v_name' => $arrPageVideo['v_name']],
['$set' => $arrUpdate]

View File

@@ -169,6 +169,10 @@ class VideoCategory
'name' => '体育',
'pinyin' => 'ti-yu',
],
95 => [
'name' => '短剧大全',
'pinyin' => 'duan-ju-da-quan',
],
];
static public $arrParent = [
@@ -212,5 +216,6 @@ class VideoCategory
19 => 19,
83 => 83,
94 => 94,
95 => 83,
];
}

View File

@@ -127,7 +127,8 @@ class VideoInfoPage extends BasePage
}
$arrPlayUrl = $cleanPlayUrl;
$arrVideo['type_id_1'] = VideoCategory::$arrParent[$arrVideo['type_id']];
$arrVideo['type_id'] = (int)($arrVideo['type_id'] ?? 0);
$arrVideo['type_id_1'] = VideoCategory::$arrParent[$arrVideo['type_id']] ?? $arrVideo['type_id'];
$arrVideo['vod_actor'] = trim($arrVideo['vod_actor']);
$arrVideo['vod_director'] = trim($arrVideo['vod_director']);
@@ -159,10 +160,16 @@ class VideoInfoPage extends BasePage
$arrVideo['vod_content'] = mb_rtrim($arrVideo['vod_content'], '\ ');
$arrVideo['vod_content'] = ensureUtf8($arrVideo['vod_content']);
$arrVideo['v_category'] = VideoCategory::$arrCategory[$arrVideo['type_id']]['name'];
$arrVideo['v_category_en'] = VideoCategory::$arrCategory[$arrVideo['type_id']]['pinyin'];
$arrVideo['v_parent_category'] = VideoCategory::$arrCategory[$arrVideo['type_id_1']]['name'];
$arrVideo['v_parent_category_en'] = VideoCategory::$arrCategory[$arrVideo['type_id_1']]['pinyin'];
$arrCurrentCategory = VideoCategory::$arrCategory[$arrVideo['type_id']] ?? VideoCategory::$arrCategory[$arrVideo['type_id_1']] ?? [
'name' => '短剧大全',
'pinyin' => 'duan-ju-da-quan',
];
$arrParentCategory = VideoCategory::$arrCategory[$arrVideo['type_id_1']] ?? $arrCurrentCategory;
$arrVideo['v_category'] = $arrCurrentCategory['name'];
$arrVideo['v_category_en'] = $arrCurrentCategory['pinyin'];
$arrVideo['v_parent_category'] = $arrParentCategory['name'];
$arrVideo['v_parent_category_en'] = $arrParentCategory['pinyin'];
foreach ($arrVideo as $strKey => $mixedVal) {
$strKey = str_replace('vod', 'v', $strKey);
@@ -249,6 +256,16 @@ class VideoInfoPage extends BasePage
'v_play_url' => $sortedPlayUrl,
];
$arrMetadataBackfill = $this->getVideoModel()->buildEmptyMetadataBackfillSet(
$arrExistsVideo,
$arrPageVideo,
'youzhi_crawler'
);
if (!empty($arrMetadataBackfill)) {
$arrUpdate = array_merge($arrUpdate, $arrMetadataBackfill);
}
$this->getVideoModel()->updateOne(
['v_name' => $arrPageVideo['v_name']],
['$set' => $arrUpdate]