Explorar o código

gzh抓取优化

luojunhui hai 3 semanas
pai
achega
4755163b76
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      applications/utils/common.py

+ 4 - 2
applications/utils/common.py

@@ -233,13 +233,15 @@ def get_task_chinese_name(data):
         account_method = data.get('account_method', '')
         crawl_mode = data.get('crawl_mode', '')
         strategy = data.get('strategy', '')
-        return f"{task_name_chinese}{crawl_mode}{account_method}{strategy}"
+        return f"{task_name_chinese}:模式:{crawl_mode}:{account_method}策略:{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', [])
         crawler_methods = data.get('crawler_methods', [])
-        return f"{task_name_chinese}{platform}{strategy}{'、'.join(crawler_methods)}{'、'.join(category_list)}"
+        return f"{task_name_chinese}: 平台: {platform}; {strategy}: {'、'.join(crawler_methods)}{'、'.join(category_list)}"
     else:
         return task_name_chinese