diff --git a/plugins/bt/data_source.py b/plugins/bt/data_source.py index 5984e8fb..8644cfd0 100755 --- a/plugins/bt/data_source.py +++ b/plugins/bt/data_source.py @@ -9,7 +9,7 @@ import platform # asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) -url = "http://www.eclzz.zone/" +url = "http://www.eclzz.plus" async def get_bt_info(keyword: str, page: int): diff --git a/plugins/coser/__init__.py b/plugins/coser/__init__.py index 5d44b0f5..cb8c98ff 100755 --- a/plugins/coser/__init__.py +++ b/plugins/coser/__init__.py @@ -36,10 +36,11 @@ __plugin_configs__ = { }, } -coser = on_regex(r"^(\d)连?(cos|COS|coser|括丝)$", priority=5, block=True) +coser = on_regex(r"^(\d?)连?(cos|COS|coser|括丝)$", priority=5, block=True) - -url = "https://api.iyk0.com/cos" +# 纯cos,较慢:https://picture.yinux.workers.dev +# 比较杂,有福利姬,较快:https://api.jrsgslb.cn/cos/url.php?return=img +url = "https://picture.yinux.workers.dev/" @coser.handle() diff --git a/plugins/wbtop/__init__.py b/plugins/wbtop/__init__.py index 34eb2ba4..f6a13cf6 100644 --- a/plugins/wbtop/__init__.py +++ b/plugins/wbtop/__init__.py @@ -40,28 +40,30 @@ wbtop_data = [] async def _(event: MessageEvent, arg: Message = CommandArg()): global wbtop_data msg = arg.extract_plain_text().strip() - if not wbtop_data or not msg: - if wbtop_data: - now_time = datetime.datetime.now() - if now_time > wbtop_data["time"] + datetime.timedelta(minutes=5): - data, code = await get_wbtop(wbtop_url) - if code != 200: - await wbtop.finish(data, at_sender=True) - wbtop_data = data - else: + if wbtop_data: + now_time = datetime.datetime.now() + if now_time > wbtop_data["time"] + datetime.timedelta(minutes=5): data, code = await get_wbtop(wbtop_url) if code != 200: await wbtop.finish(data, at_sender=True) + else: + wbtop_data = data + else: + data, code = await get_wbtop(wbtop_url) + if code != 200: + await wbtop.finish(data, at_sender=True) + else: wbtop_data = data - if not msg: - img = await asyncio.get_event_loop().run_in_executor( - None, gen_wbtop_pic, wbtop_data["data"] - ) - await wbtop.send(img) - logger.info( - f"(USER {event.user_id}, GROUP {event.group_id if isinstance(event, GroupMessageEvent) else 'private'})" - f" 查询微博热搜" - ) + + if not msg: + img = await asyncio.get_event_loop().run_in_executor( + None, gen_wbtop_pic, wbtop_data["data"] + ) + await wbtop.send(img) + logger.info( + f"(USER {event.user_id}, GROUP {event.group_id if isinstance(event, GroupMessageEvent) else 'private'})" + f" 查询微博热搜" + ) if is_number(msg) and 0 < int(msg) <= 50: url = wbtop_data["data"][int(msg) - 1]["url"] await wbtop.send("开始截取数据...") @@ -72,7 +74,7 @@ async def _(event: MessageEvent, arg: Message = CommandArg()): wait_time=12 ) if img: - await wbtop.send(img) + await wbtop.finish(img) else: - await wbtop.send("发生了一些错误.....") + await wbtop.finish("发生了一些错误.....")