فهرست منبع

feat:添加keywords监控

zhaohaipeng 1 ماه پیش
والد
کامیت
bb272bd554
2فایلهای تغییر یافته به همراه37 افزوده شده و 12 حذف شده
  1. 1 0
      enums/automation_job.py
  2. 36 12
      resource/monitor/mps_monitor.py

+ 1 - 0
enums/automation_job.py

@@ -11,6 +11,7 @@ class AutomationJobCronInfo(Enum):
     channel_image_search_topic_extend_top = ("channel_image_search_topic_extend", "top", 9)
     channel_image_search_video_all_cate_top = ("channel_image_search_video_all_cate", "top", 9)
     video_decode_accurate_text_top = ("video_decode_accurate_text", "top", 9)
+    keywords_top = ("keywords", "top", 9)
 
     def __init__(self, crawler_mode, video_source, task_start_hour):
         self.crawler_mode = crawler_mode

+ 36 - 12
resource/monitor/mps_monitor.py

@@ -6,7 +6,6 @@ from alibabacloud_mts20140618.models import ListJobRequest
 from alibabacloud_tea_openapi import models
 
 from resource.monitor.basic_monitor import BasicMonitor
-from util.thread_util import process_tasks
 
 
 def write_file(content: str, dt: str):
@@ -67,17 +66,42 @@ class MPSMonitor(BasicMonitor):
             access_key_secret=self.access_key_secret,
             endpoint="mts.cn-hangzhou.aliyuncs.com"
         )
-
-        today = datetime(2026, 1, 31, 0, 0, 0)
-        min_dt = datetime(2025, 12, 1, 0, 0, 0)
-        tasks = []
-        for i in range(0, 1000):
-            download_dt = today - timedelta(days=i)
-            if download_dt < min_dt:
-                break
-            tasks.append(lambda dt=download_dt, client=MTSClient(config): self.download_date(dt, client))
-
-        process_tasks(tasks, 15)
+        # client = MTSClient(config)
+        # template_ids = ["02ace648c50f4136afb546adede4eb49",
+        #                 "19d56171d13b4b679bc057eb42b6563f",
+        #                 "295ce1741a3e470983c7e1cf303f382e",
+        #                 "794661a4f1384f6e9642da02f3190313",
+        #                 "9ad1268fce31499884e2d440105ae51e",
+        #                 "a7c5593789644fa1a010b579557e7fe2",
+        #                 "adfcf35bdf3745c18d739dcb08428a80",
+        #                 "b2098fcbc5534cce9c90d32fc5d5124c",
+        #                 "bacabb6700564672804d8a84a07531eb",
+        #                 "cb8429acf24544ff9bada946bc23e643",
+        #                 "cc963a743d2140f083cace98a02b83b6",
+        #                 "d34dfbd6ed944eeaad0555f212159eb3",
+        #                 "e19880ead9ac477bbad75680bd400847",
+        #                 "f4f25f0668db49c5805c823c61d011a5",
+        #                 "fcaace386e4241fabddef70e3ce0d2cb"
+        #                 ]
+        # print("模板ID,模板名,编解码格式,宽*高,编码级别")
+        # for template_id in template_ids:
+        #     request = QueryTemplateListRequest(
+        #         template_ids=template_id
+        #     )
+        #     response = client.query_template_list(request)
+        #     for template in response.body.template_list.template:
+        #         print(f"{template.id},{template.name},{template.video.codec},{template.video.width}*{template.video.height},{template.video.profile}")
+        # today = datetime(2026, 1, 31, 0, 0, 0)
+        # min_dt = datetime(2025, 12, 1, 0, 0, 0)
+        # tasks = []
+        # for i in range(0, 1000):
+        #     download_dt = today - timedelta(days=i)
+        #     if download_dt < min_dt:
+        #         break
+        #     tasks.append(lambda dt=download_dt, client=MTSClient(config): self.download_date(dt, client))
+        #
+        # process_tasks(tasks, 15)
+        # self.download_date(dt=datetime(2026, 2, 10, 0, 0, 0), client=MTSClient(config))
 
 
 if __name__ == '__main__':