mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
fix b23.tv bug
This commit is contained in:
parent
ab06e38b7c
commit
d2aae0103d
@ -246,6 +246,7 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__
|
|||||||
### 2022/7/16
|
### 2022/7/16
|
||||||
|
|
||||||
* cos提供连发命令
|
* cos提供连发命令
|
||||||
|
* 修复B站视频解析中b23解析错误
|
||||||
|
|
||||||
### 2022/7/13
|
### 2022/7/13
|
||||||
|
|
||||||
|
|||||||
@ -56,18 +56,11 @@ async def _(event: GroupMessageEvent):
|
|||||||
) as session:
|
) as session:
|
||||||
async with session.get(
|
async with session.get(
|
||||||
data["meta"]["detail_1"]["qqdocurl"],
|
data["meta"]["detail_1"]["qqdocurl"],
|
||||||
proxy=get_local_proxy(),
|
|
||||||
timeout=7,
|
timeout=7,
|
||||||
) as response:
|
) as response:
|
||||||
url = str(response.url).split("?")[0]
|
url = str(response.url).split("?")[0]
|
||||||
bvid = url.split("/")[-1]
|
bvid = url.split("/")[-1]
|
||||||
vd_info = await video.get_video_base_info(bvid)
|
vd_info = await video.get_video_base_info(bvid)
|
||||||
# response = await AsyncHttpx.get(
|
|
||||||
# data["meta"]["detail_1"]["qqdocurl"], timeout=7
|
|
||||||
# )
|
|
||||||
# url = str(response.url).split("?")[0]
|
|
||||||
# bvid = url.split("/")[-1]
|
|
||||||
# vd_info = await video.Video(bvid=bvid).get_info()
|
|
||||||
# 转发专栏
|
# 转发专栏
|
||||||
if (
|
if (
|
||||||
data.get("meta")
|
data.get("meta")
|
||||||
@ -123,11 +116,17 @@ async def _(event: GroupMessageEvent):
|
|||||||
url = f"https://www.bilibili.com/video/{msg}"
|
url = f"https://www.bilibili.com/video/{msg}"
|
||||||
vd_info = await video.get_video_base_info(msg)
|
vd_info = await video.get_video_base_info(msg)
|
||||||
elif "https://b23.tv" in msg:
|
elif "https://b23.tv" in msg:
|
||||||
url = "https://" + msg[msg.find("b23.tv") : msg.find("b23.tv") + 13]
|
url = "https://" + msg[msg.find("b23.tv"): msg.find("b23.tv") + 14]
|
||||||
res = await AsyncHttpx.get(url, timeout=7)
|
async with aiohttp.ClientSession(
|
||||||
url = str(res.url).split("?")[0]
|
headers=get_user_agent()
|
||||||
bvid = url.split("/")[-1]
|
) as session:
|
||||||
vd_info = await video.get_video_base_info(bvid)
|
async with session.get(
|
||||||
|
url,
|
||||||
|
timeout=7,
|
||||||
|
) as response:
|
||||||
|
url = str(response.url).split("?")[0]
|
||||||
|
bvid = url.split("/")[-1]
|
||||||
|
vd_info = await video.get_video_base_info(bvid)
|
||||||
if vd_info:
|
if vd_info:
|
||||||
if (
|
if (
|
||||||
url in _tmp.keys() and time.time() - _tmp[url] > 30
|
url in _tmp.keys() and time.time() - _tmp[url] > 30
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user