|
@@ -21,8 +21,7 @@ video_pool_config = json.loads(
|
|
|
apollo_api.get_config_value(key="video_pool_publish_config")
|
|
|
)
|
|
|
video_category_list = json.loads(apollo_api.get_config_value(key="category_list"))
|
|
|
-# platform_list = list(video_pool_config.keys())
|
|
|
-platform_list = ['hksp']
|
|
|
+platform_list = list(video_pool_config.keys())
|
|
|
|
|
|
experimental_account = json.loads(
|
|
|
apollo_api.get_config_value(key="experimental_account")
|
|
@@ -65,11 +64,16 @@ class PublishSingleVideoPoolVideos:
|
|
|
return affected_rows
|
|
|
|
|
|
def create_crawler_plan(
|
|
|
- self, vid_list: list, platform: str, task_id_tuple: tuple, category: str, experiment_tag: str = None
|
|
|
+ self,
|
|
|
+ vid_list: list,
|
|
|
+ platform: str,
|
|
|
+ task_id_tuple: tuple,
|
|
|
+ category: str,
|
|
|
+ experiment_tag: str = None,
|
|
|
) -> None:
|
|
|
try:
|
|
|
# create video crawler plan
|
|
|
- date_info = datetime.datetime.today().strftime('%Y-%m-%d')
|
|
|
+ date_info = datetime.datetime.today().strftime("%Y-%m-%d")
|
|
|
if experiment_tag:
|
|
|
plan_name = f"{video_pool_config[platform]['nick_name']}-{category}-{date_info}-视频数量: {len(vid_list): {experiment_tag}}"
|
|
|
else:
|
|
@@ -156,27 +160,47 @@ class PublishSingleVideoPoolVideos:
|
|
|
[task["id"] for task in task_list_with_category]
|
|
|
)
|
|
|
# 区分账号ID 是否属于实验账号
|
|
|
- experimental_vid_list = [task["pq_vid"] for task in task_list_with_category if task["out_account_id"] in experimental_account_set]
|
|
|
+ experimental_vid_list = [
|
|
|
+ task["pq_vid"]
|
|
|
+ for task in task_list_with_category
|
|
|
+ if task["out_account_id"] in experimental_account_set
|
|
|
+ ]
|
|
|
|
|
|
- normal_vid_list = [task["pq_vid"] for task in task_list_with_category if task["out_account_id"] not in experimental_account_set]
|
|
|
+ normal_vid_list = [
|
|
|
+ task["pq_vid"]
|
|
|
+ for task in task_list_with_category
|
|
|
+ if task["out_account_id"] not in experimental_account_set
|
|
|
+ ]
|
|
|
|
|
|
if normal_vid_list:
|
|
|
self.create_crawler_plan(
|
|
|
normal_vid_list, platform, task_id_tuple, category
|
|
|
)
|
|
|
if publish_detail_table.get(platform):
|
|
|
- publish_detail_table[platform][category] = len(normal_vid_list)
|
|
|
+ publish_detail_table[platform][category] = len(
|
|
|
+ normal_vid_list
|
|
|
+ )
|
|
|
else:
|
|
|
- publish_detail_table[platform] = {category: len(normal_vid_list)}
|
|
|
+ publish_detail_table[platform] = {
|
|
|
+ category: len(normal_vid_list)
|
|
|
+ }
|
|
|
|
|
|
if experimental_vid_list:
|
|
|
self.create_crawler_plan(
|
|
|
- experimental_vid_list, platform, task_id_tuple, category, "20250610-品类账号实验"
|
|
|
+ experimental_vid_list,
|
|
|
+ platform,
|
|
|
+ task_id_tuple,
|
|
|
+ category,
|
|
|
+ "20250610-品类账号实验",
|
|
|
)
|
|
|
if publish_detail_table.get(platform):
|
|
|
- publish_detail_table[platform][category] += len(experimental_vid_list)
|
|
|
+ publish_detail_table[platform][category] += len(
|
|
|
+ experimental_vid_list
|
|
|
+ )
|
|
|
else:
|
|
|
- publish_detail_table[platform] = {category: len(experimental_vid_list)}
|
|
|
+ publish_detail_table[platform] = {
|
|
|
+ category: len(experimental_vid_list)
|
|
|
+ }
|
|
|
else:
|
|
|
feishu_bot_api.bot(
|
|
|
title="视频内容池发布任务",
|