瀏覽代碼

优化速度,嘎嘎快

wangkun 3 年之前
父節點
當前提交
569dd88445
共有 5 個文件被更改,包括 380 次插入56 次删除
  1. 2 0
      main/common.py
  2. 45 55
      main/hour_list.py
  3. 324 0
      main/play_list.py
  4. 6 1
      main/run_hour_list.py
  5. 3 0
      main/run_play_list.py

+ 2 - 0
main/common.py

@@ -42,6 +42,8 @@ class Common:
             log_name = time.strftime("%Y-%m-%d", time.localtime(time.time())) + '-xiaoniangao-hour.log'
         elif log_type == "person":
             log_name = time.strftime("%Y-%m-%d", time.localtime(time.time())) + '-xiaoniangao-person.log'
+        elif log_type == "play":
+            log_name = time.strftime("%Y-%m-%d", time.localtime(time.time())) + '-xiaoniangao-play.log'
         else:
             log_name = time.strftime("%Y-%m-%d", time.localtime(time.time())) + '-xiaoniangao.log'
 

+ 45 - 55
main/hour_list.py

@@ -319,7 +319,7 @@ class HourList:
                         time.sleep(1)
 
                     # 从云文档去重:https://w42nne6hzg.feishu.cn/sheets/shtcnYxiyQ1wLklo1W5Kdqc9cGh?sheet=ba0da4
-                    elif video_id in [j for i in cls.hour_sheet for j in i]:
+                    elif video_id in [j for i in Feishu.get_values_batch("hour", "xiaoniangao", "ba0da4") for j in i]:
                         Common.logger(log_type).info("该视频已保存过:{}", video_title)
                         time.sleep(1)
                     else:
