Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[提问] 获取与用户关系失败:重试达到最大次数 #879

Open
xcenweb opened this issue Jan 21, 2025 · 1 comment
Open

[提问] 获取与用户关系失败:重试达到最大次数 #879

xcenweb opened this issue Jan 21, 2025 · 1 comment
Labels
question 这啥呀这是,我不到啊

Comments

@xcenweb
Copy link

xcenweb commented Jan 21, 2025

**Python 版本:3.12.8

**模块版本:dev

**运行环境:Windows11 23H2


bilibili_api.exceptions.ApiException.ApiException: 重试达到最大次数

Traceback (most recent call last):
  File "p:\bili_autolottery\main.py", line 19, in <module>
    print(sync(usr.get_relation(702149309)))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "P:\bili_autolottery\.conda\Lib\site-packages\bilibili_api\utils\sync.py", line 33, in sync
    return loop.run_until_complete(coroutine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "P:\bili_autolottery\.conda\Lib\asyncio\base_events.py", line 686, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "P:\bili_autolottery\.conda\Lib\site-packages\bilibili_api\user.py", line 761, in get_relation
    await Api(**api, credential=self.credential).update_params(**params).result
  File "P:\bili_autolottery\.conda\Lib\site-packages\bilibili_api\utils\network.py", line 170, in result
    self.__result = await self.request()
                    ^^^^^^^^^^^^^^^^^^^^
  File "P:\bili_autolottery\.conda\Lib\site-packages\bilibili_api\utils\network.py", line 82, in inner
    raise ApiException("重试达到最大次数")
bilibili_api.exceptions.ApiException.ApiException: 重试达到最大次数

main.py

import util.login
from bilibili_api import user, sync, dynamic

# 2018145707为登录的用户id,702149309为目标用户id
credential = util.login.get_credential()
usr = user.User(2018145707, credential)
usr.get_relation
print(sync(usr.get_relation(702149309)))

p.s. util/login.py 只是二次封装了bilibili_api.logi.Credential,用于自动缓存和登录bilibili

@xcenweb xcenweb added the question 这啥呀这是,我不到啊 label Jan 21, 2025
@Nemo2011
Copy link
Owner

尝试 dev 分支版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 这啥呀这是,我不到啊
Projects
None yet
Development

No branches or pull requests

2 participants