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

[BUG] video.py submit_subtitle lan 参数错误 #708

Closed
valkjsaaa opened this issue Mar 11, 2024 · 0 comments
Closed

[BUG] video.py submit_subtitle lan 参数错误 #708

valkjsaaa opened this issue Mar 11, 2024 · 0 comments
Labels
bug 漏洞 solved 已解决

Comments

@valkjsaaa
Copy link
Contributor

valkjsaaa commented Mar 11, 2024

Python 版本: 3.11

模块版本: 16.2.0

**运行环境:MacOS

**模块路径:bilibili_api.video_uploader

**解释器:cpython

报错信息:

Traceback (most recent call last):
  File "/Users/jackie/temp-documents/auto-bilibili-recorder/subtitle_task.py", line 85, in post_subtitle
    await target_video.submit_subtitle(
  File "/Users/jackie/temp-documents/auto-bilibili-recorder/venv/lib/python3.12/site-packages/bilibili_api/video.py", line 1593, in submit_subtitle
    raise ArgsException("lan 参数错误,请参见 https://s1.hdslb.com/bfs/subtitle/subtitle_lan.json")
bilibili_api.exceptions.ArgsException.ArgsException: lan 参数错误,请参见 https://s1.hdslb.com/bfs/subtitle/subtitle_lan.json

报错代码:

{'code': 21021, 'message': '稿件类型为转载时,转载来源不能为空', 'ttl': 1}

 for lan in subtitle_lans:
                if lan["lan"] == lan:
                    break
            else:
                raise ArgsException("lan 参数错误,请参见 https://s1.hdslb.com/bfs/subtitle/subtitle_lan.json")

这个 for loop shadow 了 outside variable

@valkjsaaa valkjsaaa added the bug 漏洞 label Mar 11, 2024
valkjsaaa added a commit to valkjsaaa/bilibili-api that referenced this issue Mar 11, 2024
valkjsaaa added a commit to valkjsaaa/bilibili-api that referenced this issue Mar 11, 2024
@z0z0r4 z0z0r4 added the solved 已解决 label Mar 11, 2024
@z0z0r4 z0z0r4 closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 漏洞 solved 已解决
Projects
None yet
Development

No branches or pull requests

2 participants