@@ -356,41 +356,41 @@ class HourList:
         更新小时榜数据
         """
         try:
-            time.sleep(1)
-            if len(cls.hour_sheet) == 2:
+            update_hour_sheet = Feishu.get_values_batch("hour", "xiaoniangao", "ba0da4")
+            if len(update_hour_sheet) == 2:
                 Common.logger(log_type).info("当前工作表无数据")
             else:
                 time.sleep(1)
-                for i in range(3, len(cls.hour_sheet)+1):
+                for i in range(3, len(update_hour_sheet)+1):
                     time.sleep(1)
                     Common.logger(log_type).info("更新第:{}行视频信息", i)
 
                     # 略过空行
-                    if cls.hour_sheet[i][0] is None or cls.hour_sheet[i][1] is None or cls.hour_sheet[i][2] is None:
+                    if update_hour_sheet[i][0] is None or update_hour_sheet[i][1] is None or update_hour_sheet[i][2] is None:
                         Common.logger(log_type).info("空行,略过")
                     else:
                         # 视频标题
-                        v_title = cls.hour_sheet[i][3]
+                        v_title = update_hour_sheet[i][3]
                         Common.logger(log_type).info("video_title:{}", v_title)
 
                         # 视频 ID
-                        v_id = cls.hour_sheet[i][2]
+                        v_id = update_hour_sheet[i][2]
                         Common.logger(log_type).info("video_id:{}", v_id)
 
                         # profile_id,用户 ID
-                        p_id = cls.hour_sheet[i][0]
+                        p_id = update_hour_sheet[i][0]
                         Common.logger(log_type).info("profile_id:{}", p_id)
 
                         # profile_mid
-                        p_mid = cls.hour_sheet[i][1]
+                        p_mid = update_hour_sheet[i][1]
                         Common.logger(log_type).info("profile_mid:{}", p_mid)
 
                         # 抓取时的播放量
-                        v_play_cnt = cls.hour_sheet[i][10]
+                        v_play_cnt = update_hour_sheet[i][10]
                         Common.logger(log_type).info("video_play_cnt:{}", v_play_cnt)
 
                         # 抓取时间
-                        v_upload_time = cls.hour_sheet[i][9]
+                        v_upload_time = update_hour_sheet[i][9]
                         Common.logger(log_type).info("video_send_time:{}", v_upload_time)
                         # 抓取时间的时间戳格式(秒为单位)
                         v_time = int(time.mktime(time.strptime(v_upload_time, "%Y-%m-%d %H:%M:%S")))
@@ -483,10 +483,10 @@ class HourList:
                                 Common.logger(log_type).info("当天 15:00 视频播放量:{}", fifteen_hour_play_cnt)
 
                                 # 当天 10:00 上升的数据
-                                if cls.hour_sheet[i][11] is None:
+                                if update_hour_sheet[i][11] is None:
                                     ten_up_cnt = 0
                                 else:
-                                    ten_up_cnt = cls.hour_sheet[i][11]
+                                    ten_up_cnt = update_hour_sheet[i][11]
 
                                 # 15:00 的上升榜写入数据
                                 values = int(fifteen_hour_play_cnt) - (int(v_play_cnt) + int(ten_up_cnt))
@@ -517,18 +517,16 @@ class HourList:
                                 Common.logger(log_type).info("当天 20:00 视频播放量:{}", twenty_hour_play_cnt)
 
                                 # 当天 10:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][11] is None:
+                                if update_hour_sheet[i][11] is None:
                                     ten_up_cnt = 0
                                 else:
-                                    ten_up_cnt = cls.hour_sheet[i][11]
+                                    ten_up_cnt = update_hour_sheet[i][11]
 
                                 # 当天 15:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][12] is None:
+                                if update_hour_sheet[i][12] is None:
                                     fifteen_up_cnt = 0
                                 else:
-                                    fifteen_up_cnt = cls.hour_sheet[i][12]
+                                    fifteen_up_cnt = update_hour_sheet[i][12]
 
                                 # 20:00 的上升榜写入数据
                                 values = int(twenty_hour_play_cnt) - (
@@ -546,11 +544,10 @@ class HourList:
                                 Common.logger(log_type).info("当天 20:00 视频播放量:{}", twenty_hour_play_cnt)
 
                                 # 当天 15:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][12] is None:
+                                if update_hour_sheet[i][12] is None:
                                     fifteen_up_cnt = 0
                                 else:
-                                    fifteen_up_cnt = cls.hour_sheet[i][12]
+                                    fifteen_up_cnt = update_hour_sheet[i][12]
 
                                 # 20:00 的上升榜写入数据
                                 values = int(twenty_hour_play_cnt) - (int(v_play_cnt) + int(fifteen_up_cnt))
@@ -597,11 +594,10 @@ class HourList:
                                 Common.logger(log_type).info("当天 15:00 视频播放量:{}", fifteen_hour_play_cnt)
 
                                 # 当天 10:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][11] is None:
+                                if update_hour_sheet[i][11] is None:
                                     ten_up_cnt = 0
                                 else:
-                                    ten_up_cnt = cls.hour_sheet[i][11]
+                                    ten_up_cnt = update_hour_sheet[i][11]
 
                                 # 15:00 的上升榜写入数据
                                 values = int(fifteen_hour_play_cnt) - (int(v_play_cnt) + int(ten_up_cnt))
@@ -619,18 +615,16 @@ class HourList:
                                 Common.logger(log_type).info("当天 20:00 视频播放量:{}", twenty_hour_play_cnt)
 
                                 # 当天 10:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][11] is None:
+                                if update_hour_sheet[i][11] is None:
                                     ten_up_cnt = 0
                                 else:
-                                    ten_up_cnt = cls.hour_sheet[i][11]
+                                    ten_up_cnt = update_hour_sheet[i][11]
 
                                 # 当天 15:00 上升的数据
-                                time.sleep(1)
-                                if cls.hour_sheet[i][12] is None:
+                                if update_hour_sheet[i][12] is None:
                                     fifteen_up_cnt = 0
                                 else:
-                                    fifteen_up_cnt = cls.hour_sheet[i][12]
+                                    fifteen_up_cnt = update_hour_sheet[i][12]
 
                                 # 20:00 的上升榜写入数据
                                 values = int(twenty_hour_play_cnt) - (
@@ -658,67 +652,62 @@ class HourList:
         3.上传
         """
         try:
-            time.sleep(1)
-            if len(cls.hour_sheet) == 2:
+            download_hour_sheet = Feishu.get_values_batch("hour", "xiaoniangao", "ba0da4")
+            if len(download_hour_sheet) == 2:
                 Common.logger(log_type).info("当前工作表无数据")
             else:
                 time.sleep(1)
