|
@@ -225,30 +225,28 @@ def get_task_chinese_name(data):
|
|
|
"""
|
|
|
通过输入任务详情信息获取任务名称
|
|
|
"""
|
|
|
- task_name = data['task_name']
|
|
|
+ task_name = data["task_name"]
|
|
|
task_name_chinese = name_map.get(task_name, task_name)
|
|
|
|
|
|
# account_method
|
|
|
- if task_name == 'crawler_gzh_articles':
|
|
|
- account_method = data.get('account_method', '')
|
|
|
- account_method = account_method.replace("account_association", "账号联想").replace("search", "")
|
|
|
- crawl_mode = data.get('crawl_mode', '')
|
|
|
+ if task_name == "crawler_gzh_articles":
|
|
|
+ account_method = data.get("account_method", "")
|
|
|
+ account_method = account_method.replace(
|
|
|
+ "account_association", "账号联想"
|
|
|
+ ).replace("search", "")
|
|
|
+ crawl_mode = data.get("crawl_mode", "")
|
|
|
crawl_mode = crawl_mode.replace("search", "搜索").replace("account", "抓账号")
|
|
|
- strategy = data.get('strategy', '')
|
|
|
+ strategy = data.get("strategy", "")
|
|
|
return f"{task_name_chinese}\t{crawl_mode}\t{account_method}\t{strategy}"
|
|
|
- elif task_name == 'article_pool_cold_start':
|
|
|
- platform = data.get('platform', '')
|
|
|
- platform = platform.replace('toutiao', '今日头条').replace("weixin", "微信")
|
|
|
- strategy = data.get('strategy', '')
|
|
|
+ elif task_name == "article_pool_cold_start":
|
|
|
+ platform = data.get("platform", "")
|
|
|
+ platform = platform.replace("toutiao", "今日头条").replace("weixin", "微信")
|
|
|
+ strategy = data.get("strategy", "")
|
|
|
strategy = strategy.replace("strategy", "策略")
|
|
|
- category_list = data.get('category_list', [])
|
|
|
+ category_list = data.get("category_list", [])
|
|
|
category_list = "、".join(category_list)
|
|
|
- crawler_methods = data.get('crawler_methods', [])
|
|
|
+ crawler_methods = data.get("crawler_methods", [])
|
|
|
crawler_methods = "、".join(crawler_methods)
|
|
|
return f"{task_name_chinese}\t{platform}\t{crawler_methods}\t{category_list}\t{strategy}"
|
|
|
else:
|
|
|
return task_name_chinese
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|