|
@@ -40,7 +40,8 @@ class XiaoNianGaoAuthor:
|
|
|
self.user_list = user_list
|
|
|
self.mq = MQ(topic_name="topic_crawler_etl_" + self.env)
|
|
|
self.download_count = 0
|
|
|
- self.test_account = [58528285, 58527674, 58528085, 58527582, 58527601, 58527612, 58528281, 58528095, 58527323, 58528071, 58527278]
|
|
|
+ self.test_account = [58528285, 58527674, 58528085, 58527582, 58527601, 58527612, 58528281, 58528095, 58527323,
|
|
|
+ 58528071, 58527278]
|
|
|
|
|
|
def get_author_list(self):
|
|
|
# 每轮只抓取定量的数据,到达数量后自己退出
|
|
@@ -243,22 +244,6 @@ class XiaoNianGaoAuthor:
|
|
|
"strategy": self.mode,
|
|
|
"out_video_id": video_obj.get("vid", ""),
|
|
|
}
|
|
|
- if (
|
|
|
- int(time.time()) - publish_time_stamp
|
|
|
- > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
|
|
|
- ):
|
|
|
- AliyunLogger.logging(
|
|
|
- code="2004",
|
|
|
- trace_id=trace_id,
|
|
|
- platform=self.platform,
|
|
|
- mode=self.mode,
|
|
|
- env=self.env,
|
|
|
- data=video_dict,
|
|
|
- message="发布时间超过{}天".format(
|
|
|
- int(self.rule_dict.get("period", {}).get("max", 1000))
|
|
|
- ),
|
|
|
- )
|
|
|
- return False
|
|
|
pipeline = PiaoQuanPipeline(
|
|
|
platform=self.platform,
|
|
|
mode=self.mode,
|
|
@@ -267,15 +252,43 @@ class XiaoNianGaoAuthor:
|
|
|
item=video_dict,
|
|
|
trace_id=trace_id,
|
|
|
)
|
|
|
- account_level = user_dict['account_level']
|
|
|
+ # account_level = user_dict['account_level']
|
|
|
if user_dict['link'] in self.test_account:
|
|
|
+ if (
|
|
|
+ int(time.time()) - publish_time_stamp
|
|
|
+ > 3600 * 24
|
|
|
+ ):
|
|
|
+ AliyunLogger.logging(
|
|
|
+ code="2004",
|
|
|
+ trace_id=trace_id,
|
|
|
+ platform=self.platform,
|
|
|
+ mode=self.mode,
|
|
|
+ env=self.env,
|
|
|
+ data=video_dict,
|
|
|
+ message="发布时间超过{}天".format(
|
|
|
+ int(self.rule_dict.get("period", {}).get("max", 1000))
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ return False
|
|
|
flag = pipeline.repeat_video()
|
|
|
else:
|
|
|
+ if (
|
|
|
+ int(time.time()) - publish_time_stamp
|
|
|
+ > 3600 * 24 * int(self.rule_dict.get("period", {}).get("max", 1000))
|
|
|
+ ):
|
|
|
+ AliyunLogger.logging(
|
|
|
+ code="2004",
|
|
|
+ trace_id=trace_id,
|
|
|
+ platform=self.platform,
|
|
|
+ mode=self.mode,
|
|
|
+ env=self.env,
|
|
|
+ data=video_dict,
|
|
|
+ message="发布时间超过{}天".format(
|
|
|
+ int(self.rule_dict.get("period", {}).get("max", 1000))
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ return False
|
|
|
flag = pipeline.process_item()
|
|
|
- # if account_level == "P0" or account_level == "P1":
|
|
|
- # flag = True
|
|
|
- # else:
|
|
|
-
|
|
|
if flag:
|
|
|
video_dict["width"] = video_dict["video_width"]
|
|
|
video_dict["height"] = video_dict["video_height"]
|