From e7ff55fa0b39805ec759afd5b06c666538f5c7f1 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Thu, 17 Feb 2022 16:45:48 +0000 Subject: =?UTF-8?q?:rotating=5Flight:=20=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/applet/__init__.py | 2 +- ATRI/plugins/applet/data_source.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ATRI/plugins') diff --git a/ATRI/plugins/applet/__init__.py b/ATRI/plugins/applet/__init__.py index 233df3e..8d89514 100644 --- a/ATRI/plugins/applet/__init__.py +++ b/ATRI/plugins/applet/__init__.py @@ -14,7 +14,7 @@ async def _(event: MessageEvent): result, is_ok = await Applet().msg_builder(msg) except Exception: return - + if not is_ok: return diff --git a/ATRI/plugins/applet/data_source.py b/ATRI/plugins/applet/data_source.py index d2b5151..3fc1bc5 100644 --- a/ATRI/plugins/applet/data_source.py +++ b/ATRI/plugins/applet/data_source.py @@ -47,7 +47,7 @@ class Applet(Service): pattern = re.compile(r"BV[0-9A-Za-z]{10}") result = pattern.findall(text) return result[0] if result else "" - + @classmethod async def msg_builder(cls, text: str) -> tuple: bv = cls.bili_video_code_catcher(text) @@ -61,10 +61,10 @@ class Applet(Service): rep = await cls.bili_request(u) bv = cls.bili_video_code_catcher(rep) av = cls._bv_dec(bv) - + else: av = cls._bv_dec(bv) - + url = URL + av req = await request.get(url) res_data = req.json() -- cgit v1.2.3