|
@@ -168,7 +168,9 @@ class XiaoNianGaoAuthor:
|
|
|
env=self.env,
|
|
|
message=f"扫描到一条视频"
|
|
|
)
|
|
|
- self.process_video_obj(video_obj, user_dict)
|
|
|
+ date_flag = self.process_video_obj(video_obj, user_dict)
|
|
|
+ if not date_flag:
|
|
|
+ return
|
|
|
except Exception as e:
|
|
|
AliyunLogger.logging(
|
|
|
code="3000",
|
|
@@ -239,8 +241,22 @@ class XiaoNianGaoAuthor:
|
|
|
"strategy": self.mode,
|
|
|
"out_video_id": video_obj.get("vid", ""),
|
|
|
}
|
|
|
- for k, v in video_dict.items():
|
|
|
- Common.logger(self.mode, self.platform).info(f"{k}:{v}")
|
|
|
+ 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,
|
|
@@ -249,6 +265,7 @@ class XiaoNianGaoAuthor:
|
|
|
item=video_dict,
|
|
|
trace_id=trace_id,
|
|
|
)
|
|
|
+ # try:
|
|
|
flag = pipeline.process_item()
|
|
|
if flag:
|
|
|
video_dict["width"] = video_dict["video_width"]
|
|
@@ -274,6 +291,7 @@ class XiaoNianGaoAuthor:
|
|
|
env=self.env,
|
|
|
message="成功发送 MQ 至 ETL",
|
|
|
)
|
|
|
+ return True
|
|
|
|
|
|
# if __name__ == "__main__":
|
|
|
# XNGA = XiaoNianGaoAuthor(
|