소스 검색

看一看 feed 修改规则

zhangyong 1 년 전
부모
커밋
30cb4dc794

+ 1 - 1
douyin/douyin_author/douyin_author_scheduling_new.py

@@ -161,7 +161,7 @@ class DouyinauthorScheduling:
                             continue
                         video_percent = '%.2f' % (share_count / digg_count)
                         if digg_count < 50000 and digg_count < 50:
-                            if video_percent < "0.01":
+                            if float(video_percent) < 0.01:
                                 Common.logger(log_type, crawler).info(f"不符合条件:分享/点赞-{video_percent},点赞量-{digg_count}\n")
                                 AliyunLogger.logging(
                                     code="2004",

+ 4 - 2
kanyikan/kanyikan_recommend/kanyikan_recommend_feed.py

@@ -105,10 +105,11 @@ class KanyikanRecommend:
             for i in range(len(feeds)):
                 vid = feeds[i].get("videoId", "")
                 shared_cnt = int(feeds[i].get("shared_cnt", 0))
+                liked_cnt = int(feeds[i].get("liked_cnt", 0))
                 playCount = int(feeds[i].get("playCount", 0))
-                video_percent = '%.2f' % (shared_cnt / playCount)
+                video_percent = '%.2f' % (liked_cnt / playCount)
                 if playCount < 100000:
-                    if float(video_percent) < 0.05 and playCount < 15000:
+                    if float(video_percent) < 0.01 and playCount < 10000:
                         Common.logger(log_type, crawler).info(f"分享/播放:{video_percent},播放量:{playCount}\n")
                         Common.logging(log_type, crawler, env, f"分享/播放:{video_percent},播放量:{playCount}\n")
                         continue
@@ -207,6 +208,7 @@ class KanyikanRecommend:
                         video_id = feeds[j].get("videoId", "")+"feed"
                         s_cnt = int(feeds[j].get("shared_cnt", 0))
                         p_count = int(feeds[j].get("playCount", 0))
+                        l_cnt = int(feeds[j].get("liked_cnt", 0))
                         if p_count < 100000:
                             if s_cnt < 200 and p_count < 15000:
                                 Common.logger(log_type, crawler).info(f"分享:{video_percent},播放量:{playCount}\n")

+ 1 - 1
kuaishou/kuaishou_author/kuaishou_author_scheduling_new.py

@@ -217,7 +217,7 @@ class KuaishouauthorScheduling:
                     realLikeCount = int(feeds[i].get('photo', {}).get('realLikeCount', 0))
                     video_percent = '%.2f' % (realLikeCount / viewCount)
                     if viewCount < 100000:
-                        if video_percent < "0.01":
+                        if float(video_percent) < 0.01:
                             Common.logger(log_type, crawler).info(f"不符合条件:点赞/播放-{video_percent},播放量-{viewCount}\n")
                             AliyunLogger.logging(
                                 code="2004",