Skip to content

微博按照规则获取token后仍报"ok":-100 #744

@AddOneSecondL

Description

@AddOneSecondL

nonebot-bison 版本

Release v0.9.13

nonebot 版本

2.4.3

安装方式

通过 nb-cli 安装

操作系统

Windows Server 2022

问题

在按规则填写完Cookies后,能够正常识别cookie且已关联,但后台仍然报错,说是-100没登陆,在本地浏览器尝试访问https://m.weibo.cn/api/container/getIndex?containerid=1076035935511097可以正常显示内容。正常识别cookie部分与报错部分

Image Image

已附图

日志

10-10 11:00:21 [ERROR] apscheduler | Job "Scheduler.exec_fetch (trigger: interval[0:00:10], next run at: 2025-10-10 11:00:30 CST)" raised an exception
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\CT3\bot.py", line 11, in <module>
    nonebot.run()
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot\__init__.py", line 337, in run
    get_driver().run(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
    uvicorn.run(
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\uvicorn\main.py", line 580, in run
    server.run()
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\uvicorn\server.py", line 67, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\ProgramData\anaconda3\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
  File "C:\ProgramData\anaconda3\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "C:\ProgramData\anaconda3\Lib\asyncio\base_events.py", line 640, in run_until_complete
    self.run_forever()
  File "C:\ProgramData\anaconda3\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\ProgramData\anaconda3\Lib\asyncio\base_events.py", line 607, in run_forever
    self._run_once()
  File "C:\ProgramData\anaconda3\Lib\asyncio\base_events.py", line 1922, in _run_once
    handle._run()
  File "C:\ProgramData\anaconda3\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
> File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\apscheduler\executors\base.py", line 181, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot_bison\scheduler\scheduler.py", line 113, in exec_fetch
    to_send = await platform_obj.do_fetch_new_post(SubUnit(schedulable.target, send_userinfo_list))
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot_bison\platform\platform.py", line 108, in do_fetch_new_post
    return await catch_network_error(self.fetch_new_post, sub_unit) or []
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot_bison\platform\platform.py", line 53, in catch_network_error
    return await func(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot_bison\platform\platform.py", line 343, in fetch_new_post
    post_list = await self.get_sub_list(sub_unit.sub_target)
  File "C:\Users\Administrator\Desktop\CT3\.venv\Lib\site-packages\nonebot_bison\platform\weibo.py", line 139, in get_sub_list
    return list(filter(custom_filter, res_data["data"]["cards"]))
KeyError: ('data', ['https://m.weibo.cn/api/container/getIndex?containerid=1076035935511097 Headers({\'host\': \'m.weibo.cn\', \'accept\': \'*/*\', \'accept-encoding\': \'gzip, deflate, br\', \'connection\': \'keep-alive\', \'user-agent\': \'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0\', \'referer\': \'https://m.weibo.cn/u/5935511097\', \'mweibo-pwa\': \'1\', \'x-requested-with\': \'XMLHttpRequest\', \'cookie\': \'dummycookie=1\'}) | [200] Headers([(\'content-type\', \'application/json; charset=utf-8\'), (\'transfer-encoding\', \'chunked\'), (\'connection\', \'keep-alive\'), (\'date\', \'Fri, 10 Oct 2025 03:00:21 GMT\'), (\'vary\', \'Accept-Encoding\'), (\'x-powered-by\', \'PHP/7.2.1\'), (\'set-cookie\', \'MLOGIN=0; expires=Fri, 10-Oct-2025 04:00:21 GMT; Max-Age=3600; path=/; domain=.weibo.cn\'), (\'set-cookie\', \'_T_WM=71550267080; expires=Fri, 10-Oct-2025 16:00:00 GMT; Max-Age=46779; path=/; domain=.weibo.cn\'), (\'set-cookie\', \'XSRF-TOKEN=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.weibo.cn; HttpOnly\'), (\'set-cookie\', \'XSRF-TOKEN=26a23b; expires=Fri, 10-Oct-2025 03:20:21 GMT; Max-Age=1200; path=/; domain=m.weibo.cn\'), (\'set-cookie\', \'WEIBOCN_FROM=1110106030; path=/; domain=.weibo.cn; HttpOnly\'), (\'set-cookie\', \'mweibo_short_token=d970d3dc2a; expires=Fri, 10-Oct-2025 03:00:36 GMT; Max-Age=15; path=/; domain=.weibo.cn; HttpOnly\'), (\'x-log-uid\', \'\'), (\'content-security-policy\', \'upgrade-insecure-requests\'), (\'proc_node\', \'mweibo-h5-v8-web-hj4-5576d5b79-p8pzt\'), (\'content-encoding\', \'gzip\'), (\'server\', \'SHANHAI-SERVER\'), (\'lb\', \'106.63.15.9\'), (\'ssl_node\', \'msre-10-2-40-189.wq.intra.weibo.cn\')]) {"ok":-100,"errno":"-100","msg":"\\u9a6c\\u4e0a\\u767b\\u5f55\\uff0c\\u900f\\u8fc7\\u5fae\\u535a\\u770b\\u4e16\\u754c","url":"https:\\/\\/passport.weibo.com\\/sso\\/signin?entry=wapsso&source=wapssowb&url=https%3A%2F%2Fm.weibo.cn%2Fu%2F5935511097","extra":""}'])

确认

  • 我搜索过了 issue,但是并没有发现过与我类似的问题
  • 我确认在日志中去掉了敏感信息

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions