Pārlūkot izejas kodu

Merge branch 'lierqiang'

lierqiang 2 gadi atpakaļ
vecāks
revīzija
66816f41ce
1 mainītis faili ar 17 papildinājumiem un 17 dzēšanām
  1. 17 17
      kuaishou/kuaishou_follow/kuaishou_follow.py

+ 17 - 17
kuaishou/kuaishou_follow/kuaishou_follow.py

@@ -357,13 +357,13 @@ class KuaiShouFollow:
         if rule_dict_1 is None or rule_dict_2 is None:
             Common.logger(log_type, crawler).warning(f"rule_dict is None")
             return
-        if download_cnt_1 >= int(
-                rule_dict_1['download_cnt'].replace("=", "")[-1].replace("<", "")[-1].replace(">", "")[
-                    -1]) and download_cnt_2 >= int(
-            rule_dict_2['download_cnt'].replace("=", "")[-1].replace("<", "")[-1].replace(">", "")[-1]):
-            Common.logger(log_type, crawler).info(
-                f"规则1已下载{download_cnt_1}条视频,规则2已下载{download_cnt_2}条视频\n")
-            return
+        # if download_cnt_1 >= int(
+        #         rule_dict_1['download_cnt'].replace("=", "")[-1].replace("<", "")[-1].replace(">", "")[
+        #             -1]) and download_cnt_2 >= int(
+        #     rule_dict_2['download_cnt'].replace("=", "")[-1].replace("<", "")[-1].replace(">", "")[-1]):
+        #     Common.logger(log_type, crawler).info(
+        #         f"规则1已下载{download_cnt_1}条视频,规则2已下载{download_cnt_2}条视频\n")
+        #     return
 
         url = "https://www.kuaishou.com/graphql"
         payload = json.dumps({
@@ -384,7 +384,7 @@ class KuaiShouFollow:
             'content-type': 'application/json',
             'Origin': 'https://www.kuaishou.com',
             'Connection': 'keep-alive',
-            'Cookie': 'kpf=PC_WEB; clientid=3; did=web_cb989442745f6db4521d6b21032475a6; kpn=KUAISHOU_VISION',
+            'Cookie': 'kpf=PC_WEB; clientid=3; did=web_5d4d0dff78b7819f8b015e7a81e2ca98; kpn=KUAISHOU_VISION',
             'Sec-Fetch-Dest': 'empty',
             'Sec-Fetch-Mode': 'cors',
             'Sec-Fetch-Site': 'same-origin'
@@ -579,8 +579,8 @@ class KuaiShouFollow:
                                                                  oss_endpoint=oss_endpoint,
                                                                  env=env,
                                                                  machine=machine)
-                        if download_finished is True:
-                            download_cnt_1 += 1
+                        # if download_finished is True:
+                        #     download_cnt_1 += 1
                 elif rule_2 is True:
                     if download_cnt_2 < int(
                             rule_dict_2['download_cnt'].replace("=", "")[-1].replace("<", "")[-1].replace(">",
@@ -595,17 +595,17 @@ class KuaiShouFollow:
                                                                  oss_endpoint=oss_endpoint,
                                                                  env=env,
                                                                  machine=machine)
-                        if download_finished is True:
-                            download_cnt_2 += 1
+                        # if download_finished is True:
+                        #     download_cnt_2 += 1
                 else:
                     Common.logger(log_type, crawler).info("不满足下载规则\n")
                     # Common.logger(log_type, crawler).info(f"feeds: {feeds}\n")
 
-            if pcursor == "no_more":
-                Common.logger(log_type, crawler).info(f"作者,{out_uid},已经到底了,没有更多内容了\n")
-                return
-            cls.get_videoList(log_type, crawler, strategy, our_uid, out_uid, oss_endpoint, env, machine,
-                          pcursor=pcursor)
+            # if pcursor == "no_more":
+            #     Common.logger(log_type, crawler).info(f"作者,{out_uid},已经到底了,没有更多内容了\n")
+            #     return
+            # cls.get_videoList(log_type, crawler, strategy, our_uid, out_uid, oss_endpoint, env, machine,
+            #               pcursor=pcursor)
             # time.sleep(random.randint(1, 3))
 
     @classmethod