-                for i in range(3, len(cls.hour_sheet)+1):
+                for i in range(3, len(download_hour_sheet)+1):
                     time.sleep(1)
                     Common.logger(log_type).info("分析第:{}行视频信息是否符合下载规则", i)
 
                     # 略过空行
-                    if cls.hour_sheet[i][0] is None or cls.hour_sheet[i][1] is None or cls.hour_sheet[i][2] is None:
+                    if download_hour_sheet[i][0] is None or download_hour_sheet[i][1] is None or download_hour_sheet[i][2] is None:
                         Common.logger(log_type).info("空行,略过")
                     else:
                         # 今日 10:00 数据上升量
-                        time.sleep(1)
-                        if cls.hour_sheet[i][11] is None:
+                        if download_hour_sheet[i][11] is None:
                             ten_cnt = 0
                         else:
-                            ten_cnt = cls.hour_sheet[i][11]
+                            ten_cnt = download_hour_sheet[i][11]
                         # 今日 15:00 数据上升量
-                        time.sleep(1)
-                        if cls.hour_sheet[i][12] is None:
+                        if download_hour_sheet[i][12] is None:
                             fifteen_cnt = 0
                         else:
-                            fifteen_cnt = cls.hour_sheet[i][12]
+                            fifteen_cnt = download_hour_sheet[i][12]
                         # 今日 20:00 数据上升量
-                        time.sleep(1)
-                        if cls.hour_sheet[i][13] is None:
+                        if download_hour_sheet[i][13] is None:
                             twenty_cnt = 0
                         else:
-                            twenty_cnt = cls.hour_sheet[i][13]
+                            twenty_cnt = download_hour_sheet[i][13]
                         # 昨日 20:00 数据上升量
-                        time.sleep(1)
-                        if cls.hour_sheet[i][16] is None:
+                        if download_hour_sheet[i][16] is None:
                             yesterday_twenty_cnt = 0
                         else:
-                            yesterday_twenty_cnt = cls.hour_sheet[i][16]
+                            yesterday_twenty_cnt = download_hour_sheet[i][16]
 
                         # 视频标题
-                        v_title = cls.hour_sheet[i][3]
+                        v_title = download_hour_sheet[i][3]
                         Common.logger(log_type).info("video_title:{}", v_title)
 
                         # 视频 ID
-                        v_id = cls.hour_sheet[i][2]
+                        v_id = download_hour_sheet[i][2]
                         Common.logger(log_type).info("video_id:{}", v_id)
 
                         # profile_id,用户 ID
-                        p_id = cls.hour_sheet[i][0]
+                        p_id = download_hour_sheet[i][0]
 
                         # 视频时长
-                        v_duration = cls.hour_sheet[i][5]
+                        v_duration = download_hour_sheet[i][5]
 
                         # profile_mid
-                        p_mid = cls.hour_sheet[i][1]
+                        p_mid = download_hour_sheet[i][1]
 
                         Common.logger(log_type).info("10:00 / 15:00 / 20:00 上升量: {} / {} / {}",
                                                      ten_cnt, fifteen_cnt, twenty_cnt)
 
                         # 发布时间
-                        time.sleep(1)
-                        v_upload_time = cls.hour_sheet[i][8]
+                        v_upload_time = download_hour_sheet[i][8]
                         v_send_time = int(time.mktime(time.strptime(v_upload_time, "%Y-%m-%d %H:%M:%S")))
 
                         # # 判断视频 ID 长度,不大于 13 位
@@ -1374,4 +1363,5 @@ if __name__ == "__main__":
     #     today=datetime.datetime.now().strftime("%Y-%m-%d"),
     #     yesterday=(datetime.date.today() + datetime.timedelta(days=-1)).strftime("%Y-%m-%d"),
     #     before_yesterday=(datetime.date.today() + datetime.timedelta(days=-2)).strftime("%Y-%m-%d"))
-    hour_list.download_and_publish("hour")
+    # hour_list.download_and_publish("hour")
+    hour_list.update_hour_list_data("hour", "2022-07-01", "2022-06-30", "2022-06-29")

+ 324 - 0
main/play_list.py

