MountainDash / nonebot-bison

A nonebot2 plugin to repost social media posts to QQ group
https://nonebot-bison.netlify.app
MIT License
163 stars 33 forks source link

bilibili 平台订阅失效· #47

Closed kexue-z closed 2 years ago

kexue-z commented 2 years ago

log

2022-04-15 19:23:26.939 | ERROR    | apscheduler:run_coroutine_job:36 - Job "fetch_and_send (trigger: interval[0:00:10], next run at: 2022-04-15 19:23:36 CST)" raised an exception
Traceback (most recent call last):

  File "/data1/my_bot/bot.py", line 29, in <module>
    nonebot.run()
    │       └ <function run at 0x7fc5561725e0>
    └ <module 'nonebot' from '/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/__init__...

  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/__init__.py", line 258, in run
    get_driver().run(*args, **kwargs)
    │                 │       └ {}
    │                 └ ()
    └ <function get_driver at 0x7fc557c4df70>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 168, in run
    uvicorn.run(
    │       └ <function run at 0x7fc555b64f70>
    └ <module 'uvicorn' from '/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/__init__...
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run
    server.run()
    │      └ <function Server.run at 0x7fc555b6e160>
    └ <uvicorn.server.Server object at 0x7fc53d5c1ac0>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7fc555b6e1f0>
           │       │   └ <uvicorn.server.Server object at 0x7fc53d5c1ac0>
           │       └ <function run at 0x7fc557393550>
           └ <module 'asyncio' from '/root/miniconda3/lib/python3.9/asyncio/__init__.py'>
  File "/root/miniconda3/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x7fc53d669bc0>
           │    └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects>
           └ <uvloop.Loop running=True closed=False debug=False>
> File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
                   │   │     │   │       │   └ <member 'kwargs' of 'Job' objects>
                   │   │     │   │       └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
                   │   │     │   └ <member 'args' of 'Job' objects>
                   │   │     └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
                   │   └ <member 'func' of 'Job' objects>
                   └ <Job (id=64329fe6c80a42af97a43d7f88b3dc51 name=fetch_and_send)>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/scheduler.py", line 62, in fetch_and_send
    to_send = await platform_manager[target_type].fetch_new_post(
                    │                └ 'bilibili'
                    └ {'arknights': <nonebot_bison.platform.platform.NoTargetGroup object at 0x7fc544fa5e80>, 'bilibili': <nonebot_bison.platform.b...
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/platform/platform.py", line 223, in fetch_new_post
    post_list = await self.get_sub_list(target)
                      │    │            └ '75107062'
                      │    └ <function Bilibili.get_sub_list at 0x7fc53dc7b790>
                      └ <nonebot_bison.platform.bilibili.Bilibili object at 0x7fc53fcfca00>
  File "/root/.cache/pypoetry/virtualenvs/dao-bot-uA4zZmZU-py3.9/lib/python3.9/site-packages/nonebot_bison/platform/bilibili.py", line 50, in get_sub_list
    return res_dict["data"]["cards"]
           └ {'code': 0, 'msg': '', 'message': '', 'data': {'has_more': 0, 'next_offset': 0, '_gt_': 0}}

KeyError: 'cards'

配置文件

{
  "kv": { "1": { "name": "version", "value": 2 } },
  "user_target": {
    "1": {
      "user": xxxx,
      "user_type": "group",
      "subs": [
         {
          "target": "396395171",
          "target_type": "bilibili",
          "target_name": "Lee\u54e5\u7684\u6e38\u620f\u5f00\u53d1\u52a0\u6cb9\u7ad9",
          "cats": [1, 2, 3, 4, 5],
          "tags": []
        },
        {
          "target": "75107062",
          "target_type": "bilibili",
          "target_name": "-_-----1",
          "cats": [1, 2, 3, 4, 5],
          "tags": []
        }
      ]
    }
}
felinae98 commented 2 years ago

75107062 用户没有发送过任何动态导致接口行为异常,下个版本可以修复