Browse Source

视频号更改规则

zhangyong 10 tháng trước cách đây
mục cha
commit
57b7c9efa5
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      shipinhao/shipinhao_author/shipinhao_author.py

+ 4 - 3
shipinhao/shipinhao_author/shipinhao_author.py

@@ -237,9 +237,10 @@ class ShiPinHaoAuthor(object):
         }
         fav_count = int(obj['fav_count'])
         if fav_count == 0:
+            fav_count = 1
             divisor_cnt = 0
         else:
-            divisor_cnt = int(share_cnt / (fav_count+1))
+            divisor_cnt = int(share_cnt / fav_count)
         # 视频时长小于30秒 返回
         if duration < 20:
             values = [[
@@ -283,7 +284,7 @@ class ShiPinHaoAuthor(object):
             Feishu.update_values(self.platform, 'shipinhao', "Vq7NeH", "A2:Z2", values)
             return True
         # 分享小于等于99999
-        if share_cnt <= 99999 and divisor_cnt < 2:
+        if share_cnt <= 99999 and divisor_cnt < 1:
             values = [[
                 obj['nickname'],
                 publish_time_str,
@@ -385,7 +386,7 @@ if __name__ == "__main__":
 
         platform="shipinhao",
         mode="author",
-        user_dict={"uid": "123456", "link": "心血管王医生", "user_id": "1234565"},
+        user_dict={"uid": "123456", "link": "老赵讲育儿", "user_id": "1234565"},
         rule_dict={},
         env="prod",
     )