feature
This commit is contained in:
@@ -80,6 +80,9 @@ class Scheduler
|
||||
// 'data' => $arrVSourceId,
|
||||
// ];
|
||||
// $this->QueueManage->set($arrTask);
|
||||
|
||||
// $this->fetchVideo($arrVSourceId);
|
||||
|
||||
// return;
|
||||
|
||||
$Site = $this->getSite();
|
||||
|
||||
@@ -154,6 +154,18 @@ class Site
|
||||
$arrContent = json_decode($strContent, true);
|
||||
$arrFilter = $arrContent['class'];
|
||||
|
||||
// print_r($arrFilter);
|
||||
|
||||
// $arrA = [];
|
||||
// foreach ($arrFilter as $b) {
|
||||
// $arrA[$b['type_id']] = [
|
||||
// 'name' => $b['type_name'],
|
||||
// 'pinyin' => zhToPinYin($b['type_name']),
|
||||
// ];
|
||||
// }
|
||||
// print_r($arrA);
|
||||
|
||||
|
||||
$arrCategory = [];
|
||||
|
||||
foreach ($arrFilter as $intKey => $arrItem) {
|
||||
|
||||
147
code/app/task/crawler/fengchao/page/VideoCategory.php
Normal file
147
code/app/task/crawler/fengchao/page/VideoCategory.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\task\crawler\fengchao\page;
|
||||
|
||||
class VideoCategory
|
||||
{
|
||||
static $arrCategory = [
|
||||
1 => [
|
||||
'name' => '电影',
|
||||
'pinyin' => 'dian-ying',
|
||||
],
|
||||
2 => [
|
||||
'name' => '电视剧',
|
||||
'pinyin' => 'dian-shi-ju',
|
||||
],
|
||||
3 => [
|
||||
'name' => '综艺',
|
||||
'pinyin' => 'zong-yi',
|
||||
],
|
||||
4 => [
|
||||
'name' => '动漫',
|
||||
'pinyin' => 'dong-man',
|
||||
],
|
||||
6 => [
|
||||
'name' => '动作片',
|
||||
'pinyin' => 'dong-zuo-pian',
|
||||
],
|
||||
7 => [
|
||||
'name' => '喜剧片',
|
||||
'pinyin' => 'xi-ju-pian',
|
||||
],
|
||||
8 => [
|
||||
'name' => '爱情片',
|
||||
'pinyin' => 'ai-qing-pian',
|
||||
],
|
||||
9 => [
|
||||
'name' => '科幻片',
|
||||
'pinyin' => 'ke-huan-pian',
|
||||
],
|
||||
10 => [
|
||||
'name' => '恐怖片',
|
||||
'pinyin' => 'kong-bu-pian',
|
||||
],
|
||||
11 => [
|
||||
'name' => '剧情片',
|
||||
'pinyin' => 'ju-qing-pian',
|
||||
],
|
||||
12 => [
|
||||
'name' => '战争片',
|
||||
'pinyin' => 'zhan-zheng-pian',
|
||||
],
|
||||
13 => [
|
||||
'name' => '国产剧',
|
||||
'pinyin' => 'guo-chan-ju',
|
||||
],
|
||||
14 => [
|
||||
'name' => '欧美剧',
|
||||
'pinyin' => 'ou-mei-ju',
|
||||
],
|
||||
15 => [
|
||||
'name' => '韩剧',
|
||||
'pinyin' => 'han-ju',
|
||||
],
|
||||
16 => [
|
||||
'name' => '日剧',
|
||||
'pinyin' => 'ri-ju',
|
||||
],
|
||||
17 => [
|
||||
'name' => '港剧',
|
||||
'pinyin' => 'gang-ju',
|
||||
],
|
||||
18 => [
|
||||
'name' => '台剧',
|
||||
'pinyin' => 'tai-ju',
|
||||
],
|
||||
19 => [
|
||||
'name' => '泰剧',
|
||||
'pinyin' => 'tai-ju',
|
||||
],
|
||||
20 => [
|
||||
'name' => '纪录片',
|
||||
'pinyin' => 'ji-lu-pian',
|
||||
],
|
||||
23 => [
|
||||
'name' => '海外剧',
|
||||
'pinyin' => 'hai-wai-ju',
|
||||
],
|
||||
25 => [
|
||||
'name' => '大陆综艺',
|
||||
'pinyin' => 'da-lu-zong-yi',
|
||||
],
|
||||
26 => [
|
||||
'name' => '日韩综艺',
|
||||
'pinyin' => 'ri-han-zong-yi',
|
||||
],
|
||||
27 => [
|
||||
'name' => '港台综艺',
|
||||
'pinyin' => 'gang-tai-zong-yi',
|
||||
],
|
||||
28 => [
|
||||
'name' => '欧美综艺',
|
||||
'pinyin' => 'ou-mei-zong-yi',
|
||||
],
|
||||
29 => [
|
||||
'name' => '国产动漫',
|
||||
'pinyin' => 'guo-chan-dong-man',
|
||||
],
|
||||
30 => [
|
||||
'name' => '日韩动漫',
|
||||
'pinyin' => 'ri-han-dong-man',
|
||||
],
|
||||
31 => [
|
||||
'name' => '欧美动漫',
|
||||
'pinyin' => 'ou-mei-dong-man',
|
||||
],
|
||||
39 => [
|
||||
'name' => '动画片',
|
||||
'pinyin' => 'dong-hua-pian',
|
||||
],
|
||||
44 => [
|
||||
'name' => '港台动漫',
|
||||
'pinyin' => 'gang-tai-dong-man',
|
||||
],
|
||||
45 => [
|
||||
'name' => '海外动漫',
|
||||
'pinyin' => 'hai-wai-dong-man',
|
||||
],
|
||||
47 => [
|
||||
'name' => '演唱会',
|
||||
'pinyin' => 'yan-chang-hui',
|
||||
],
|
||||
55 => [
|
||||
'name' => '伦理',
|
||||
'pinyin' => 'lun-li',
|
||||
],
|
||||
62 => [
|
||||
'name' => '4K电影',
|
||||
'pinyin' => 'dian-ying',
|
||||
],
|
||||
70 => [
|
||||
'name' => '邵氏电影',
|
||||
'pinyin' => 'shao-shi-dian-ying',
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,6 @@ namespace app\task\crawler\fengchao\page;
|
||||
|
||||
use app\model\CountersModel;
|
||||
use app\model\VideoModel;
|
||||
use storage\StorageCore;
|
||||
|
||||
class VideoInfoPage extends BasePage
|
||||
{
|
||||
@@ -84,19 +83,41 @@ class VideoInfoPage extends BasePage
|
||||
];
|
||||
}
|
||||
|
||||
$arrVideo['vod_actor'] = trim($arrVideo['vod_actor']);
|
||||
$arrVideo['vod_director'] = trim($arrVideo['vod_director']);
|
||||
$arrVideo['vod_class'] = trim($arrVideo['vod_class']);
|
||||
$arrVideo['vod_lang'] = trim($arrVideo['vod_lang']);
|
||||
$arrVideo['vod_area'] = trim($arrVideo['vod_area']);
|
||||
|
||||
$arrVideo['vod_play_url'][$this->getsite()->getSiteCode()] = $arrPlayUrl;
|
||||
|
||||
$arrVideo['vod_actor'] = $arrVideo['vod_actor'] === '' ? [] : explode(',', $arrVideo['vod_actor']);
|
||||
$arrVideo['vod_director'] = $arrVideo['vod_director'] === '' ? [] : explode(',', $arrVideo['vod_director']);
|
||||
$arrVideo['vod_class'] = $arrVideo['vod_class'] === '' ? [] : explode(',', $arrVideo['vod_class']);
|
||||
$arrVideo['vod_lang'] = $arrVideo['vod_lang'] === '' ? [] : explode(',', $arrVideo['vod_lang']);
|
||||
$arrVideo['vod_area'] = $arrVideo['vod_area'] === '' ? [] : explode(',', $arrVideo['vod_area']);
|
||||
|
||||
$arrVideo['vod_lang_en'] = $arrVideo['vod_area_en'] = [];
|
||||
|
||||
foreach ($arrVideo['vod_lang'] as $strVal) {
|
||||
$arrVideo['vod_lang_en'][] = zhToPinYin($strVal);
|
||||
}
|
||||
|
||||
foreach ($arrVideo['vod_area'] as $strVal) {
|
||||
$arrVideo['vod_area_en'][] = zhToPinYin($strVal);
|
||||
}
|
||||
|
||||
|
||||
$arrVideo['vod_content'] = strip_tags($arrVideo['vod_content']);
|
||||
$arrVideo['vod_content'] = trim($arrVideo['vod_content']);
|
||||
$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'];
|
||||
|
||||
foreach ($arrVideo as $strKey => $mixedVal) {
|
||||
$strKey = str_replace('vod', 'v', $strKey);
|
||||
|
||||
@@ -165,15 +186,19 @@ class VideoInfoPage extends BasePage
|
||||
'v_id' => CountersModel::getInstance()->getNextSequence('video'),
|
||||
'v_name' => $arrPageVideo['v_name'],
|
||||
'v_name_en' => zhToPinYin($arrPageVideo['v_name']),
|
||||
'v_parent_category' => $arrPageVideo['v_parent_category'],
|
||||
'v_parent_category_en' => $arrPageVideo['v_parent_category_en'],
|
||||
'v_category' => $arrPageVideo['v_category'],
|
||||
'v_category_en' => zhToPinYin($arrPageVideo['v_category']),
|
||||
'v_category_en' => $arrPageVideo['v_category_en'],
|
||||
'v_actor' => $arrPageVideo['v_actor'],
|
||||
'v_director' => $arrPageVideo['v_director'],
|
||||
'v_class' => $arrPageVideo['v_class'],
|
||||
'v_letter' => $arrPageVideo['v_letter'],
|
||||
'v_pic' => '',
|
||||
'v_lang' => $arrPageVideo['v_lang'],
|
||||
'v_lang_en' => $arrPageVideo['v_lang_en'],
|
||||
'v_area' => $arrPageVideo['v_area'],
|
||||
'v_area_en' => $arrPageVideo['v_area_en'],
|
||||
'v_year' => $arrPageVideo['v_year'],
|
||||
'v_remarks' => $arrPageVideo['v_remarks'],
|
||||
'v_isend' => $arrPageVideo['v_isend'],
|
||||
|
||||
Reference in New Issue
Block a user