From a8e2ac11676fce72a634e9eaf143a6ba02b481bb Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Thu, 19 Jun 2025 08:34:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4item=5Freport?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=82=E6=95=B0=E4=B8=8E=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE=E6=AD=A3=E4=B8=BB=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96report=5Fvideo=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB.py | 4 ++-- report.py | 5 +++-- report_video.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DB.py b/DB.py index 1375a93..247b170 100644 --- a/DB.py +++ b/DB.py @@ -270,9 +270,9 @@ class DBVidcon: return result['parameter'] if result else None @redis_retry(max_retries=3) - def item_report(self, count: int = 20): + def item_report(self, count: int = 1): try: - items = self.fetch_from_redis(count, list_key=self.l0_list_key) + items = self.fetch_from_redis(count, list_key=self.report_list) except Exception as e: logger.info("[Redis l0 pop error]", e) self.reconnect_redis() diff --git a/report.py b/report.py index 98516ac..f9b8aaf 100644 --- a/report.py +++ b/report.py @@ -24,9 +24,10 @@ while True: # 处理主流程 if now - last_main_run >= MAIN_INTERVAL: last_main_run = now - lis = db.get_report_video() + lis = db.item_report() if len(lis) > 0: - for li in lis: + for _,li in lis: + print(li) logger.logger.info(f"name:{li['name_title']},link:{li['link']} ") try: info, report_id, status, report_ts = d.process_ticket(li['name_title'], li['link']) diff --git a/report_video.py b/report_video.py index 4fc68cd..6026bfb 100644 --- a/report_video.py +++ b/report_video.py @@ -92,7 +92,7 @@ class DailymotionClient: EMAIL = "copyright@qiyi.com" PASSWORD = "ppsIQIYI2018@" - def __init__(self, headless: bool = None): + def __init__(self,email, password, headless: bool = None): self.email = self.EMAIL self.password = self.PASSWORD self.headless = headless