|
@@ -36,6 +36,7 @@ class XiaoNianGaoH5Scheduling:
|
|
def get_videoList(cls, log_type, crawler, rule_dict, our_uid, env):
|
|
def get_videoList(cls, log_type, crawler, rule_dict, our_uid, env):
|
|
mq = MQ(topic_name="topic_crawler_etl_" + env)
|
|
mq = MQ(topic_name="topic_crawler_etl_" + env)
|
|
for page in range(1, 101):
|
|
for page in range(1, 101):
|
|
|
|
+ time.sleep(random.randint(3, 5))
|
|
try:
|
|
try:
|
|
Common.logger(log_type, crawler).info(f"正在抓取第{page}页")
|
|
Common.logger(log_type, crawler).info(f"正在抓取第{page}页")
|
|
Common.logging(log_type, crawler, env, f"正在抓取第{page}页")
|
|
Common.logging(log_type, crawler, env, f"正在抓取第{page}页")
|
|
@@ -263,7 +264,7 @@ class XiaoNianGaoH5Scheduling:
|
|
video_dict["publish_time"] = video_dict[
|
|
video_dict["publish_time"] = video_dict[
|
|
"publish_time_str"
|
|
"publish_time_str"
|
|
]
|
|
]
|
|
- video_dict["strategy_type"] = "play"
|
|
|
|
|
|
+ video_dict["strategy_type"] = log_type
|
|
# print(video_dict)
|
|
# print(video_dict)
|
|
mq.send_msg(video_dict)
|
|
mq.send_msg(video_dict)
|
|
# break
|
|
# break
|
|
@@ -282,8 +283,8 @@ class XiaoNianGaoH5Scheduling:
|
|
return len(repeat_video)
|
|
return len(repeat_video)
|
|
|
|
|
|
|
|
|
|
-if __name__ == "__main__":
|
|
|
|
- XNG_H5 = XiaoNianGaoH5Scheduling
|
|
|
|
- XNG_H5.get_videoList(
|
|
|
|
- log_type="H5", crawler="xiaoniangao", rule_dict={}, our_uid="ljh", env="dev"
|
|
|
|
- )
|
|
|
|
|
|
+# if __name__ == "__main__":
|
|
|
|
+# XNG_H5 = XiaoNianGaoH5Scheduling
|
|
|
|
+# XNG_H5.get_videoList(
|
|
|
|
+# log_type="H5", crawler="xiaoniangao", rule_dict={}, our_uid="ljh", env="dev"
|
|
|
|
+# )
|