Browse Source

bug fix
增加异常code: 1015,发布失败,直接设置为审核不通过

luojunhui 6 months ago
parent
commit
2b32ac4f6f
2 changed files with 10 additions and 0 deletions
  1. 1 0
      applications/const.py
  2. 9 0
      coldStartTasks/publish/publish_video_to_pq_for_audit.py

+ 1 - 0
applications/const.py

@@ -103,6 +103,7 @@ class WeixinVideoCrawlerConst:
 
     # 接口请求成功code
     REQUEST_SUCCESS = 0
+    PUBLISHED_ILLEGAL_TITLE_CODE = 1015
 
     # 是否需要扫描查询源账号
     NEED_SCAN_SOURCE_ACCOUNT = 1

+ 9 - 0
coldStartTasks/publish/publish_video_to_pq_for_audit.py

@@ -113,6 +113,15 @@ class PublishVideosForAudit(object):
                 }
                 return result
         else:
+            if response_json.get("code") == const.PUBLISHED_ILLEGAL_TITLE_CODE:
+                # 发布了标题违规的视频,发布失败, 修改审核状态从0-->2
+                update_sql = f"""
+                    UPDATE publish_single_video_source
+                    SET audit_status = %s 
+                    WHERE id = %s and audit_status = %s;
+                """
+                self.db.update(update_sql, params=(const.VIDEO_AUDIT_FAIL_STATUS, video_obj['id'], const.VIDEO_AUDIT_INIT_STATUS))
+
             result = {
                 "status": "fail",
                 "error_msg": "发布到pq失败",