Browse Source

1. xigua_author_修改了日志, 不满足特殊条件的日志打印

罗俊辉 1 year ago
parent
commit
a6eace4e74
1 changed files with 30 additions and 11 deletions
  1. 30 11
      xigua/xigua_author/xigua_author.py

+ 30 - 11
xigua/xigua_author/xigua_author.py

@@ -808,19 +808,38 @@ class XiGuaAuthor:
                     trace_id=trace_id,
                     message="成功发送 MQ 至 ETL",
                 )
+                return True
             else:
-                if float(video_dict['like_cnt']) / float(video_dict['play_cnt']) >= 0.04:
-                    self.mq.send_msg(video_dict)
-                    self.download_count += 1
-                    AliyunLogger.logging(
-                        code="1002",
-                        platform=self.platform,
-                        mode=self.mode,
-                        env=self.env,
-                        data=video_dict,
-                        trace_id=trace_id,
-                        message="成功发送 MQ 至 ETL",
+                AliyunLogger.logging(
+                    code="2008",
+                    platform=self.platform,
+                    mode=self.mode,
+                    env=self.env,
+                    message="不满足特殊规则, 播放量",
+                    data=video_dict
+                )
+            if float(video_dict['like_cnt']) / float(video_dict['play_cnt']) >= 0.04:
+                self.mq.send_msg(video_dict)
+                self.download_count += 1
+                AliyunLogger.logging(
+                    code="1002",
+                    platform=self.platform,
+                    mode=self.mode,
+                    env=self.env,
+                    data=video_dict,
+                    trace_id=trace_id,
+                    message="成功发送 MQ 至 ETL",
                     )
+                return True
+            else:
+                AliyunLogger.logging(
+                    code="2008",
+                    platform=self.platform,
+                    mode=self.mode,
+                    env=self.env,
+                    message="不满足特殊规则, 点赞量/播放量",
+                    data=video_dict
+                )
         return True
 
     def get_video_info(self, item_id, trace_id):