-
Notifications
You must be signed in to change notification settings - Fork 218
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
【漏洞】VideoUploader CHUNK_FAILED #226
Comments
|
settings.timeout 试过了,应该是没有效果 |
可以了,原来是 bug,你可以用 dev 分支代码试一下 |
我这也遇到同样的问题,我用dev试了也不行.credential没有问题,可以like video
git log
my code
|
能展示一下全部源代码吗 |
from unicodedata import name
from bilibili_api import sync, video
from bilibili_api.video_uploader import VideoUploaderPage, VideoUploader
from bilibili_api.video_zone import get_zone_videos_count_today
from bilibili_api.utils.Credential import Credential
from bilibili_api import settings
import bilibili_api
settings.timeout = 10.0
async def upload_video(video_file_path, video_title):
p = VideoUploaderPage(video_file_path, video_title, video_title)
credential = Credential(...)
print(bilibili_api.BILIBILI_API_VERSION)
metadata = {
"act_reserve_create": 0,
"copyright": 1,
"source": "",
"desc": "",
"desc_format_id": 0,
"dynamic": "",
"interactive": 0,
"no_reprint": 1,
"open_elec": 0,
"origin_state": 0,
"subtitles": {
"lan": "",
"open": 0
},
"tag": "周杰伦",
"tid": 137,
"title": video_title,
"up_close_danmaku": False,
"up_close_reply": False,
"up_selection_reply": False,
}
uploader = VideoUploader([p], metadata,
credential,
cover=video_file_path.replace('.mp4', '.png')
)
print(f"Uploading [{video_file_path}] with title [{video_title}]")
print(f"metadata: [{metadata}]")
@uploader.on("__ALL__")
async def ev(data):
print(data)
await uploader.start()
if __name__ == '__main__':
sync(upload_video('2023-03-05.mp4', 'test title')) output -> % python upload.py
15.3.1
Uploading [2023-03-05.mp4] with title [test title]
metadata: [{'act_reserve_create': 0, 'copyright': 1, 'source': '', 'desc': '', 'desc_format_id': 0, 'dynamic': '', 'interactive': 0, 'no_reprint': 1, 'open_elec': 0, 'origin_state': 0, 'subtitles': {'lan': '', 'open': 0}, 'tag': '周杰伦', 'tid': 137, 'title': 'test title', 'up_close_danmaku': False, 'up_close_reply': False, 'up_selection_reply': False}]
{'name': 'PREUPLOAD', 'data': ({<bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>: <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>},)}
{'name': 'PRE_PAGE', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 20971520, 'chunk_number': 2, 'total_chunk_count': 4},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 20971520, 'chunk_number': 2, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 31457280, 'chunk_number': 3, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 4},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 31457280, 'chunk_number': 3, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'CHUNK_FAILED', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 4, 'info': ''},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 20971520, 'chunk_number': 2, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 31457280, 'chunk_number': 3, 'total_chunk_count': 4},)}
{'name': 'PRE_CHUNK', 'data': ({'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f0be6ad02e0>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 4},)}
|
你要不先看一下具体报错原因,参考这里的做法,增加报错代码 |
bilibili-api-python==15.3.1,升级了最新版本,不过好像不大行 `Connected to pydev debugger (build 223.8836.34) During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): Process finished with exit code 1` |
干脆粗暴一点,上传时设置timeout久一点,如果还是还是还是不行的话直接去设置httpx的默认timeout吧,看看是不是模块的问题。 |
check out my pull request, |
可以 close 了 |
Python 版本: 3.10
模块版本: 15.1.0
运行环境: Ubuntu
模块路径:
bilibili_api.video_uploader.VideoUploader
解释器: cpython / pypi / jython
报错信息:
{'name': 'PREUPLOAD', 'data': {<bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>: <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>}}
{'name': 'PRE_PAGE', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>}}
{'name': 'PRE_CHUNK', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 3}}
{'name': 'PRE_CHUNK', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 3}}
{'name': 'PRE_CHUNK', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 20971520, 'chunk_number': 2, 'total_chunk_count': 3}}
{'name': 'CHUNK_FAILED', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 10485760, 'chunk_number': 1, 'total_chunk_count': 3, 'info': ''}}
{'name': 'CHUNK_FAILED', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 20971520, 'chunk_number': 2, 'total_chunk_count': 3, 'info': ''}}
{'name': 'CHUNK_FAILED', 'data': {'page': <bilibili_api.video_uploader.VideoUploaderPage object at 0x7f32eb52b670>, 'offset': 0, 'chunk_number': 0, 'total_chunk_count': 3, 'info': ''}}
报错代码:
try exception 出现WriteTimout异常
{'timeout': {'connect': 5.0, 'read': 5.0, 'write': 5.0, 'pool': 5.0}}
在此处写正文
The text was updated successfully, but these errors were encountered: