|
@@ -45,27 +45,25 @@ class XiaoNianGaoAuthor:
|
|
|
# 每轮只抓取定量的数据,到达数量后自己退出
|
|
|
max_count = int(self.rule_dict.get("videos_cnt", {}).get("min", 300))
|
|
|
for user_dict in self.user_list:
|
|
|
- account_level = user_dict['account_level']
|
|
|
- if account_level and account_level != "P3":
|
|
|
- if self.download_count <= max_count:
|
|
|
- self.get_video_list(user_dict)
|
|
|
- # time.sleep(random.randint(1, 10))
|
|
|
- time.sleep(1)
|
|
|
- else:
|
|
|
- AliyunLogger.logging(
|
|
|
- code="2000",
|
|
|
- platform=self.platform,
|
|
|
- mode=self.mode,
|
|
|
- env=self.env,
|
|
|
- message="本轮已经抓取足够数量的视频,已经自动退出",
|
|
|
- )
|
|
|
- Common.logging(
|
|
|
- log_type=self.mode,
|
|
|
- crawler=self.platform,
|
|
|
- env=self.env,
|
|
|
- message="本轮已经抓取足够数量的视频,已经自动退出",
|
|
|
- )
|
|
|
- return
|
|
|
+ if self.download_count <= max_count:
|
|
|
+ self.get_video_list(user_dict)
|
|
|
+ # time.sleep(random.randint(1, 10))
|
|
|
+ time.sleep(1)
|
|
|
+ else:
|
|
|
+ AliyunLogger.logging(
|
|
|
+ code="2000",
|
|
|
+ platform=self.platform,
|
|
|
+ mode=self.mode,
|
|
|
+ env=self.env,
|
|
|
+ message="本轮已经抓取足够数量的视频,已经自动退出",
|
|
|
+ )
|
|
|
+ Common.logging(
|
|
|
+ log_type=self.mode,
|
|
|
+ crawler=self.platform,
|
|
|
+ env=self.env,
|
|
|
+ message="本轮已经抓取足够数量的视频,已经自动退出",
|
|
|
+ )
|
|
|
+ return
|
|
|
|
|
|
def get_video_list(self, user_dict):
|
|
|
next_t = -1
|
|
@@ -269,10 +267,10 @@ class XiaoNianGaoAuthor:
|
|
|
trace_id=trace_id,
|
|
|
)
|
|
|
account_level = user_dict['account_level']
|
|
|
- if account_level == "P0" or account_level == "P1":
|
|
|
- flag = True
|
|
|
- else:
|
|
|
- flag = pipeline.process_item()
|
|
|
+ # if account_level == "P0" or account_level == "P1":
|
|
|
+ # flag = True
|
|
|
+ # else:
|
|
|
+ flag = pipeline.process_item()
|
|
|
if flag:
|
|
|
video_dict["width"] = video_dict["video_width"]
|
|
|
video_dict["height"] = video_dict["video_height"]
|