Skip to content

Commit

Permalink
Merge pull request #1117 from yajiwa/main
Browse files Browse the repository at this point in the history
更新b站转发解析
  • Loading branch information
HibiKier authored Sep 27, 2022
2 parents 8cf589e + 7f4aa51 commit 821fe21
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/parse_bilibili_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from nonebot import on_message
from services.log import logger
from nonebot.adapters.onebot.v11 import GroupMessageEvent, ActionFailed

from utils.manager import group_manager
from utils.utils import get_message_json, get_local_proxy, is_number, get_message_text
from nonebot.adapters.onebot.v11.permission import GROUP
from utils.message_builder import image
Expand Down Expand Up @@ -34,7 +36,10 @@
)


parse_bilibili_json = on_message(priority=1, permission=GROUP, block=False)
async def plugin_on_checker(event: GroupMessageEvent) -> bool:
return group_manager.get_plugin_status("parse_bilibili_json", event.group_id)

parse_bilibili_json = on_message(priority=1, permission=GROUP, block=False, rule=plugin_on_checker)

_tmp = {}

Expand Down Expand Up @@ -124,7 +129,7 @@ async def _(event: GroupMessageEvent):
url,
timeout=7,
) as response:
url = str(response.url).split("?")[0]
url = (str(response.url).split("?")[0]).strip("/")
bvid = url.split("/")[-1]
vd_info = await video.get_video_base_info(bvid)
if vd_info:
Expand Down

0 comments on commit 821fe21

Please sign in to comment.