|
@@ -21,7 +21,13 @@ 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 = list(video_pool_config.keys())
|
|
|
+platform_list = ['hksp']
|
|
|
+
|
|
|
+experimental_account = json.loads(
|
|
|
+ apollo_api.get_config_value(key="experimental_account")
|
|
|
+)
|
|
|
+experimental_account_set = set(experimental_account)
|
|
|
|
|
|
|
|
|
class PublishSingleVideoPoolVideos:
|
|
@@ -32,7 +38,7 @@ class PublishSingleVideoPoolVideos:
|
|
|
def get_task_list(self, platform: str) -> list[dict]:
|
|
|
daily_limit = video_pool_config[platform]["process_num_each_day"]
|
|
|
fetch_query = f"""
|
|
|
- select t1.id, t1.content_trace_id, t1.pq_vid, t1.score, t2.category
|
|
|
+ select t1.id, t1.content_trace_id, t1.pq_vid, t1.score, t2.category, t2.out_account_id
|
|
|
from single_video_transform_queue t1
|
|
|
join publish_single_video_source t2 on t1.content_trace_id = t2.content_trace_id
|
|
|
where
|
|
@@ -59,11 +65,15 @@ class PublishSingleVideoPoolVideos:
|
|
|
return affected_rows
|
|
|
|
|
|
def create_crawler_plan(
|
|
|
- self, vid_list: list, platform: str, task_id_tuple: tuple, category: str
|
|
|
+ self, vid_list: list, platform: str, task_id_tuple: tuple, category: str, experiment_tag: str = None
|
|
|
) -> None:
|
|
|
try:
|
|
|
# create video crawler plan
|
|
|
- plan_name = f"{video_pool_config[platform]['nick_name']}-{category}-{datetime.datetime.today().strftime('%Y-%m-%d')}-视频数量: {len(vid_list)}"
|
|
|
+ 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:
|
|
|
+ plan_name = f"{video_pool_config[platform]['nick_name']}-{category}-{date_info}-视频数量: {len(vid_list)}"
|
|
|
crawler_plan_response = aiditApi.auto_create_single_video_crawler_task(
|
|
|
plan_name=plan_name,
|
|
|
plan_tag="单视频供给冷启动",
|
|
@@ -145,17 +155,28 @@ class PublishSingleVideoPoolVideos:
|
|
|
task_id_tuple = tuple(
|
|
|
[task["id"] for task in task_list_with_category]
|
|
|
)
|
|
|
- vid_list = [task["pq_vid"] for task in task_list_with_category]
|
|
|
- if vid_list:
|
|
|
+ # 区分账号ID 是否属于实验账号
|
|
|
+ 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]
|
|
|
+
|
|
|
+ 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)
|
|
|
+ else:
|
|
|
+ publish_detail_table[platform] = {category: len(normal_vid_list)}
|
|
|
+
|
|
|
+ if experimental_vid_list:
|
|
|
self.create_crawler_plan(
|
|
|
- vid_list, platform, task_id_tuple, category
|
|
|
+ experimental_vid_list, platform, task_id_tuple, category, "20250610-品类账号实验"
|
|
|
)
|
|
|
if publish_detail_table.get(platform):
|
|
|
- publish_detail_table[platform][category] = len(vid_list)
|
|
|
+ publish_detail_table[platform][category] += len(experimental_vid_list)
|
|
|
else:
|
|
|
- publish_detail_table[platform] = {category: len(vid_list)}
|
|
|
- else:
|
|
|
- continue
|
|
|
+ publish_detail_table[platform] = {category: len(experimental_vid_list)}
|
|
|
else:
|
|
|
feishu_bot_api.bot(
|
|
|
title="视频内容池发布任务",
|