Browse Source

修改海豚祝福的抓取页数由 20 改为 100

罗俊辉 1 year ago
parent
commit
0bc81fb45e

+ 1 - 2
haitunzhufu/haitunzhufu_main/run_htzf_recommend.py

@@ -3,7 +3,6 @@
 # @Time: 2023/10/19
 import argparse
 import random
-import multiprocessing
 
 from mq_http_sdk.mq_client import *
 from mq_http_sdk.mq_consumer import *
@@ -94,7 +93,7 @@ class HTZFMain:
                         rule_dict=r_d,
                         our_uid=our_uid
                     )
-                    for i in range(20):
+                    for i in range(100):
                         if HTZF.download_count >= int(rule_dict.get("videos_cnt", {}).get("min", 10)):
                             HTZF.download_count = 0
                             break

+ 1 - 26
haitunzhufu/haitunzhufu_recommend/haitunzhufu_recommend3.py

@@ -17,10 +17,9 @@ from common.mq import MQ
 sys.path.append(os.getcwd())
 from common.common import Common
 from common.scheduling_db import MysqlHelper
-from common.public import get_config_from_mysql, download_rule, download_rule_v2
+from common.public import get_config_from_mysql, download_rule_v2, clean_title
 
 
-# 定义一个 AES 加密解密的类
 class AESCipher:
     def __init__(self, key):
         self.key = key.encode('utf-8')  # 需要一个bytes类型的key
@@ -43,30 +42,6 @@ class AESCipher:
             return None
 
 
-def clean_title(strings):
-    return (
-        strings.strip()
-        .replace("\n", "")
-        .replace("/", "")
-        .replace("\r", "")
-        .replace("#", "")
-        .replace(".", "。")
-        .replace("\\", "")
-        .replace("&NBSP", "")
-        .replace(":", "")
-        .replace("*", "")
-        .replace("?", "")
-        .replace("?", "")
-        .replace('"', "")
-        .replace("<", "")
-        .replace(">", "")
-        .replace("|", "")
-        .replace(" ", "")
-        .replace('"', "")
-        .replace("'", "")
-    )
-
-
 class HTZFScheduling:
     def __init__(self, log_type, crawler, rule_dict, env, our_uid):
         self.platform = "haitunzhufu"