@@ -0,0 +1,324 @@
+# -*- coding: utf-8 -*-
+# @Author: wangkun
+# @Time: 2022/7/1
+import os
+import sys
+import time
+import requests
+import urllib3
+sys.path.append(os.getcwd())
+from main.common import Common
+from main.feishu_lib import Feishu
+proxies = {"http": None, "https": None}
+
+
+class PlayList:
+    # 配置微信
+    wechat_sheet = Feishu.get_values_batch("hour", "xiaoniangao", "dzcWHw")
+    hour_x_b3_traceid = wechat_sheet[2][1]
+    hour_x_token_id = wechat_sheet[3][1]
+    hour_referer = wechat_sheet[4][1]
+    hour_uid = wechat_sheet[5][1]
+    hour_token = wechat_sheet[6][1]
+
+    # 过滤敏感词
+    @classmethod
+    def sensitive_words(cls, log_type):
+        # 敏感词库列表
+        word_list = []
+        # 从云文档读取所有敏感词,添加到词库列表
+        time.sleep(1)
+        lists = Feishu.get_values_batch(log_type, "xiaoniangao", "DRAnZh")
+        for i in lists:
+            for j in i:
+                # 过滤空的单元格内容
+                if j is None:
+                    pass
+                else:
+                    word_list.append(j)
+        return word_list
+
+    # 视频ID过滤字母
+    @classmethod
+    def sensitive_videoid_words(cls):
+        # 字母列表
+        words_list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
+                      "t", "u", "v", "w", "x", "y", "z",
+                      "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
+                      "T", "U", "V", "W", "X", "Y", "Z"]
+        return words_list
+
+    # 基础门槛规则
+    @staticmethod
+    def download_rule(d_duration, d_width, d_height, d_play_cnt, d_like_cnt, d_share_cnt, d_send_time):
+        """
+        下载视频的基本规则
+        :param d_duration: 时长
+        :param d_width: 宽
+        :param d_height: 高
+        :param d_play_cnt: 播放量
+        :param d_like_cnt: 点赞量
+        :param d_share_cnt: 分享量
+        :param d_send_time: 发布时间
+        :return: 满足规则,返回 True;反之,返回 False
+        """
+        # 视频时长
+        if int(float(d_duration)) >= 40:
+            # 宽或高
+            if int(d_width) >= 0 or int(d_height) >= 0:
+                # 播放量
+                if int(d_play_cnt) >= 100000:
+                    # 点赞量
+                    if int(d_like_cnt) >= 0:
+                        # 分享量
+                        if int(d_share_cnt) >= 0:
+                            # 发布时间 <= 7 天
+                            if int(time.time()) - int(d_send_time) / 1000 <= 604800:
+                                return True
+                            else:
+                                return False
+                        else:
+                            return False
+                    else:
+                        return False
+                else:
+                    return False
+            return False
+        return False
+
+    # 获取列表
+    @classmethod
+    def get_hour_list_feeds(cls, log_type):
+        """
+        1.从列表获取视频,7 天内,播放量>=5000
+        2.时长 1-10min
+        3.每天10:00、15:00、20:00 把符合规则的视频,写入云文档
+        https://w42nne6hzg.feishu.cn/sheets/shtcnYxiyQ1wLklo1W5Kdqc9cGh?sheet=ba0da4
+        """
+        url = "https://kapi.xiaoniangao.cn/trends/get_recommend_trends"
+        headers = {
+            "x-b3-traceid": cls.hour_x_b3_traceid,
+            "X-Token-Id": cls.hour_x_token_id,
+            "uid": cls.hour_uid,
+            "content-type": "application/json",
+            "Accept-Encoding": "gzip,compress,br,deflate",
+            "User-Agent": 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X)'
+                          ' AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 '
+                          'MicroMessenger/8.0.20(0x18001432) NetType/WIFI Language/zh_CN',
+            "Referer": cls.hour_referer
+        }
+        data = {
+            "log_params": {
+                "page": "discover_rec",
+                "common": {
+                    "brand": "iPhone",
+                    "device": "iPhone 11",
+                    "os": "iOS 14.7.1",
+                    "weixinver": "8.0.20",
+                    "srcver": "2.24.2",
+                    "net": "wifi",
+                    "scene": 1089
+                }
+            },
+            "qs": "imageMogr2/gravity/center/rotate/$/thumbnail/!750x500r/crop/750x500/interlace/1/format/jpg",
+            "h_qs": "imageMogr2/gravity/center/rotate/$/thumbnail/!80x80r/crop/80x80/interlace/1/format/jpg",
+            "share_width": 625,
+            "share_height": 500,
+            "ext": {
+                "fmid": 0,
+                "items": {}
+            },
+            "app": "xng",
+            "rec_scene": "discover_rec",
+            "log_common_params": {
+                "e": [{
+                    "data": {
+                        "page": "discoverIndexPage",
+                        "topic": "recommend"
+                    },
+                    "ab": {}
+                }],
+                "ext": {
+                    "brand": "iPhone",
+                    "device": "iPhone 11",
+                    "os": "iOS 14.7.1",
+                    "weixinver": "8.0.20",
+                    "srcver": "2.24.3",
+                    "net": "wifi",
+                    "scene": "1089"
+                },
+                "pj": "1",
+                "pf": "2",
+                "session_id": "7bcce313-b57d-4305-8d14-6ebd9a1bad29"
+            },
+            "refresh": False,
+            "token": cls.hour_token,
+            "uid": cls.hour_uid,
+            "proj": "ma",
+            "wx_ver": "8.0.20",
+            "code_ver": "3.62.0"
+        }
+        try:
+            urllib3.disable_warnings()
+            r = requests.post(url=url, headers=headers, json=data, proxies=proxies, verify=False)
+            if "data" not in r.json():
+                Common.logger(log_type).warning("获取视频feeds错误:{}", r.text)
+            elif "list" not in r.json()["data"]:
+                Common.logger(log_type).warning("获取视频feeds无数据,休眠10s:{}", r.json()["data"])
+            else:
+                # 视频列表数据
+                feeds = r.json()["data"]["list"]
+                for i in range(len(feeds)):
+                    # 标题
+                    if "title" in feeds[i]:
+                        video_title = feeds[i]["title"].strip().replace("\n", "") \
+                            .replace("/", "").replace("\r", "").replace("#", "") \
+                            .replace(".", "。").replace("\\", "").replace("&NBSP", "") \
+                            .replace(":", "").replace("*", "").replace("?", "") \
+                            .replace("?", "").replace('"', "").replace("<", "") \
+                            .replace(">", "").replace("|", "").replace(" ", "")
+                    else:
+                        video_title = 0
+
+                    # 视频 ID
+                    if "vid" in feeds[i]:
+                        video_id = feeds[i]["vid"]
+                    else:
+                        video_id = 0
+
+                    # 播放量
+                    if "play_pv" in feeds[i]:
+                        video_play_cnt = feeds[i]["play_pv"]
+                    else:
+                        video_play_cnt = 0
+
+                    # 点赞量
+                    if "favor" in feeds[i]:
+                        video_like_cnt = feeds[i]["favor"]["total"]
+                    else:
+                        video_like_cnt = 0
+
+                    # 分享量
+                    if "share" in feeds[i]:
+                        video_share_cnt = feeds[i]["share"]
+                    else:
+                        video_share_cnt = 0
+
+                    # # 评论量
+                    # if "comment_count" in feeds[i]:
+                    #     video_comment_cnt = feeds[i]["comment_count"]
+                    # else:
+                    #     video_comment_cnt = 0
+
+                    # 时长
+                    if "du" in feeds[i]:
+                        video_duration = int(feeds[i]["du"] / 1000)
+                    else:
+                        video_duration = 0
+
+                    # 宽和高
+                    if "w" or "h" in feeds[i]:
+                        video_width = feeds[i]["w"]
+                        video_height = feeds[i]["h"]
+                    else:
+                        video_width = 0
+                        video_height = 0
+
+                    # 发布时间
+                    if "t" in feeds[i]:
+                        video_send_time = feeds[i]["t"]
+                    else:
+                        video_send_time = 0
+
+                    # 用户名 / 头像
+                    if "user" in feeds[i]:
+                        user_name = feeds[i]["user"]["nick"].strip().replace("\n", "") \
+                            .replace("/", "").replace("快手", "").replace(" ", "") \
+                            .replace(" ", "").replace("&NBSP", "").replace("\r", "")
+                        head_url = feeds[i]["user"]["hurl"]
+                    else:
+                        user_name = 0
+                        head_url = 0
+
+                    # 用户 ID
+                    profile_id = feeds[i]["id"]
+
+                    # 用户 mid
+                    profile_mid = feeds[i]["user"]["mid"]
+
+                    # 视频封面
+                    if "url" in feeds[i]:
+                        cover_url = feeds[i]["url"]
+                    else:
+                        cover_url = 0
+
+                    # 视频播放地址
+                    if "v_url" in feeds[i]:
+                        video_url = feeds[i]["v_url"]
+                    else:
+                        video_url = 0
+
+                    Common.logger(log_type).info("标题:{}", video_title)
+                    Common.logger(log_type).info("视频ID:{}", video_id)
+                    Common.logger(log_type).info("播放量:{}", video_play_cnt)
+                    # Common.logger(log_type).info("点赞量:{}", video_like_cnt)
+                    # Common.logger(log_type).info("分享量:{}", video_share_cnt)
+                    # Common.logger(log_type).info("评论数:{}", video_comment_cnt)
+                    Common.logger(log_type).info("时长:{}秒", video_duration)
+                    # Common.logger(log_type).info("宽高:{}*{}", video_width, video_height)
+                    Common.logger(log_type).info(
+                        "视频发布时间:{}", time.strftime(
+                            "%Y-%m-%d %H:%M:%S", time.localtime(int(video_send_time) / 1000)))
+                    Common.logger(log_type).info("用户名:{}", user_name)
+                    # Common.logger(log_type).info("用户头像:{}", head_url)
+                    # Common.logger(log_type).info("封面:{}", cover_url)
+                    Common.logger(log_type).info("播放地址:{}", video_url)
+
+                    # 过滤无效视频
+                    if video_title == 0 or video_id == 0 or video_duration == 0 \
+                            or video_send_time == 0 or user_name == 0 or head_url == 0 \
+                            or cover_url == 0 or video_url == 0:
+                        Common.logger(log_type).warning("无效视频")
+
+                    elif cls.download_rule(video_duration, video_width, video_height, video_play_cnt,
+                                           video_like_cnt, video_share_cnt, video_send_time) is False:
+                        Common.logger(log_type).info("不满足基础门槛规则")
+
+                    # 过滤敏感词
+                    elif any(word if word in video_title else False for word in
+                             cls.sensitive_words(log_type)) is True:
+                        Common.logger(log_type).info("视频已中敏感词:{}".format(video_title))
+                        time.sleep(1)
+
+                    # 从云文档中去重:https://w42nne6hzg.feishu.cn/sheets/shtcnYxiyQ1wLklo1W5Kdqc9cGh?sheet=yatRv2
+                    elif video_id in [j for i in Feishu.get_values_batch(log_type, "xiaoniangao", "yatRv2") for j in
+                                      i]:
+                        Common.logger(log_type).info("该视频已下载:{}", video_title)
+                        time.sleep(1)
+
+                    else:
+                        Common.logger(log_type).info("该视频未下载,添加至feeds中:{}".format(video_title))
+                        # feeds工作表,插入空行
+                        time.sleep(1)
+                        Feishu.insert_columns(log_type, "xiaoniangao", "ba0da4", "ROWS", 2, 3)
+
+                        # 获取当前时间
+                        get_feeds_time = int(time.time())
+                        # 看一看云文档,工作表中写入数据
+                        values = [[profile_id,
+                                   profile_mid,
+                                   video_id,
+                                   video_title,
+                                   user_name,
+                                   video_duration,
+                                   cover_url,
+                                   video_url,
+                                   time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(video_send_time) / 1000)),
+                                   str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(get_feeds_time))),
+                                   video_play_cnt]]
+                        # 等待 1s,防止操作云文档太频繁,导致报错
+                        time.sleep(1)
+                        Feishu.update_values(log_type, "xiaoniangao", "ba0da4", "A3:K3", values)
+
+        except Exception as e:
+            Common.logger(log_type).error("获取小时榜视频列表异常:{}", e)

+ 6 - 1
main/run_hour_list.py

@@ -53,5 +53,10 @@ def hour_list_job():
                 break
 
 
+def run_update_hour_list():
+    HourList.update_hour_list_data("hour", "2022-07-01", "2022-06-30", "2022-06-29")
+
+
 if __name__ == "__main__":
-    hour_list_job()
+    # hour_list_job()
+    run_update_hour_list()

+ 3 - 0
main/run_play_list.py

@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+# @Author: wangkun
+# @Time: 2022/7/1