mos9527 / bilibili-toolman Goto Github PK
View Code? Open in Web Editor NEW配合 GH Actions 的哔哩哔哩创作中心 Python API / 搬运工具
License: GNU General Public License v2.0
配合 GH Actions 的哔哩哔哩创作中心 Python API / 搬运工具
License: GNU General Public License v2.0
[ 2021-08-22 07:08:17 youtube ERROR ] ERROR: unable to download video data: HTTP Error 403: Forbidden
[ 2021-08-22 07:08:17 BiliSession ERROR ] 无法下载指定资源 - ERROR: unable to download video data: HTTP Error 403: Forbidden
[ 2021-08-22 07:08:17 root WARNING ] 上传未完毕
Error: Process completed with exit code 1.
Hello!
I hope you are doing well!
We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.
Can you enable it, so that we can report it?
Thanks in advance!
PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository
10月17号出现此问题,尝试更换多个账号后,确认账号没问题,始终提示
{'code': 86066, 'message': '该账号冻结中', 'ttl': 1, 'data': None}
还是会用到的,非常感谢
错误日志:
[ 2021-06-06 13:36:21 youtube DEBUG ] [youtube] fypO-lbSNno: Downloading API JSON
[ 2021-06-06 13:36:21 youtube ERROR ] ERROR: Unable to download API page: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)> (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
[ 2021-06-06 13:36:21 BiliSession ERROR ] Cannot download specified resource - ERROR: Unable to download API page: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)> (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
[ 2021-06-06 13:36:21 root WARNING ] Dirty flag set,not all tasks are done properly
请教一下,如何解决
感谢大佬无私分享, 我尝试运行了 'API 使用示例' 中代码, 现反馈如下, (Python 3.9.13)
1: endpoint_1,cid_2 = session.UploadVideo("本地视频02.mp4")----->此处 endpoint_1 应为 endpoint_2 ??
2: submission.cover_url, submission.source, submission.tags.append('转载'), submission.thread = 17, 这些属性均错误
submission.cover_url----不能上传封面,
submission.tags.append('转载')---添加标签报错,
submission.thread = 17-----修改报错, 未开通的分区
有同样疑惑的小伙伴吗? 讨论一下, 也盼望大佬抽空复核一下, 给我们指点迷津
难道是笔误? 第一行导入 SubmissionVideos 后, 没有任意位置使用 SubmissionVideos , 哪里笔误?
from bilibili_toolman.bilisession.web import BiliSession
session = BiliSession.from_base64_string(config['misc']['sess_token'])
vs = session.ListSubmittedSubtitles()
va = session.ViewSubmission("BV1rV4y1K7a4")
运行到第4行就报错:
Traceback (most recent call last):
File "D:\miniconda3\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "D:\miniconda3\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "D:\miniconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\miniconda3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\miniconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\miniconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy_main.py", line 39, in
cli.main()
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py",
line 430, in main
run()
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py",
line 284, in run_file
runpy.run_path(target, run_name="main")
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "d:\VSCode\data\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals)
File "d:\0\BilibiliUploader\test_run_info.py", line 50, in
va = session.ViewSubmission("BV1rV4y1K7a4")
File "D:\miniconda3\lib\site-packages\bilibili_toolman\bilisession\web.py", line 236, in ViewSubmission
arc = self.view_archive(bvid)["data"]
File "D:\miniconda3\lib\site-packages\bilibili_toolman\bilisession\common_init.py", line 19, in wrapper
return response.json()
File "D:\miniconda3\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
你好,在虚拟环境中按你给的格式我执行了程序,但是报错了,错误显示我提供了4个参数,但是程序只需要3个
[ 2021-08-22 07:03:12 BiliSession DEBUG ] 准备提交单 P 内容: July - Walking To Heaven
[ 2021-08-22 07:03:12 BiliSession CRITICAL ] 其他错误 (21052): 稿件描述长度太长,已超过限制 - 跳过上传
[ 2021-08-22 07:03:12 BiliSession WARNING ] 上传失败: 稿件描述长度太长,已超过限制
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/__main__.py", line 6, in <module>
sys.exit(__main__())
^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 273, in __main__
if not setup_session():
^^^^^^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 241, in setup_session
sess = BiliSession.from_base64_string(global_args.load)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/bilisession/web.py", line 623, in from_base64_string
return BiliSession.from_bytes(b)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/bilisession/web.py", line 607, in from_bytes
unpickled = pickle.loads(gzip.decompress(b))
^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/gzip.py", line 627, in decompress
if _read_gzip_header(fp) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/gzip.py", line 456, in _read_gzip_header
raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b',\x85')
请问使用本库上传视频会触发验证码吗,我现在用的另一个库,上传到9个左右时候返回错误,提示需要输入验证码。似乎B站一天内只能投稿9个左右,之后的投稿会要求验证码
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/main.py", line 5, in
sys.exit(main())
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 143, in main
if not setup_session():
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 110, in setup_session
result = sess.LoginViaUsername(global_args.username,global_args.pwd)
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/bilisession/common/init.py", line 14, in wrapper
response: Response = classfunc(session, *args, **kwargs)
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/bilisession/client.py", line 251, in LoginViaUsername
self.login_tokens.update(resp.json()['data']['token_info'])
TypeError: 'NoneType' object is not subscriptable
Error: Process completed with exit code 1.
教程的这些一步步操作比较复杂,对系统环境要求也比较高,主要是使用时不太方便逐条输命令。。。
我想用这个项目来投稿我我自制的视频,我该怎么把投稿格式改为自制
[ 2022-12-29 18:17:20 WebSession INFO ] 远端结点: https://upos-cs-upcdnqn.bilivideo.com/ugcboss/n221229qn21hrqqrgpqleg3t0vvmbk76.mp4
[ 2022-12-29 18:17:20 WebSession DEBUG ] 第 1 次刷新 TOKEN...
[ 2022-12-29 18:17:20 WebSession WARNING ] 第 1 上传未成功,重试...
[ 2022-12-29 18:17:21 WebSession INFO ] 远端结点: https://upos-cs-upcdnqn.bilivideo.com/ugcboss/n221229qn3378cktsy4axrpoz7meec8b.mp4
[ 2022-12-29 18:17:21 WebSession DEBUG ] 第 2 次刷新 TOKEN...
[ 2022-12-29 18:17:21 WebSession WARNING ] 第 2 上传未成功,重试...
[ 2022-12-29 18:17:23 WebSession INFO ] 远端结点: https://upos-cs-upcdnqn.bilivideo.com/ugcboss/n221229qn3qxofd37rkd9d11eyz7kbty.mp4
[ 2022-12-29 18:17:23 WebSession DEBUG ] 第 3 次刷新 TOKEN...
[ 2022-12-29 18:17:23 WebSession WARNING ] 第 3 上传未成功,重试...
[ 2022-12-29 18:17:24 WebSession INFO ] 远端结点: https://upos-cs-upcdnqn.bilivideo.com/ugcboss/n221229qn2pwg1etqfdauo2u1u9w3ou9.mp4
[ 2022-12-29 18:17:24 WebSession DEBUG ] 第 4 次刷新 TOKEN...
[ 2022-12-29 18:17:24 WebSession WARNING ] 第 4 上传未成功,重试...
[ 2022-12-29 18:17:25 WebSession INFO ] 远端结点: https://upos-cs-upcdnqn.bilivideo.com/ugcboss/n221229qn12g2vnbfsn7288c4e2u8lsh.mp4
[ 2022-12-29 18:17:25 WebSession DEBUG ] 第 5 次刷新 TOKEN...
[ 2022-12-29 18:17:25 WebSession WARNING ] 第 5 上传未成功,重试...
[ 2022-12-29 18:17:26 toolman WARNING ] 上传失败! - 经 5 次重试后仍无法获取 TOKEN - 重试
[ 2022-12-29 18:17:26 toolman ERROR ] URI 获取失败 - 跳过
编写了一个脚本定时上传一直没成功,目前按README中提到的例子设置了opts="external_downloader=aria2c&daterange=now-1day&quiet=True",上传时都会提示"指定要下载的视频上传时间窗口: 2023-01-01 - 9999-12-31",试了一下”daterange=now-xxxx”格式的似乎都会有这样的问题。
另外在yt-dlp的REAME里找到了这样的提示,但不知道如果是下载三小时之内或者三十分钟之内的视频应该如何设置。
--date DATE Download only videos uploaded on this date.
The date can be "YYYYMMDD" or in the format
[now|today|yesterday][-N[day|week|month|year]].
E.g. "--date today-2weeks" downloads
only videos uploaded on the same day two
weeks ago
Actions里定时上传无法完成应该也是这个问题。
想和你交流下,这个只支持youtube吗
第 5 次刷新 TOKEN...
[ 2022-07-22 09:26:23 WebSession WARNING ] 第 5 上传未成功,重试...
貌似不能上传了
Downloading/unpacking bilibili-toolman
Running setup.py egg_info for package bilibili-toolman
Traceback (most recent call last):
File "", line 14, in
File "/build/bilibili-toolman/setup.py", line 1, in
import setuptools,bilibili_toolman
File "bilibili_toolman/init.py", line 1
SyntaxError: Non-ASCII character '\xe5' in file bilibili_toolman/init.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 14, in
File "/build/bilibili-toolman/setup.py", line 1, in
import setuptools,bilibili_toolman
File "bilibili_toolman/init.py", line 1
SyntaxError: Non-ASCII character '\xe5' in file bilibili_toolman/init.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Command python setup.py egg_info failed with error code 1
Storing complete log in /root/.pip/pip.log
[ 2021-08-23 10:36:05 BiliSession CRITICAL ] 上传失败! - ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
[ 2021-08-23 10:36:05 root WARNING ] 上传未完毕
Error: Process completed with exit code 1.
请教获取方式
话说为什么github拉youtube的速度那么慢。。。
如题
分区65,网络游戏。
编辑已经开放或者正在审核的稿件均提示:{'code': 21002, 'message': '此分区暂不可用', 'ttl': 1}。
输出报错上传封面图失败
100%|██████████| 20.0M/20.0M [09:17<00:00, 35.9kB/s]Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/__main__.py", line 6, in <module>
sys.exit(__main__())
^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 319, in __main__
result, dirty = upload_sources(sources, arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/bilibili-toolman/bilibili-toolman/bilibili_toolman/cli/main.py", line 119, in upload_sources
video.cover_url = cover_url
^^^^^^^^^
UnboundLocalError: cannot access local variable 'cover_url' where it is not associated with a value
[ 2023-07-29 02:29:34 ClientSession DEBUG ] MD5: 61950346a81fb2197643de8336cf3cc9
[ 2023-07-29 02:29:34 ClientSession INFO ] 远端结点: n2307290511yz71ljti7kj1pkir1f2gc
[ 2023-07-29 02:29:34 ClientSession DEBUG ] 上传完毕: (OK/1 info/Successful.)
[ 2023-07-29 02:29:34 ClientSession DEBUG ] b1PoTRjctkg.png -> image/png
[ 2023-07-29 02:29:34 ClientSession DEBUG ] 上传封面图 ([1123752](tel:1123752) B)
[ 2023-07-29 02:29:39 toolman WARNING ] < title : MIXUE (Phonk Remix) | Prod. Marcel NTX , src : https://www.youtube.com/watch?v=b1PoTRjctkg> 上传失败! - 'data' - 重试
[ 2023-07-29 02:29:40 ClientSession DEBUG ] 上传分块: 10
[ 2023-07-29 02:29:40 ClientSession DEBUG ] 分块大小: 2097152 B
[ 2023-07-29 02:31:24 ClientSession DEBUG ] MD5: 61950346a81fb2197643de8336cf3cc9
[ 2023-07-29 02:31:24 ClientSession INFO ] 远端结点: n23072901160oul75jupu6320b8l0s8x
[ 2023-07-29 02:31:24 ClientSession DEBUG ] 上传完毕: (OK/1 info/Successful.)
[ 2023-07-29 02:31:24 ClientSession DEBUG ] b1PoTRjctkg.png -> image/png
[ 2023-07-29 02:31:24 ClientSession DEBUG ] 上传封面图 ([1123752](tel:1123752) B)
[ 2023-07-29 02:31:32 toolman WARNING ] < title : MIXUE (Phonk Remix) | Prod. Marcel NTX , src : https://www.youtube.com/watch?v=b1PoTRjctkg> 上传失败! - 'data' - 重试
[ 2023-07-29 02:31:33 ClientSession DEBUG ] 上传分块: 10
[ 2023-07-29 02:31:33 ClientSession DEBUG ] 分块大小: 2097152 B
[ 2023-07-29 02:31:55 ClientSession WARNING ] 第 1 次重试时:Expecting value: line 1 column 1 (char 0)
[ 2023-07-29 02:33:20 ClientSession DEBUG ] MD5: 61950346a81fb2197643de8336cf3cc9
[ 2023-07-29 02:33:20 ClientSession INFO ] 远端结点: n23072906xvaakhya3bo316eolevg3ij
[ 2023-07-29 02:33:20 ClientSession DEBUG ] 上传完毕: (OK/1 info/Successful.)
[ 2023-07-29 02:33:20 ClientSession DEBUG ] b1PoTRjctkg.png -> image/png
[ 2023-07-29 02:33:20 ClientSession DEBUG ] 上传封面图 ([1123752](tel:1123752) B)
[ 2023-07-29 02:33:28 toolman WARNING ] < title : MIXUE (Phonk Remix) | Prod. Marcel NTX , src : https://www.youtube.com/watch?v=b1PoTRjctkg> 上传失败! - 'data' - 重试
[ 2023-07-29 02:33:28 ClientSession DEBUG ] 上传分块: 10
[ 2023-07-29 02:33:28 ClientSession DEBUG ] 分块大小: 2097152 B
[ 2023-07-29 02:35:39 ClientSession DEBUG ] MD5: 61950346a81fb2197643de8336cf3cc9
[ 2023-07-29 02:35:40 ClientSession INFO ] 远端结点: n2307290339ahcwhwig8ai1jezaujxsv
[ 2023-07-29 02:35:40 ClientSession DEBUG ] 上传完毕: (OK/1 info/Successful.)
[ 2023-07-29 02:35:40 ClientSession DEBUG ] b1PoTRjctkg.png -> image/png
[ 2023-07-29 02:35:40 ClientSession DEBUG ] 上传封面图 ([1123752](tel:1123752) B)
[ 2023-07-29 02:35:44 toolman WARNING ] < title : MIXUE (Phonk Remix) | Prod. Marcel NTX , src : https://www.youtube.com/watch?v=b1PoTRjctkg> 上传失败! - 'data' - 重试
[ 2023-07-29 02:35:45 ClientSession DEBUG ] 上传分块: 10
[ 2023-07-29 02:35:45 ClientSession DEBUG ] 分块大小: 2097152 B
[ 2023-07-29 02:37:24 ClientSession DEBUG ] MD5: 61950346a81fb2197643de8336cf3cc9
[ 2023-07-29 02:37:24 ClientSession INFO ] 远端结点: n230729052h0xt9f95genc27qa5k986p
[ 2023-07-29 02:37:24 ClientSession DEBUG ] 上传完毕: (OK/1 info/Successful.)
[ 2023-07-29 02:37:24 ClientSession DEBUG ] b1PoTRjctkg.png -> image/png
[ 2023-07-29 02:37:24 ClientSession DEBUG ] 上传封面图 ([1123752](tel:1123752) B)
[ 2023-07-29 02:37:29 toolman WARNING ] < title : MIXUE (Phonk Remix) | Prod. Marcel NTX , src : https://www.youtube.com/watch?v=b1PoTRjctkg> 上传失败! - 'data' - 重试
[ 2023-07-29 02:37:29 toolman INFO ] 资源已上传
Error: Process completed with exit code 1.
标题中含有的【】会在投稿时被去除,含有韩文则会提示包含某种字符而无法通过,能否在上传时先对标题进行处理,比如韩文直接转换为罗马音,保证频道的视频初次上传成功。
[ 2021-08-22 15:37:30 BiliSession WARNING ] < bvid : "" , title : "低糖低油綠豆糕 part2台灣1001個故事", desc : "请多多支持我" , video_endpoint : "" > 上传失败 : 请不要反复提交相同标题的稿件
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV13h411q7C8
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1xA411c75k
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1og41157Wn
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1Hh411q734
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1A64y1v77n
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1KL4y1v7r2
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1dL4y1a71x
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV1Z44y1k7qj
[ 2021-08-22 15:37:30 BiliSession INFO ] 上传成功 - BVid: BV12f4y1P71N
[ 2021-08-22 15:37:30 root WARNING ] 上传未完毕
Error: Process completed with exit code 1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.