From d9491c7afa4c32dadeeead6165d887852d138e5e Mon Sep 17 00:00:00 2001 From: Yuki-Asuuna <10174503104@stu.ecnu.edu.cn> Date: Tue, 31 May 2022 09:18:35 +0800 Subject: =?UTF-8?q?feat:=20bilibili=E5=8A=A8=E6=80=81=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=B7=BB=E5=8A=A0URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/bilibili_dynamic/data_source.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ATRI/plugins/bilibili_dynamic') diff --git a/ATRI/plugins/bilibili_dynamic/data_source.py b/ATRI/plugins/bilibili_dynamic/data_source.py index a419b45..4ee6500 100644 --- a/ATRI/plugins/bilibili_dynamic/data_source.py +++ b/ATRI/plugins/bilibili_dynamic/data_source.py @@ -11,7 +11,6 @@ import asyncio from typing import Any from operator import itemgetter - __session_pool = {} @@ -55,13 +54,13 @@ def get_session(): async def bilibili_request( - method: str, - url: str, - params: dict = dict(), - data: Any = None, - no_csrf: bool = False, - json_body: bool = False, - **kwargs, + method: str, + url: str, + params: dict = dict(), + data: Any = None, + no_csrf: bool = False, + json_body: bool = False, + **kwargs, ) -> dict: """ 向接口发送请求。 @@ -337,11 +336,12 @@ class BilibiliDynamicSubscriptor(Service): def generate_output(self, pattern: dict) -> tuple: # 限制摘要的字数 abstractLimit = 40 - text_part = """【UP名称】{name}\n【动态类型】{dynamic_type}\n【时间】{time}\n【内容摘要】{content}\n""".format( + text_part = """【UP名称】{name}\n【动态类型】{dynamic_type}\n【时间】{time}\n【内容摘要】{content}\n【链接】{url}\n""".format( name=pattern["name"], dynamic_type=pattern["type_zh"], time=pattern["time"], content=pattern["content"][:abstractLimit], + url="https://t.bilibili.com/" + str(pattern["dynamic_id"]), ) pic_part = pattern["pic"] return text_part, pic_part -- cgit v1.2.3