-
Notifications
You must be signed in to change notification settings - Fork 226
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
[提问]上传视频遇到问题 AttributeError: 'NoneType' object has no attribute '__dict__'. Did you mean: '__dir__'? #698
Comments
发下代码 |
from bilibili_api import sync, video_uploader, Credential
SESSDATA = ".........................."
BILI_JCT = ".........................."
BUVID3 = ".........................."
async def main():
credential = Credential(sessdata=SESSDATA, bili_jct=BILI_JCT, buvid3=BUVID3)
vu_meta = video_uploader.VideoMeta(tid=130,
title='title',
tags=['音乐综合', '音乐'],
desc='',
cover="cover.png",
no_reprint=True
)
page = video_uploader.VideoUploaderPage(
path = 'video.mp4',
title = '标题',
description='简介',
)
uploader = video_uploader.VideoUploader([page], vu_meta, credential, line=video_uploader.Lines.QN) # 选择七牛线路,不选则自动测速选择最优线路
@uploader.on("__ALL__")
async def ev(data):
print(data)
await uploader.start()
sync(main()) |
bilibili-api/bilibili_api/video_uploader.py Line 583 in a047487
|
不清楚但好像是我的锅.jpg 但我在校没法改 |
那哪个版本可以运行呢 |
你不用 meta,直接传json大概就能吧 |
ok了,现在可以了,修改video_uploader.py,原来的 "porder": self.porder.dict(), 这一行删除 class VideoMeta:
# ... 其他代码 ...
def __dict__(self) -> dict:
meta = {
# ... 其他属性 ...
#原来的 "porder": self.porder.__dict__(), 这一行删除
}
# 确保 porder 不是 None
if self.porder is not None:
meta["porder"] = self.porder.__dict__()
# ... 其他代码 ...
return meta |
valkjsaaa
added a commit
to valkjsaaa/bilibili-api
that referenced
this issue
Mar 11, 2024
This solves Nemo2011#698
valkjsaaa
added a commit
to valkjsaaa/bilibili-api
that referenced
this issue
Mar 11, 2024
This solves Nemo2011#698
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python 版本: 3.10
模块版本: 16.2.0
运行环境: Windows
按照文档给的案例上传视频,credential和视频封面,视频文件都修改了,但是遇见这个问题
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?
The text was updated successfully, but these errors were encountered: