Explorar el Código

Merge branch 'lxr_etl_20230620' of https://git.yishihui.com/Server/piaoquan_crawler into lxr_etl_20230620

ehlxr hace 1 año
padre
commit
c5ab6ac52e

+ 1 - 0
kuaishou/kuaishou_author/kuaishou_author_scheduling.py

@@ -211,6 +211,7 @@ class KuaishouauthorScheduling:
                         video_dict["publish_time"] = video_dict["publish_time_str"]
                         video_dict["strategy_type"] = log_type
                         mq.send_msg(video_dict)
+                        cls.download_cnt += 1
                         # cls.download_publish(log_type=log_type,
                         #                      crawler=crawler,
                         #                      user_dict=user_dict,

+ 35 - 0
kuaishou/kuaishou_main/run_ks_author_dev.py

@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# @Author: wangkun
+# @Time: 2023/6/9
+import os
+import sys
+sys.path.append(os.getcwd())
+from common.common import Common
+from kuaishou.kuaishou_author.kuaishou_author_scheduling import KuaishouauthorScheduling
+
+
+def kuaishou_recommend_main(log_type, crawler, env):
+    Common.logger(log_type, crawler).info("开始抓取:快手账号\n")
+    Common.logging(log_type, crawler, env, "开始抓取:快手账号\n")
+    KuaishouauthorScheduling.get_author_videos(log_type=log_type,
+                                               crawler=crawler,
+                                               rule_dict={"videos_cnt": {"min": 5, "max": 0},
+                                                          "like_cnt": {"min": 100, "max": 0},
+                                                          "duration": {"min": 30, "max": 0},
+                                                          "period": {"min": 365, "max": 365}},
+                                               user_list=[{"uid": 6267140, "source": "kuaishou", "link": "3xratgemedr8ctq",
+                                                           "nick_name": "买两个橘子",
+                                                           "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
+                                                           "mode": "author"},
+                                                          {"uid": 6267141, "source": "kuaishou", "link": "3x3afdt7epzegau",
+                                                           "nick_name": "西二旗刘德华",
+                                                           "avatar_url": "http://rescdn.yishihui.com/user/default/avatar/live/1616555578819_u=1922778943,2660693611&fm=26&gp=0.jpg",
+                                                           "mode": "author"}],
+                                               env=env)
+    Common.del_logs(log_type, crawler)
+    Common.logger(log_type, crawler).info("抓取一轮结束\n")
+    Common.logging(log_type, crawler, env, "抓取一轮结束\n")
+
+
+if __name__ == "__main__":
+    kuaishou_recommend_main("author", "kuaishou", "dev")