Git Product home page Git Product logo

lifegpc / bili Goto Github PK

View Code? Open in Web Editor NEW
354.0 354.0 35.0 1.96 MB

A tool to download barrage/video from bilibili/acfun. Support English, Japanese and Chinese(China).一个Python编写的从Bilibili/Acfun下载弹幕/视频的工具。支持英语、日语和中文(**)。(WEBGUI正在路上)

License: GNU Affero General Public License v3.0

Python 82.56% HTML 3.63% CSS 0.29% JavaScript 13.51%
acfun barrage bilibili danmu downloader python subtitles video-downloader

bili's Introduction

lifegpc's github stats
Top Langs

bili's People

Contributors

asc8384 avatar david082321 avatar lifegpc avatar peanutmelonseedbigalmond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bili's Issues

不能下载已购课程

2021年5月7日15:30:37
可能是b站接口变动,目前版本不能下载已购课程,只能下载免费课程

下载报错 AttributeError: 'int' object has no attribute 'replace'

系统环境:Linux raspberrypi 5.4.51-v8+ #1327 SMP PREEMPT Thu Jul 23 11:11:34 BST 2020 aarch64 GNU/Linux
Python版本:Python-3.8.5
bili软件版本:v1.2.4
登录的B站账号为月度大会员

命令行输出:

python3 start.py
bili Copyright (C) 2019-2020 lifegpc
This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. This is free software, and you are welcome to redistribute it under certain conditions; type show c' for details.
你可以在https://github.com/lifegpc/bili上找到源代码。
当前版本:1.2.4(3de329a)
网络错误:无法获取最新稳定版本字符串。
请输入av/ss/ep/md/bv号(BV号请以BV开头)或者链接(支持用户页的收藏夹、频道、投稿、小视频链接,支持直播、直播回放和已购课程视频链接):(你可以使用","来分隔多个输入。)SS33802
登录校验成功!
ID:28229233
SSID:33802
标题:Re:从零开始的异世界生活 第二季
系列名字:Re:从零开始的异世界生活
描述:我一定会拯救你。
在打倒了魔女教大罪司教「怠惰」担当——培提其乌斯·罗曼尼康帝之后,菜月昴和爱蜜莉雅又得以重新开始。
克服了艰难的诀别,两人终于和解,然而这只是新一轮风波的序幕。
超乎想象的绝境危机,接踵而至的残酷现实。
少年将再次直面残酷的命运。
类型:番剧
发布时间:2020-07-08 23:00:00
内容:
1.第1话
标题:各自的誓言
AV号:626339509
BV号:BV1mt4y1Q74Q
CID:210288241
ID:330798
2.第2话
标题:下一个地方
AV号:498851287
BV号:BV1qK411H7QF
CID:212844570
ID:330799
3.第3话
标题:久候多时的重逢
AV号:328997408
BV号:BV1ZA411a7R7
CID:215462618
ID:330800
4.第4话
标题:亲子
AV号:371612893
BV号:BV1uZ4y1M7Ch
CID:218424302
ID:330801
5.第5话
标题:踏出的一步
AV号:969061597
BV号:BV1np4y1q7Ar
CID:221080169
ID:330802
6.第6话
标题:少女的福音
AV号:201689081
BV号:BV1Yh411d7NS
CID:223703773
ID:330803
PV:
7.正式PV
标题:
AV号:455889505
BV号:BV1r5411p7T9
CID:205208133
ID:329553
8.制作决定PV
标题:
AV号:413575139
BV号:BV1EV411k7Qq
CID:203194650
ID:329552
9.角色PV
标题: 菜月昴篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218682822
ID:333963
10.角色PV
标题:雷姆篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218682899
ID:333964
11.角色PV
标题:拉姆篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218683004
ID:333965
12.角色PV
标题:爱蜜莉雅篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218683067
ID:333966
请输入你想下载的视频编号(每两个编号间用,隔开,全部下载可输入a,可以使用-分开两个数字以选择一个范围(例如:1-25)):(下载上次观看的EP330798可输入l。)1 你选中了第1话,
请输入你要下载的方式:
1.当前弹幕下载
2.全弹幕下载(可能需要大量时间)
3.视频下载
4.当前弹幕+视频下载
5.全弹幕+视频下载
7.仅封面图片下载3
视频轨:
画质:高清 1080P+(1920x1080,23.810(16000/672)fps)
文件大小:375.56M(393806406B,1831.57kbps)
音频轨:
ID:30280
文件大小:66.27M(69485277B,323.17kbps)
正在开始下载第1个文件,共2个文件。
单文件最大5个连接,单个服务器最大3个连接,文件分片大小5M,预分配方式为prealloc
08/13 11:29:47 [NOTICE] Downloading 1 item(s)
08/13 11:29:47 [NOTICE] 正在分配磁盘空间。使用 --file-allocation=none 以禁用此功能。参见 man 手册中的 --file-allocation 以获悉更多详情。
[#7543b3 371MiB/375MiB(98%) CN:2 DL:8.2MiB]
08/13 11:30:38 [NOTICE] 下载已完成:/storage/Download/Re:从零开始的异世界生活 第二季(SS33802)/1.各自的誓言(高清 1080P+,avc1.640028).m4s
下载结果:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
7543b3|OK | 8.9MiB/s|/storage/Download/Re:从零开始的异世界生活 第二季(SS33802)/1.各自的誓言(高清 1080P+,avc1.640028).m4s
状态标识:
(OK):下载已完成。
Traceback (most recent call last):
File "start.py", line 1590, in
main(ip)
File "start.py", line 1569, in main
read=videodownload.epvideodownload(i,"https://www.bilibili.com/bangumi/play/ss%s"%(data['mediaInfo']['ssId']),data,section,cho3,cho5,se,ip,ud)
File "/home/pi/bili_1.2.4_linux/videodownload.py", line 1611, in epvideodownload
read=dwaria2(r2,getfn2(i,1,fdir,vqs,hzm,fin),geturll(dash['audio']),dash['audio']['size'],c3,ip,se,2,2,True)
File "/home/pi/bili_1.2.4_linux/videodownload.py", line 2971, in getfn2
return f"{f}/{i['i']+1}.{file.filtern(i['longTitle'])}({file.filtern(vqs[i2])}).{hzm[i2]}"
File "/home/pi/bili_1.2.4_linux/file/filter.py", line 57, in filtern
filen=filen.replace('/','_')
AttributeError: 'int' object has no attribute 'replace'

打印报错的变量filen:

30280

下载视频顺序调整

现在的视频下载模式是从最新的下载到最旧的一个。会产生一个文件创建时间顺序和视频收藏顺序不一致的情况。例如视频1是最新收藏的视频,视频2是第二新的视频;现在的逻辑是先下载视频1,然后下载视频2 ,就造成文件的创建时间视频2是晚于视频1的创建时间。
能不能给出一个选项先下载视频2,然后下载视频1的选项,使得文件创建时间与收藏顺序一致?

[ERROR]This version of ChromeDriver only supports Chrome version xx

bili  版权所有 (C) 2019-2020  lifegpc
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
本程序不负任何担保责任,欲知详情请键入'show w'。
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
这是一个自由软件,欢迎您在特定条件下再发布本程序;欲知详情请键入'show c'。
You can find the source code on <https://github.com/lifegpc/bili>.
你可以在<https://github.com/lifegpc/bili>上找到源代码。

建议运行setsettings.py设置程序以减少不必要的询问。
请输入av号(支持SS、EP号,BV号请以BV开头,现在已支持链接,支持用户页的收藏夹、频道、投稿链接):BV1fK4y1t7hj

DevTools listening on ws://127.0.0.1:2509/devtools/browser/9e799119-3ffa-4455-86c9-67819adcb960
Traceback (most recent call last):
File "start.py", line 948, in
File "start.py", line 200, in main
File "biliLogin.py", line 22, in login
File "site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in init
File "site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
File "site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
File "site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80

[1784] Failed to execute script start

直播下载闪退

测试了在直播和主播下线的直播间,1.3.8.17和1.4.1版本,均无法进行下载
log内容:
bili Version: 1.3.8.17(34fe8ef)
Execuble: D:\bili\start.exe
Python Version: 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
System Platform: win32
Windows Version: Windows 10.0 build 19042 platform 2 pack
Unins000.exe exists: True
Have setup bili: True
Inno Setup: Setup Version (1): 5.5.9 (u)
Inno Setup: App Path (1): D:\bili
InstallLocation (1): D:\bili
Inno Setup: Icon Group (1): bili x64
Inno Setup: User (1): witht
Inno Setup: Selected Tasks (1): desktopicon
Inno Setup: Deselected Tasks (1):
Inno Setup: Language (1): zh_CN
DisplayName (1): bili
DisplayIcon (1): ..\bili\icon\favicon.ico
UninstallString (1): "D:\bili\unins000.exe"
QuietUninstallString (1): "D:\bili\unins000.exe" /SILENT
DisplayVersion (1): 1.3.8.17(34fe8ef)
Publisher (1): lifegpc
URLInfoAbout (1): https:\github.com\lifegpc\bili
HelpLink (1): https:\github.com\lifegpc\bili
URLUpdateInfo (1): https:\github.com\lifegpc\bili
NoModify (4): 1
NoRepair (4): 1
InstallDate (1): 20210224
MajorVersion (4): 1
MinorVersion (4): 3
VersionMajor (4): 1
VersionMinor (4): 3
EstimatedSize (4): 159494
Have setup bili x86: False
Have setup bili x64: False
Current Directory: D:\bili
Argv: ['D:\bili\start.exe']
LOG 2021-02-24 23:11:34:
Settings: {}
Command Line parameters: {}
LOG 2021-02-24 23:11:34 File "biliVersion.py" Line 129 Function checkver (Update checker network error 1):
Traceback (most recent call last):
File "urllib3\connection.py", line 170, in _new_conn
File "urllib3\util\connection.py", line 73, in create_connection
File "socket.py", line 748, in getaddrinfo
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "urllib3\connectionpool.py", line 706, in urlopen
File "urllib3\connectionpool.py", line 382, in _make_request
File "urllib3\connectionpool.py", line 1010, in _validate_conn
File "urllib3\connection.py", line 353, in connect
File "urllib3\connection.py", line 182, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001E6EA055DC8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests\adapters.py", line 449, in send
File "urllib3\connectionpool.py", line 756, in urlopen
File "urllib3\util\retry.py", line 573, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /lifegpc/bili/master/version.txt (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001E6EA055DC8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "biliVersion.py", line 125, in checkver
File "requests\api.py", line 76, in get
File "requests\api.py", line 61, in request
File "requests\sessions.py", line 542, in request
File "requests\sessions.py", line 655, in send
File "requests\adapters.py", line 516, in send
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /lifegpc/bili/master/version.txt (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001E6EA055DC8>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))

LOG 2021-02-24 23:11:36 File "start.py" Line 102 Function main (Input URL):
inp = 'https://live.bilibili.com/117'
inpl = ['https://live.bilibili.com/117']
LOG 2021-02-24 23:11:36 File "start.py" Line 258 Function main (INPUT REGEX 1):
re = ('https://', None, None, None, None, 'live.', None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, '117', None, None, None, None, None, None)
LOG 2021-02-24 23:11:36 File "biliLogin.py" Line 86 Function tryok (VERIFY LOGIN):
GET https://api.bilibili.com/x/web-interface/nav
LOG 2021-02-24 23:11:36 File "biliLogin.py" Line 95 Function tryok (VERIFY API RETURN):
{"code":0,"message":"0","ttl":1,"data":{"isLogin":true,"email_verified":1,"face":"http://i0.hdslb.com/bfs/face/3b4572b77e714a6275646330108fa6d82534845b.jpg","level_info":{"current_level":2,"current_min":200,"current_exp":550,"next_exp":1500},"mid":442512375,"mobile_verified":1,"money":44.5,"moral":70,"official":{"role":0,"title":"","desc":"","type":-1},"officialVerify":{"type":-1,"desc":""},"pendant":{"pid":0,"name":"","image":"","expire":0,"image_enhance":"","image_enhance_frame":""},"scores":0,"uname":"甜甜圈的褶皱","vipDueDate":0,"vipStatus":0,"vipType":0,"vip_pay_type":0,"vip_theme_type":0,"vip_label":{"path":"","text":"","label_theme":""},"vip_avatar_subscript":0,"vip_nickname_color":"","wallet":{"mid":442512375,"bcoin_balance":0,"coupon_balance":0,"coupon_due_time":0},"has_shop":false,"shop_url":"","allowance_count":0,"answer_status":0}}
LOG 2021-02-24 23:11:36 File "start.py" Line 469 Function main (VERIFY LOGIN 2):
read = True
login = 1
ud = {'d': {'isLogin': True, 'email_verified': 1, 'face': 'http://i0.hdslb.com/bfs/face/3b4572b77e714a6275646330108fa6d82534845b.jpg', 'level_info': {'current_level': 2, 'current_min': 200, 'current_exp': 550, 'next_exp': 1500}, 'mid': 442512375, 'mobile_verified': 1, 'money': 44.5, 'moral': 70, 'official': {'role': 0, 'title': '', 'desc': '', 'type': -1}, 'officialVerify': {'type': -1, 'desc': ''}, 'pendant': {'pid': 0, 'name': '', 'image': '', 'expire': 0, 'image_enhance': '', 'image_enhance_frame': ''}, 'scores': 0, 'uname': '甜甜圈的褶皱', 'vipDueDate': 0, 'vipStatus': 0, 'vipType': 0, 'vip_pay_type': 0, 'vip_theme_type': 0, 'vip_label': {'path': '', 'text': '', 'label_theme': ''}, 'vip_avatar_subscript': 0, 'vip_nickname_color': '', 'wallet': {'mid': 442512375, 'bcoin_balance': 0, 'coupon_balance': 0, 'coupon_due_time': 0}, 'has_shop': False, 'shop_url': '', 'allowance_count': 0, 'answer_status': 0}, 'vip': 0}
LOG 2021-02-24 23:11:36 File "start.py" Line 1100 Function main (BARRAGE FILTER PARAMETERS):
xml = 2
xmlc = []
LOG 2021-02-24 23:11:36 File "start.py" Line 1362 Function main (GET LIVE ROOM WEBPAGE):
GET https://live.bilibili.com/117
LOG 2021-02-24 23:11:37 File "start.py" Line 1366 Function main (GET LIVE ROOM WEBPAGE RESULT):
status = 200

<title id="link-app-title">下播洞穴~ - 谜之声 - 哔哩哔哩直播,二次元弹幕直播平台</title> <script>function getIEVersion(){var e=99;if("Microsoft Internet Explorer"===navigator.appName){var t=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(t)&&(e=parseFloat(RegExp.$1))}return e}getIEVersion()<11&&(window.location.href="https://www.bilibili.com/blackboard/activity-I7btnS22Z.html")</script><script>function addWaifu(e,r){try{window.performance.mark(e,{detail:{component:"performanceTrack"},startTime:void 0!==r?r:performance.now()})}catch(e){console.error(e)}}addWaifu("neptune")</script><script>!function(n){function e(e){for(var a,c,f=e[0],d=e[1],t=e[2],b=0,r=[];b<script>(window.webpackJsonp=window.webpackJsonp||[]).push([["jump"],{1148:function(n,o,t){"use strict";t.r(o),t.d(o,"jumpExec",function(){return e}),t.d(o,"isMobileDevice",function(){return r}),t.d(o,"isRoomUrl",function(){return c}),t.d(o,"replaceDesktopUrlToMobileUrl",function(){return u}),t.d(o,"stopJumpingByCookie",function(){return a});var i=document.cookie;function e(n,o,t){if(!c(n)||a(o)||!r(t)&&"#html5"!==location.hash||/h5/.test(n))return!1;var i=u(n);return(window.top||window).location.href=i,!0}function r(n){return/(iPad|iPhone|iPod|Windows Phone|Android)/i.test(n)}function c(n){return/^(https?):\/\/live.bilibili.com\/(.+\/)?([\d]+)/.test(n)}function u(n){return-1<script>!function(){var i=Date.now(),D=Math.floor(i/1e3);window.BilibiliLive={INIT_TIME:i,RND:D,UID:0,ROOMID:0,ANCHOR_UID:0},window.DANMU_RND=D}()</script><script>addWaifu&&addWaifu("noire")</script><script>addWaifu&&addWaifu("blanc")</script><script>!function(){function e(){return-1!==window.location.search.indexOf("liteVersion=true")&&window.top!==window}var i="__NEPTUNE_IS_MY_WAIFU__",n=e(),a=[{activeRule:n,className:"lite-room"},{activeRule:function(){return e()&&-1!==window.location.search.indexOf("hideHeadInfo=true")},className:"head-info-hide"},{activeRule:function(){return e()&&-1!==window.location.search.indexOf("hideRankList=true")},className:"rank-list-hide"}];function t(e,n){e.forEach(function(e){if(("function"==typeof e.activeRule?e.activeRule():e.activeRule)&&e.className){var i=e.container||n||document.body;i.className+=i.className?" "+e.className:e.className}})}!function(){if(n)try{document.domain="bilibili.com",t(a),window.top[i]&&(window[i]=JSON.parse(JSON.stringify(window.top[i])))}catch(e){console.error("Do♂You♂Like♂Van♂游戏",e)}}(),t([{activeRule:function(){try{return 0===document.createElement("canvas").toDataURL("image/webp",.5).indexOf("data:image/webp")}catch(e){return!1}},className:"supportWebp"}])}()</script>
<script>function __PLAYER_BOOTSTRAP_FUNC__(){var e=function(){window.__PLAYER_BOOTSTRAP_FUNC__=null};try{if(!window.Player)return e();var o=document.getElementById("live-player");if(!o)return e();var i=window.__NEPTUNE_IS_MY_WAIFU__||{},r=!!i.roomInitRes&&0===i.roomInitRes.code&&!!i.roomInitRes.data&&i.roomInitRes.data.room_id;if(!r)return e();var n=i.roomInitRes||{code:0},a=n.data||{};if(!a.live_status||a.is_locked||a.encrypted&&!a.pwd_verified)return e();var _={cid:r,initTime:performance.now(),roomInitDataV2:n,rnd:window.DANMU_RND,fnPromiseMode:!0,protover:2,mask:{shouldOpenMask:!0},ptype:16,backgroundFilter:!0,coreType:2,coreProtocol:0},d=new window.Player(o,_);window.EmbedPlayer={instance:d},window.performance.timing.firstscreenfinish=(new Date).getTime(),addWaifu&&addWaifu("firstscreenfinish"),addWaifu&&addWaifu("misaka"),d.on("firstLoadedMetaData",function(){addWaifu&&addWaifu("mikoto"),window.__PLAYER_GLOBAL_INSTANCE__&&(window.__PLAYER_GLOBAL_INIT_FLAG__="我不想再说一遍")}),window.__PLAYER_GLOBAL_INSTANCE__=d}catch(e){console.error("Player Bootstrap Error: ",e)}e()}</script><script>addWaifu&&addWaifu("vert")</script>
<script>addWaifu&&addWaifu("nepgear")</script>
<script>window.__NEPTUNE_IS_MY_WAIFU__={"roomInitRes":{"code":0,"message":"0","ttl":1,"data":{"room_id":5082,"short_id":117,"uid":673816,"is_hidden":false,"is_locked":false,"is_portrait":false,"live_status":1,"hidden_till":0,"lock_till":0,"encrypted":false,"pwd_verified":true,"live_time":1614166898,"room_shield":1,"all_special_types":[],"playurl_info":{"conf_json":"{\"cdn_rate\":10000,\"report_interval_sec\":30}","playurl":{"cid":5082,"g_qn_desc":[{"qn":10000,"desc":"原画"},{"qn":800,"desc":"4K"},{"qn":401,"desc":"蓝光(杜比)"},{"qn":400,"desc":"蓝光"},{"qn":250,"desc":"超清"},{"qn":150,"desc":"高清"},{"qn":80,"desc":"流畅"}],"stream":[{"protocol_name":"http_stream","format":[{"format_name":"flv","codec":[{"codec_name":"avc","current_qn":400,"accept_qn":[10000,400,250,150],"base_url":"\u002Flive-bvc\u002F161449\u002Flive_673816_8552541_4000.flv?expires=1614183095&len=0&oi=1007816408&pt=web&qn=0&trid=dc247a99cc5940338915d7466da74fe2&sigparams=cdn,expires,len,oi,pt,qn,trid","url_info":[{"host":"https:\u002F\u002Fxy218x27x201x106xy.mcdn.bilivideo.cn:486","extra":"&cdn=cn-live-mcdn&sign=ec8deb226cbb7f372eedff7a182ea509&sid=6000030"},{"host":"https:\u002F\u002Fd1--cn-gotcha03.bilivideo.com","extra":"&cdn=cn-gotcha03&sign=6f3b688b92de97e688fefafb3d921cc0&p2p_type=1&src=5&sl=3"},{"host":"https:\u002F\u002Fcn-lnsy-cu-live-01.bilivideo.com","extra":"&cdn=cn-gotcha01&sign=310edd9b1c6a31659d13023ad13d6e5a&p2p_type=1&src=5&sl=3"}]},{"codec_name":"hevc","current_qn":0,"accept_qn":[250],"base_url":"","url_info":null}]}]},{"protocol_name":"http_hls","format":[{"format_name":"fmp4","codec":[{"codec_name":"avc","current_qn":400,"accept_qn":[10000,400,250,150],"base_url":"\u002Flive-bvc\u002F161449\u002Flive_673816_8552541_4000\u002Findex.m3u8?expires=1614183095&len=0&oi=1007816408&pt=web&qn=0&trid=dc247a99cc5940338915d7466da74fe2&sigparams=cdn,expires,len,oi,pt,qn,trid","url_info":[{"host":"https:\u002F\u002Fd1--cn-gotcha204.bilivideo.com","extra":"&cdn=cn-gotcha04&sign=9cd27dad8f240aa20d22fd3c7c69c6ea&p2p_type=1&src=5&sl=3"}]},{"codec_name":"hevc","current_qn":0,"accept_qn":[250],"base_url":"","url_info":null}]}]}],"p2p_data":{"p2p":true,"p2p_type":1,"m_p2p":true,"m_servers":["https:\u002F\u002Fxy218x27x201x106xy.mcdn.bilivideo.cn:486","https:\u002F\u002Fxy175x165x229x84xy.mcdn.bilivideo.cn:486","https:\u002F\u002Fxy175x165x230x252xy.mcdn.bilivideo.cn:486"]},"dolby_qn":null}}}},"roomInfoRes":{"code":0,"message":"0","ttl":1,"data":{"room_info":{"uid":673816,"room_id":5082,"short_id":117,"title":"下播洞穴~","cover":"http:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002Fnew_room_cover\u002F69dfb5a534fe27a575e160f98300b204a3e39b9f.jpg","tags":"小游戏,大游戏,谜之声","background":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002Ff3c1e1e22dfb1942bd88c33f1aa174efe7a38dfd.jpg","description":"\u003Cp\u003E我谜汉三又回来啦~~\u003C\u002Fp\u003E\n\u003Cp\u003E一般直播时间周一到周三+周六周日晚,19:45左右开始,23:40左右结束~\u003C\u002Fp\u003E\n\u003Cp\u003E \u003C\u002Fp\u003E\n\u003Cp\u003E录播请看 @谜之声的录播机\u003C\u002Fp\u003E\n\u003Cp\u003E贴吧粉丝群:227157778 直播粉丝群:569908122 \u003C\u002Fp\u003E\n\u003Cp\u003E因为我自己精力不够也不太喜欢有太多私下互动,因此这些群都没有加的,还望理解见谅 m(_  _)m\u003C\u002Fp\u003E\n\u003Cp\u003E背景音乐歌单:http:\u002F\u002Fmusic.163.com\u002Fplaylist?id=518274633&userid=367173218\u003C\u002Fp\u003E","live_status":1,"live_start_time":1614166898,"live_screen_type":0,"lock_status":0,"lock_time":0,"hidden_status":0,"hidden_time":0,"area_id":283,"area_name":"独立游戏","parent_area_id":6,"parent_area_name":"单机游戏","keyframe":"http:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002Fkeyframe0224230600000000508256e4fc.jpg","special_type":0,"up_session":"125697582331597786","pk_status":0,"is_studio":false,"pendants":{"frame":{"name":"","value":"","desc":""}},"on_voice_join":0,"online":84685,"room_type":{"4-1":1}},"anchor_info":{"base_info":{"uname":"谜之声","face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002F72cbf1464b28fc0d3d361529a1e2071c7fa7452c.jpg","gender":"男","official_info":{"role":0,"title":"bilibili直播签约主播","desc":""}},"live_info":{"level":35,"level_color":16746162,"score":49153675,"upgrade_score":12860135,"current":[11400000,47813810],"next":[14200000,62013810],"rank":"520"},"relation_info":{"attention":355256},"medal_info":{"medal_name":"谜酥","medal_id":174,"fansclub":1957}},"news_info":{"uid":673816,"ctime":"2021-01-03 10:34:27","content":"周一二三六每晚19:45左右开播,一般播到23:30之后。星期天通常8点开!"},"rankdb_info":{"roomid":5082,"rank_desc":"小时总榜","color":"#FB7299","h5_url":"https:\u002F\u002Flive.bilibili.com\u002Fp\u002Fhtml\u002Flive-app-rankcurrent\u002Findex.html?is_live_half_webview=1&hybrid_half_ui=1,5,85p,70p,FFE293,0,30,100,10;2,2,320,100p,FFE293,0,30,100,0;4,2,320,100p,FFE293,0,30,100,0;6,5,65p,60p,FFE293,0,30,100,10;5,5,55p,60p,FFE293,0,30,100,10;3,5,85p,70p,FFE293,0,30,100,10;7,5,65p,60p,FFE293,0,30,100,10;&anchor_uid=673816&rank_type=master_realtime_hour_room&area_hour=1&area_v2_id=283&area_v2_parent_id=6","web_url":"https:\u002F\u002Flive.bilibili.com\u002Fblackboard\u002Froom-current-rank.html?rank_type=master_realtime_hour_room&area_hour=1&area_v2_id=283&area_v2_parent_id=6","timestamp":1614179495},"area_rank_info":{"areaRank":{"index":2,"rank":"\u003E100"},"liveRank":{"rank":"520"}},"battle_rank_entry_info":{"first_rank_img_url":"","rank_name":"尚无段位","show_status":1},"tab_info":{"list":[{"type":"seven-rank","desc":"高能榜","isFirst":1,"isEvent":0,"eventType":"","listType":"","apiPrefix":"","rank_name":"room_7day"},{"type":"guard","desc":"大航海","isFirst":0,"isEvent":0,"eventType":"","listType":"top-list","apiPrefix":"","rank_name":""}]},"activity_init_info":{"eventList":[],"weekInfo":{"bannerInfo":null,"giftName":null},"giftName":null,"lego":{"timestamp":1614179495,"config":"[{\"name\":\"frame-mng\",\"url\":\"https:\\\u002F\\\u002Flive.bilibili.com\\\u002Fp\\\u002Fhtml\\\u002Flive-web-mng\\\u002Findex.html?roomid=#roomid#&arae_id=#area_id#&parent_area_id=#parent_area_id#&ruid=#ruid#\",\"startTime\":1559544736,\"endTime\":1877167950,\"type\":\"frame-mng\"},{\"name\":\"s10-fun\",\"target\":\"sidebar\",\"icon\":\"https:\\\u002F\\\u002Fi0.hdslb.com\\\u002Fbfs\\\u002Factivity-plat\\\u002Fstatic\\\u002F20200908\\\u002F3435f7521efc759ae1f90eae5629a8f0\\\u002FHpxrZ7SOT.png\",\"text\":\"\\u7545\\u73a9s10\",\"url\":\"https:\\\u002F\\\u002Flive.bilibili.com\\\u002Fs10\\\u002Ffun\\\u002Findex.html?room_id=#roomid#&width=376&height=600&source=sidebar\",\"color\":\"#2e6fc0\",\"startTime\":1600920000,\"endTime\":1604721600,\"parentAreaId\":2,\"areaId\":86},{\"name\":\"virtual-ranking\",\"target\":\"sidebar\",\"parentAreaId\":9,\"icon\":\"https:\\\u002F\\\u002Fi0.hdslb.com\\\u002Fbfs\\\u002Factivity-plat\\\u002Fstatic\\\u002F20210129\\\u002Fe28aca3b6bbda552592f14fd8446c1a6\\\u002F-QqAHDNYg.png\",\"text\":\"\\u865a\\u62df\\u4e71\\u6597\",\"url\":\"https:\\\u002F\\\u002Flive.bilibili.com\\\u002Fblackboard\\\u002FS6xuniluandouwangH5.html?room_id=#roomid#&width=375&height=375\\\u002F#\\\u002F\",\"color\":\"#9127a9\",\"startTime\":1612324800,\"endTime\":1614441599}]"}},"voice_join_info":{"status":{"open":0,"anchor_open":0,"status":0,"uid":0,"user_name":"","head_pic":"","guard":0,"start_at":0,"current_time":1614179495},"icons":{"icon_close":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002Fa176d879dffe8de1586a5eb54c2a08a0c7d31392.png","icon_open":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F70f0844c9a12d29db1e586485954290144534be9.png","icon_wait":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F1049bb88f1e7afd839cc1de80e13228ccd5807e8.png","icon_starting":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F948433d1647a0704f8216f017c406224f9fff518.gif"},"web_share_link":"https:\u002F\u002Flive.bilibili.com\u002Fh5\u002F5082"},"ad_banner_info":{"data":[{"id":73064,"title":"单机游戏鉴赏家募集中!官方资源扶持,新游\"喜加一“","location":"room_advertisement","position":1,"pic":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F6777241bd0dcf1f52b829cdc93b71ccc837cd45f.jpg","link":"https:\u002F\u002Fwww.bilibili.com\u002Fblackboard\u002Flive\u002Factivity-bFF4Q6zTa.html","weight":0},{"id":73024,"title":"现金福袋+每日抽奖","location":"room_advertisement","position":2,"pic":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F5300730c8d4cb6fee4292ddc7769a822202b1086.png","link":"https:\u002F\u002Flive.bilibili.com\u002Factivity\u002Flive-activity-grand\u002Flive-begin-activity\u002Fmobile.html?is_live_full_webview=1#\u002F","weight":0},{"id":73080,"title":"糖豆人 新春主播招募!","location":"room_advertisement","position":3,"pic":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F5413178cfe8044542eadf754ad30a564684c2560.png","link":"https:\u002F\u002Fwww.bilibili.com\u002Fblackboard\u002Flive\u002Factivity-TbmqVD6zZ.html","weight":0}]},"skin_info":{"id":0,"skin_name":"","skin_config":"","show_text":"","skin_url":"","start_time":0,"end_time":0,"current_time":0},"web_banner_info":{"id":0,"title":"","left":"","right":"","jump_url":"","bg_color":"","hover_color":"","text_bg_color":"","text_hover_color":"","link_text":"","link_color":"","input_color":"","input_text_color":"","input_hover_color":"","input_border_color":"","input_search_color":""},"lol_info":{"lol_activity":{"status":0,"guess_cover":"http:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F61d1c4bcce470080a5408d6c03b7b48e0a0fa8d7.png","vote_cover":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Factivity-plat\u002Fstatic\u002F20190930\u002F4ae8d4def1bbff9483154866490975c2\u002FoWyasOpox.png","vote_h5_url":"https:\u002F\u002Flive.bilibili.com\u002Fp\u002Fhtml\u002Flive-app-wishhelp\u002Findex.html?is_live_half_webview=1&hybrid_biz=live-app-wishhelp&hybrid_rotate_d=1&hybrid_half_ui=1,3,100p,360,0c1333,0,30,100;2,2,375,100p,0c1333,0,30,100;3,3,100p,360,0c1333,0,30,100;4,2,375,100p,0c1333,0,30,100;5,3,100p,360,0c1333,0,30,100;6,3,100p,360,0c1333,0,30,100;7,3,100p,360,0c1333,0,30,100;8,3,100p,360,0c1333,0,30,100;","vote_use_h5":true}},"wish_list_info":{"list":[],"status":0},"score_card_info":null,"pk_info":null,"battle_info":null,"silent_room_info":{"type":"","level":0,"second":0,"expire_time":0},"switch_info":{"close_guard":false,"close_gift":false,"close_online":false,"close_danmaku":false},"record_switch_info":{"record_tab":true},"room_config_info":{"dm_text":"发个弹幕呗~"},"gift_memory_info":{"list":null},"new_switch_info":{"room-socket":1,"room-prop-send":1,"room-sailing":1,"room-info-popularity":1,"room-danmaku-editor":1,"room-effect":1,"room-fans_medal":1,"room-report":1,"room-feedback":1,"room-player-watermark":1,"room-recommend-live_off":1,"room-activity":1,"room-web_banner":1,"room-silver_seeds-box":1,"room-wishing_bottle":1,"room-board":1,"room-supplication":1,"room-hour_rank":1,"room-week_rank":1,"room-anchor_rank":1,"room-info-integral":1,"room-super-chat":1,"room-tab":1,"room-hot-rank":1},"super_chat_info":{"status":1,"jump_url":"https:\u002F\u002Flive.bilibili.com\u002Fp\u002Fhtml\u002Flive-app-superchat2\u002Findex.html?is_live_half_webview=1&hybrid_half_ui=1,3,100p,70p,ffffff,0,30,100;2,2,375,100p,ffffff,0,30,100;3,3,100p,70p,ffffff,0,30,100;4,2,375,100p,ffffff,0,30,100;5,3,100p,60p,ffffff,0,30,100;6,3,100p,60p,ffffff,0,30,100;7,3,100p,60p,ffffff,0,30,100&is_cling_player=1","icon":"https:\u002F\u002Fi0.hdslb.com\u002Fbfs\u002Flive\u002F0a9ebd72c76e9cbede9547386dd453475d4af6fe.png","ranked_mark":0,"message_list":[]},"online_gold_rank_info_v2":{"list":[{"uid":39238,"face":"http:\u002F\u002Fi1.hdslb.com\u002Fbfs\u002Fface\u002Fdb6adf5a5c70708da60f525fb61b7b9f01b66266.jpg","uname":"youtpot","score":"1380","rank":1,"guard_level":3},{"uid":11252924,"face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002Feb7c78aa2339f5982b97bd610478bff38927f550.jpg","uname":"酒杯菌","score":"300","rank":2,"guard_level":0},{"uid":3125074,"face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002F3fb3593533878d2ef35b9bc81004146b537e5337.jpg","uname":"天蓝薄荷","score":"99","rank":3,"guard_level":0},{"uid":3186246,"face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002Fbcc395f933947fbc6fb51bf37587f34780333831.jpg","uname":"月下公主辉夜姬","score":"99","rank":4,"guard_level":0},{"uid":1727920,"face":"http:\u002F\u002Fi1.hdslb.com\u002Fbfs\u002Fface\u002Ff14570b39f09b1563b59b926b6de46ca12ea4bdd.jpg","uname":"阿阿阿千哥","score":"40","rank":5,"guard_level":0},{"uid":297656061,"face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002F6f305f5d65c3d15b7d1a4d38c42bfadcf5a51aef.jpg","uname":"233338552","score":"14","rank":6,"guard_level":0},{"uid":3977939,"face":"http:\u002F\u002Fi2.hdslb.com\u002Fbfs\u002Fface\u002Fff37299b20fc7a284f6d2c2b5065bf2ff84ad07d.jpg","uname":"种花家氪金兔","score":"10","rank":7,"guard_level":0}]},"video_connection_info":null,"player_throttle_info":{"status":1,"normal_sleep_time":1800,"fullscreen_sleep_time":3600,"tab_sleep_time":1800,"prompt_time":30},"guard_info":{"count":51,"anchor_guard_achieve_level":0},"hot_rank_info":{"rank":0,"trend":0,"countdown":1105,"timestamp":1614179495,"url":"https:\u002F\u002Flive.bilibili.com\u002Fp\u002Fhtml\u002Flive-app-hotrank\u002Findex.html?clientType=2&area_id=0","icon":"","area_name":""}}},"experimentalPlayerOptions":{}}</script><script>addWaifu&&addWaifu("uni")</script><script src=//s1.hdslb.com/bfs/static/blive/blfe-live-room/static/js/jquery-1.11.3.min.js></script><script src=//activity.hdslb.com/blackboard/static/edfd7948d5ca04de779233922773e479/player-latest.min.js></script><script>__PLAYER_BOOTSTRAP_FUNC__&&__PLAYER_BOOTSTRAP_FUNC__()</script><script>addWaifu&&addWaifu("rom")</script><script src=//s1.hdslb.com/bfs/static/blive/blfe-live-room/static/js/bilibili.8ef0f76bd3247a0ecc60.js></script><script src=//s1.hdslb.com/bfs/static/blive/blfe-live-room/static/js/vendors.e5ca750aadf59e5bb9fc.js></script><script src=//s1.hdslb.com/bfs/static/blive/blfe-live-room/static/js/app.16a00784b113aff40936.js></script><script>addWaifu&&addWaifu("ram")</script>

BUG Report

今天开始突然不能下载视频:
打开主程序可以正常运行且成功登录,但是在询问选择下载选项时选择了3-下载视频后,程序自动闪退。请查看日志文件
AV420682551_1635368241.log

BUG Report: attribute 'unescape' of 'HTMLParser' object has been removed since Python 3.9

Problem Description

See output below:

Traceback (most recent call last):
File "~/bili/start.py", line 2315, in
main(ip)
File "~/bili/start.py", line 1148, in main
PrintInfo.printlr(ri)
File "~/bili/PrintInfo.py", line 180, in printlr
print(f"{lan['O7']}{rhtml(d['des'])}")#简介:
File "~/bili/bstr.py", line 85, in rhtml
r=HTMLParser().unescape(r)
AttributeError: 'HTMLParser' object has no attribute 'unescape'

Reason

From bpo-37328 in Python 3.9 changelog (here), attribute 'unescape' of 'HTMLParser' object has been removed.

I just personally regard this as a bug. If you are not planning to remove code using "unescape", just close this issue.

Solution

  • Use Python 3.8

按范围选择下载视频时报错 KeyError: 'videos'

系统环境:Linux raspberrypi 5.4.51-v8+ #1327 SMP PREEMPT Thu Jul 23 11:11:34 BST 2020 aarch64 GNU/Linux
Python版本:Python-3.8.5
bili软件版本:v1.2.4
登录的B站账号为月度大会员

命令行输出:

python3 start.py
bili Copyright (C) 2019-2020 lifegpc
This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. This is free software, and you are welcome to redistribute it under certain conditions; type show c' for details.
你可以在https://github.com/lifegpc/bili上找到源代码。
当前版本:1.2.4(3de329a)
网络错误:无法获取最新稳定版本字符串。
请输入av/ss/ep/md/bv号(BV号请以BV开头)或者链接(支持用户页的收藏夹、频道、投稿、小视频链接,支持直播、直播回放和已购课程视频链接):(你可以使用","来分隔多个输入。)SS33802
登录校验成功!
ID:28229233
SSID:33802
标题:Re:从零开始的异世界生活 第二季
系列名字:Re:从零开始的异世界生活
描述:我一定会拯救你。
在打倒了魔女教大罪司教「怠惰」担当——培提其乌斯·罗曼尼康帝之后,菜月昴和爱蜜莉雅又得以重新开始。
克服了艰难的诀别,两人终于和解,然而这只是新一轮风波的序幕。
超乎想象的绝境危机,接踵而至的残酷现实。
少年将再次直面残酷的命运。
类型:番剧
发布时间:2020-07-08 23:00:00
内容:
1.第1话
标题:各自的誓言
AV号:626339509
BV号:BV1mt4y1Q74Q
CID:210288241
ID:330798
2.第2话
标题:下一个地方
AV号:498851287
BV号:BV1qK411H7QF
CID:212844570
ID:330799
3.第3话
标题:久候多时的重逢
AV号:328997408
BV号:BV1ZA411a7R7
CID:215462618
ID:330800
4.第4话
标题:亲子
AV号:371612893
BV号:BV1uZ4y1M7Ch
CID:218424302
ID:330801
5.第5话
标题:踏出的一步
AV号:969061597
BV号:BV1np4y1q7Ar
CID:221080169
ID:330802
6.第6话
标题:少女的福音
AV号:201689081
BV号:BV1Yh411d7NS
CID:223703773
ID:330803
PV:
7.正式PV
标题:
AV号:455889505
BV号:BV1r5411p7T9
CID:205208133
ID:329553
8.制作决定PV
标题:
AV号:413575139
BV号:BV1EV411k7Qq
CID:203194650
ID:329552
9.角色PV
标题: 菜月昴篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218682822
ID:333963
10.角色PV
标题:雷姆篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218682899
ID:333964
11.角色PV
标题:拉姆篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218683004
ID:333965
12.角色PV
标题:爱蜜莉雅篇
AV号:584029176
BV号:BV1tz4y1Q7ZW
CID:218683067
ID:333966
请输入你想下载的视频编号(每两个编号间用,隔开,全部下载可输入a,可以使用-分开两个数字以选择一个范围(例如:1-25)):(下载上次观看的EP330798可输入l。)1-6
Traceback (most recent call last):
File "start.py", line 1589, in
main(ip)
File "start.py", line 1478, in main
if i>0 and i<=data['videos'] and (not (i in cho)):
KeyError: 'videos'

打印报错的变量data:

{'mediaInfo': {'id': 28229233, 'ssId': 33802, 'title': 'Re:从零开始的异世界生活 第二季', 'jpTitle': '', 'series': 'Re:从零开始的异世界生活', 'alias': '', 'evaluate': '我一定会拯救你。\n在打倒了魔女教大罪司教「怠惰」担当——培提其乌斯·罗曼尼康帝之后,菜月昴和爱蜜莉雅又得以重新开始。\n克服了艰难的诀别,两人终于和解,然而这只是新一轮风波的序幕。\n超乎想象的绝境危机,接踵而至的残酷现实。\n少年将再次直面残酷的命运。', 'type': '番剧', 'time': '2020-07-08 23:00:00', 'cover': 'https://i0.hdslb.com/bfs/bangumi/image/f2425cbdb07cc93bd0d3ba1c0099bfe78f5dc58a.png'}, 'epList': [{'id': 330798, 'aid': 626339509, 'bvid': 'BV1mt4y1Q74Q', 'cid': 210288241, 'titleFormat': '第1话', 'longTitle': '各自的誓言', 'i': 0, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/417d16c9ee4d496f69319987d0a26683e651c106.jpg'}, {'id': 330799, 'aid': 498851287, 'bvid': 'BV1qK411H7QF', 'cid': 212844570, 'titleFormat': '第2话', 'longTitle': '下一个地方', 'i': 1, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/a9ddf39402010e0432b2c4033a790719752ec187.jpg'}, {'id': 330800, 'aid': 328997408, 'bvid': 'BV1ZA411a7R7', 'cid': 215462618, 'titleFormat': '第3话', 'longTitle': '久候多时的重逢', 'i': 2, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/73f7a28a765fe1536295c2e6311b285743f54d9a.jpg'}, {'id': 330801, 'aid': 371612893, 'bvid': 'BV1uZ4y1M7Ch', 'cid': 218424302, 'titleFormat': '第4话', 'longTitle': '亲子', 'i': 3, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/e3ace71c46ca99465273c95d4c9848aa6b84260b.jpg'}, {'id': 330802, 'aid': 969061597, 'bvid': 'BV1np4y1q7Ar', 'cid': 221080169, 'titleFormat': '第5话', 'longTitle': '踏出的一步', 'i': 4, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/2f5bf4840747fc7c09932d2793e96a178cd05905.jpg'}, {'id': 330803, 'aid': 201689081, 'bvid': 'BV1Yh411d7NS', 'cid': 223703773, 'titleFormat': '第6话', 'longTitle': '少女的福音', 'i': 5, 'loaded': False, 'cover': 'https://i0.hdslb.com/bfs/archive/cd0d822900707dda303bb689bf9fef0326b32d64.jpg'}], 'sections': [{'id': 48655, 'title': 'PV', 'epList': [{'id': 329553, 'aid': 455889505, 'bvid': 'BV1r5411p7T9', 'cid': 205208133, 'titleFormat': '正式PV', 'longTitle': '', 'i': 0, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/archive/23578c063dc238524b428f28f9d20087fcbb0be5.jpg'}, {'id': 329552, 'aid': 413575139, 'bvid': 'BV1EV411k7Qq', 'cid': 203194650, 'titleFormat': '制作决定PV', 'longTitle': '', 'i': 1, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/archive/e43fe78becc700ca40070dc8e4640d55eac73cb0.jpg'}, {'id': 333963, 'aid': 584029176, 'bvid': 'BV1tz4y1Q7ZW', 'cid': 218682822, 'titleFormat': '角色PV', 'longTitle': ' 菜月昴篇', 'i': 2, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/bangumi/8ea1e5e71388c19ef187bb47cb8e5c2fc8e6885d.jpg'}, {'id': 333964, 'aid': 584029176, 'bvid': 'BV1tz4y1Q7ZW', 'cid': 218682899, 'titleFormat': '角色PV', 'longTitle': '雷姆篇', 'i': 3, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/bangumi/883f7363071d1cf6982d547798ffa45975834229.jpg'}, {'id': 333965, 'aid': 584029176, 'bvid': 'BV1tz4y1Q7ZW', 'cid': 218683004, 'titleFormat': '角色PV', 'longTitle': '拉姆篇', 'i': 4, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/bangumi/05243aa4a00e28ba9aa44d5ac4d948c0070f86c9.jpg'}, {'id': 333966, 'aid': 584029176, 'bvid': 'BV1tz4y1Q7ZW', 'cid': 218683067, 'titleFormat': '角色PV', 'longTitle': '爱蜜莉雅篇', 'i': 5, 'loaded': False, 'title': 'PV', 'cover': 'https://i0.hdslb.com/bfs/bangumi/80480e9032b1dfaf9fd8c754d4f8c31ace8b6c9e.jpg'}]}]}

-bash: -d: command not found

  • 环境1 debian10,python3.7.3

  • 输入命令python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677&ftype=create -d 4 -p a --ym --yac --ndm --yad --yr --yf --mc avc --ar --ax 2 --as 5 --ak 20 --ab --fa prealloc --nsv --yma --ms 0 --yna -o /home/download/Bilibili --naf --nslt --nte --nbd --cad --bp --nin --nmt --uc --ass --dmp --vf mkv
    返回-bash: -d: command not found后继续读取视频信息,在选择下载的对话框输入a同样返回-bash: a: command not found
    root@debian:/home/download/Bilibili/bili# python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677&ftype=create -d 4 -p a --ym --yac --ndm --yad --yr --yf --mc avc --ar --ax 2 --as 5 --ak 20 --ab --fa prealloc --nsv --yma --ms 0 --yna -o /home/download/Bilibili --naf --nslt --nte --nbd --cad --bp --nin --nmt --uc --ass --dmp --vf mkv [10] 1765 -bash: -d: command not found root@debian:/home/download/Bilibili/bili# bili Copyright (C) 2019-2021 lifegpc This program comes with ABSOLUTELY NO WARRANTY; for details type show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.
    You can find the source code on https://github.com/lifegpc/bili.
    Current version:1.3.8.17(34fe8ef)
    Latest stable version:1.3.8
    The login is successfully verified.
    Favorites ID:113096677
    Favorites title :噢噢噢
    Creator's name :雨乃哟
    。省略
    。省略
    。省略
    Please enter the number of the video you want to choose (You can use "," to separate each two numbers. Use "-" to separate each two numbers to select a range.(e.g. 1-25) If you want to select all videos, please enter "a".):a
    -bash: a: command not found
    [10]+ Stopped python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677‘

  • 输入python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677&ftype=create
    同样返回command not found
    root@debian:/home/download/Bilibili/bili# python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677&ftype=create [9] 1758 root@debian:/home/download/Bilibili/bili# bili Copyright (C) 2019-2021 lifegpc This program comes with ABSOLUTELY NO WARRANTY; for details type show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type show c' for details. You can find the source code on <https://github.com/lifegpc/bili>. Current version:1.3.8.17(34fe8ef) Latest stable version:1.3.8 The login is successfully verified. Favorites ID:113096677 Favorites title :噢噢噢 Creator's name :雨乃哟 UID:3904677 Create time :2017-04-18 12:59:00 Create time:2019-01-25 07:38:12 Video count :15 Video 1 : AV number :56376267 BV number :BV1J4411u7Wz Title :【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中 。省略 。省略 。省略 Favorites time :2017-05-13 16:27:48 Please enter the number of the video you want to choose (You can use "," to separate each two numbers. Use "-" to separate each two numbers to select a range.(e.g. 1-25) If you want to select all videos, please enter "a".):a -bash: a: command not found [9]+ Stopped python3 start.py -i https://space.bilibili.com/3904677/favlist?fid=113096677

  • 环境2 windows10

  • 使用带变量的下载命令能够下载视频,但是下载方式-d 4参数无效,仍需对每个视频选择下载方式
    C:\Users\LTSC\AppData\Roaming\bili>start.exe -i https://space.bilibili.com/3904677/favlist?fid=113096677&ftype=create -d 4 -p a --ym --yac --ndm --yad --yr --yf --mc avc --ar --ax 2 --as 5 --ak 20 --ab --fa prealloc --nsv --yma --ms 0 --yna -o D:\Bilibili --naf --nslt --nte --nbd --cad --bp --nin --nmt --uc --ass --dmp --vf mkv bili Copyright (C) 2019-2021 lifegpc This program comes with ABSOLUTELY NO WARRANTY; for details type show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.
    你可以在https://github.com/lifegpc/bili上找到源代码。
    当前版本:1.3.8.17(34fe8ef)
    最新稳定版本:1.3.8
    登录校验成功!
    收藏夹ID:113096677
    收藏夹标题:噢噢噢
    创建者名字:雨乃哟
    UID:3904677
    创建时间:2017-04-18 12:59:00
    创建时间:2019-01-25 07:38:12
    视频数量:15
    视频1:
    AV号:56376267
    BV号:BV1J4411u7Wz
    标题:【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中
    UP主名称:夏酥酥_
    收藏时间:2019-06-22 11:46:31
    视频2:
    AV号:56374391
    BV号:BV1J4411u7h1
    标题:【花酱&雨乃&Killer&雾奈】Kill This Love❤BLACKPINK
    UP主名称:雾奈哟
    。省略
    。省略
    。省略
    请输入你想下载的视频编号(每两个编号间用,隔开,全部下载可输入a,可以使用-分开两个数字以选择一个范围(例如:1-25)):a
    您全选了所有视频
    登录校验成功!
    AV号:56376267
    BV号:BV1J4411u7Wz
    分P数:1
    标题:【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中
    发布时间:2019-06-22 12:00:00
    创建时间:2019-06-22 12:00:12
    描述:经过了3天的排练、编队形和紫教官的严格军训,终于把这支舞肝出来了!34度的天在阳光下面晒到神志不清也值了!!!希望观 众姥爷能给一个三连呀!
    跟小仙女们一起录舞敲开心的!都辛苦了!以后还要疯狂约舞!!!

摄影:阿斯
后期:雨乃(@雨乃哟) 阿斯
出镜:雨乃(@雨乃哟)
山竹(@山竹不吃山大竹)
弥音音(@弥音音ww)
杯杯 (@冢原野子)
夏酥酥(原PO)
UP主信息:
UID:4568488
名字:夏酥酥_
分P信息:
第1P:
CID:98515762
分P名:VIOLETA
请输入你要下载的方式:
1.当前弹幕下载
2.全弹幕下载(可能需要大量时间)
3.视频下载
4.当前弹幕+视频下载
5.全弹幕+视频下载
6.仅字幕下载
7.仅封面图片下载
8.仅音频下载4
1P下载完成
视频轨:
画质:高清 1080P60(1920x1080,avc1.64002A,50fps)
文件大小:69.06M(72417475B,5828.95kbps)
音频轨:
ID:30280
文件大小:3873.52K(3966486B,319.27kbps)
正在开始下载第1个文件,共2个文件。
单文件最大5个连接,单个服务器最大3个连接,文件分片大小20M,预分配方式为prealloc
01/19 22:48:49 [NOTICE] Downloading 1 item(s)
01/19 22:48:49 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#0ebb59 59MiB/69MiB(86%) CN:1 DL:4.8MiB ETA:1s]
01/19 22:49:01 [NOTICE] Download complete: D:/Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(高清 1080P60,avc1.64002A).m4s
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
0ebb59|OK | 5.8MiB/s|D:/Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(高清 1080P60,avc1.64002A).m4s
Status Legend:
(OK):download completed.
正在开始下载第2个文件,共2个文件。
单文件最大5个连接,单个服务器最大3个连接,文件分片大小20M,预分配方式为prealloc
01/19 22:49:01 [NOTICE] Downloading 1 item(s)
01/19 22:49:01 [NOTICE] Download complete: D:/Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(30280).m4s
Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
20c508|OK | 11MiB/s|D:/Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(30280).m4s

Status Legend:
(OK):download completed.
封面图片"D:\Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中.jpg"下载完成。
使用ffmpeg合并文件。
ffmpeg version 4.3.1-2020-11-08-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(高清 1080P60,avc1.64002A).m4s':
Metadata:
major_brand : iso5
minor_version : 1
compatible_brands: avc1iso5dsmsmsixdash
encoder : Lavf57.71.100
description : Packed by Bilibili XCoder v2.0.2
Duration: 00:01:39.30, start: 0.000000, bitrate: 5834 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 263 kb/s, 50 fps, 50 tbr, 16k tbn, 100 tbc (default)
Metadata:
handler_name : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中(30280).m4s':
Metadata:
major_brand : iso5
minor_version : 1
compatible_brands: avc1iso5dsmsmsixdash
encoder : Lavf57.71.100
description : Packed by Bilibili XCoder v2.0.2
Duration: 00:01:39.39, start: 0.040000, bitrate: 319 kb/s
Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 15 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #2, ffmetadata, from 'Temp/56376267_1611067743_metadata.txt':
Metadata:
title : 【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中 - VIOLETA
description : 经过了3天的排练、编队形和紫教官的严格军训,终于把这支舞肝出来了!34度的天在阳光下面晒到神志不清也 值了!!!希望观众姥爷能给一个三连呀!
: 跟小仙女们一起录舞敲开心的!都辛苦了!以后还要疯狂约舞!!!
:
: 摄影:阿斯
: 后期:雨乃(@雨乃哟) 阿斯
: 出镜:雨乃(@雨乃哟)
: 山竹(@山竹不吃山大竹)
: 弥音音(@弥音音ww)
: 杯杯 (@冢原野子)
: 夏酥酥(原PO)
aid : 56376267
bvid : BV1J4411u7Wz
cid : 98515762
atitle : 【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中
pubdate : 2019-06-22 12:00:00
ctime : 2019-06-22 12:00:12
uid : 4568488
artist : 夏酥酥_
author : 夏酥酥_
p : 1P/1P
part : VIOLETA
vq : 高清 1080P60,avc1.64002A
aq : 30280
purl : https://www.bilibili.com/video/av56376267
tags : 爵士舞,翻跳,街舞,明星舞蹈,舞蹈
Duration: N/A, start: 0.000000, bitrate: N/A
Output #0, matroska, to 'D:\Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中.mkv':
Metadata:
title : 【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中 - VIOLETA
description : 经过了3天的排练、编队形和紫教官的严格军训,终于把这支舞肝出来了!34度的天在阳光下面晒到神志不清也 值了!!!希望观众姥爷能给一个三连呀!
: 跟小仙女们一起录舞敲开心的!都辛苦了!以后还要疯狂约舞!!!
:
: 摄影:阿斯
: 后期:雨乃(@雨乃哟) 阿斯
: 出镜:雨乃(@雨乃哟)
: 山竹(@山竹不吃山大竹)
: 弥音音(@弥音音ww)
: 杯杯 (@冢原野子)
: 夏酥酥(原PO)
aid : 56376267
bvid : BV1J4411u7Wz
cid : 98515762
atitle : 【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中
pubdate : 2019-06-22 12:00:00
ctime : 2019-06-22 12:00:12
uid : 4568488
artist : 夏酥酥_
author : 夏酥酥_
p : 1P/1P
part : VIOLETA
vq : 高清 1080P60,avc1.64002A
aq : 30280
purl : https://www.bilibili.com/video/av56376267
tags : 爵士舞,翻跳,街舞,明星舞蹈,舞蹈
encoder : Lavf58.45.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, q=2-31, 263 kb/s, 50 fps, 50 tbr, 1k tbn, 16k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 15 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2: Attachment: none
Metadata:
filename : 【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中.jpg
mimetype : image/jpeg
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
File D:\Bilibili/【雨❀竹❀音❀原❀酥】IZONE-Violeta ❀ 隐隐约约 陷入其中.jpg -> Stream #0:2
Press [q] to stop, [?] for help
frame= 4965 fps=0.0 q=-1.0 Lsize= 75297kB time=00:01:39.35 bitrate=6208.7kbits/s speed= 349x
video:70678kB audio:3851kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.030379%
合并完成!
登录校验成功!
AV号:56374391
BV号:BV1J4411u7h1
分P数:1
标题:【花酱&雨乃&Killer&雾奈】Kill This Love❤BLACKPINK
发布时间:2019-06-22 12:00:00
创建时间:2019-06-22 02:55:03
描述:原创:AV48761639
音源:BLACKPINK
ROSE位:花酱
JENNIE位:雨乃
LISA位:Killer
JISOO位:雾奈
摄影:@阿斯Astyon
后期:雾奈

终于赶在雨乃和花酱回家前填坑了!!!大概是最晚翻跳吧,不是很齐呜呜呜!希望大家喜欢!
UP主信息:
UID:6844293
名字:雾奈哟
分P信息:
第1P:
CID:98510871
分P名:KIIL THIS LOVE最终
请输入你要下载的方式:
1.当前弹幕下载
2.全弹幕下载(可能需要大量时间)
3.视频下载
4.当前弹幕+视频下载
5.全弹幕+视频下载
6.仅字幕下载
7.仅封面图片下载
8.仅音频下载`

  • 总结

目前在debian10系统中使用py脚本无法使用命令下载,输入信息会返回“command not found”,例如“-bash: -d: command not found”
windows系统使用exe版能够正常下载,但是下载方式-d参数传递失败

命令行运行时无法识别多种选项

命令行版本无法识别转码(vf),删除无用文件(yad),删除封面(nbp)等选项。win64版本这些选项可识别。
以下是我的settings.json:
{"lan": "zh_CN", "dmgl": true, "mp": true, "ad": true, "cd": true, "rd": true, "mpc": false, "ax": 5, "sv": false, "da": true, "af": true, "bp": true, "mt": true, "y": true, "vf": "mp4", "log": false}
输出:
image
另外,可不可以把“下载全部文件”和下载类型(如"只下载视频")放进设置里?这样的话就直接用exe,不用运行python了

无法获取acgn歌会的链接

报错显示

bili  Copyright (C) 2019-2021  lifegpc
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.
    你可以在<https://github.com/lifegpc/bili>上找到源代码。

登录校验成功!
房间ID:21496316
标题:ACGN虚拟主播邀请歌会·Summer 2022
UP主名称:虚拟区高级运营_Official
UID:441666939
UP主性别:保密
个性签名:素材群:711074098(提供素材有礼物哦)
开始时间:2022-07-09 17:33:57
描述:
区域:虚拟主播-虚拟主播
标签:
房间热词:2333333,喂,妖妖零吗,红红火火恍恍惚惚,FFFFFFFFFF,Yooooooo,啪啪啪啪啪,666666666,老司机带带我,你为什么这么熟练啊,gg,prprpr,向大佬低头,请大家注意弹幕礼仪哦!,还有这种操作!,囍,打call,你气不气?,队友呢?
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/WQY916/bili/start.py", line 2700, in <module>
    res = main(ip)
  File "/data/data/com.termux/files/home/WQY916/bili/start.py", line 306, in main
    return main(ip)
  File "/data/data/com.termux/files/home/WQY916/bili/start.py", line 1520, in main
    read = videodownload.livevideodownload(info, roomInitRes, r, cho, se, ip)
  File "/data/data/com.termux/files/home/WQY916/bili/videodownload.py", line 5054, in livevideodownload
    if 'play_url' in data2 and data2['play_url'] is not None:
TypeError: argument of type 'NoneType' is not iterable

试了ytdlp和youget都可以下载

无法下载ep类型视频

无论是电影还是番剧等等ep开头的视频都无法下载。webui显示暂不支持,命令行直接显示下载成功然后消失,然而文件并没有成功下载。
Version:1.2.6.73(8729c60)

win10 一键包问题

请输入av号(支持SS、EP、MD号,BV号请以BV开头,现在已支持链接,支持用户页的收藏夹、频道、投稿、小视频链接):av2
Traceback (most recent call last):
File "start.py", line 1051, in
File "start.py", line 216, in main
File "biliLogin.py", line 22, in login
File "site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in init
File "site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
File "site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
File "site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

[949932] Failed to execute script start

image

BUG Report 6.23日起无法使用bili进行下载

在命令行界面输入链接提交下载后,首先正常提示登陆验证成功,然后异常的弹出三次浏览器窗口(并自动消失),最后提示"请在浏览器中打开 https://www.bilibili.com/video/avXXXXXXXXX 并且通过验证"。该链接页面显示已触发风控,我输入的视频连接均为bv号,而命令行返回要求验证的链接都是该bv对应的av号。
已经尝试全新安装1.4.2版本、1.4.2.5版本、重新登陆账号,均出现该问题,已经附上log文件
AV333842253_1624381632.log

Chromedriver is too old

This is just a reminder to all users, it does not need to be updated by author.
The version of Chromedriver in the current release is too old, which will lead to failure to log in.
You can download the latest Chromedriver and replacing it by yourself.

BUG Report

近期(一周内)不知道为什么一旦连着下载超过五个视频就会报获取文件大小失败。尝试重新获取……
滚动速度极快
此时ctrl+c有时候是keyboard interrupt有时候是local issuer failed to verify(原文复现不出来,大概意思是证书验证错误)

日志已发到邮箱 请查收

使用用户名和密码登录出现了问题

使用ChromeDriver登录发生错误,尝试采用用户名、密码登录。
然后我尝试使用用户名和密码登录,却发现用户名输入完成之后,密码死活不给我打,就像是卡输入法了一样,但是我确认了我已经用了英文输入法,就是没法打出来,重启电脑之后再次尝试还是如此。
偷懒不成只能翻墙去下载chromedriver,我的chrome是84版本,下载了对应的文件替换后就可以正常使用了,现在下载体验极佳,作者牛逼
但是不一定所有人都有翻墙的手段,还是希望作者大大能解决一下不能打密码的问题,我不清楚是不是我一个人的问题,但是密码打不出来确实挺奇怪的(感觉就像是死机了一样,反正就是没反应QAQ,但是我的电脑很好肯定不是死机orz)

Bug: 合集下载无法抓取全部的合集

Endpoint: https://space.bilibili.com/1/channel/index
To reproduce see: https://space.bilibili.com/348678604/channel/series
Cmd line args: -i "https://space.bilibili.com/348678604/channel/index"
一共6个只能抓出来4个
似乎是换了新的Endpoint导致的?

BUG Report 2月1日起由于BV号转AV号错误导致下载失败

通过log文件查找错误,发现2月份开始的视频,BV号链接转换为AV号时出错,还会多出-字符,因此导致下载失败

例如,BV1N4421A7yQ对应的正确AV号为av1750159495,但在log中显示其转换为了av-397324153

这个项目很久没维护了,可能到今天就不能再用了

release的程序缺six库

在Win10 64位系统使用时,提示没有安装six,怀疑打包的时候缺库。利用打包好的程序自带的python和pip安装six后可以正常运行。

BUG Report: 下载出错

下载BV1S4411x7Te时,网页提示视频撞车,调试时发现

"error":{"code":404,"trueCode":-200,"forward":"\u002Fvideo\u002Fav39232896"}

最后输出

Traceback (most recent call last):                         
  File "start.py", line 2321, in <module>                  
    main(ip)                                               
  File "start.py", line 1830, in main                      
    data=JSONParser.Myparser(parser.videodata)             
  File "D:\Code\bili\JSONParser.py", line 34, in Myparser  
    data['bvid']=obj['videoData']['bvid']                  
KeyError: 'bvid'                                           

建议:增加生成nfo信息的选项

卑微建议一下

在下载视频的时候生成一个nfo文件,nfo文件包含视频上传时间,表演者,表演者头像链接。该nfo文件配合poster图像导入倒Plex中可以达到海报墙的效果
以BV1754y1s7vd为例
image

  • nfo文件
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<movie>
  <title>超辣舔手舞!!《泫雅-Lip&Hip》❤雨乃❤</title>
  <year>2021</year>
  <premiered>2021-01-16</premiered>
  <plot>录制前准备了很多很多的一个舞蹈,已经想跳这支舞想了几百年了!今年终于终于把她实现啦~能把脑海中的一些画面还原出来真滴超满足!不过还是有很多不足和遗憾~舞蹈其实可以更好的></plot>
  <runtime>1</runtime>
  <id>BV1754y1s7vd</id>
  <genre>韩舞</genre>
  <genre>明星舞蹈</genre>
  <genre>舞蹈</genre>
  <genre>明星舞蹈</genre>
  <genre>舞蹈</genre>
  <genre>泫雅</genre>
  <genre>雨乃</genre>
  <genre>lip&hip</genre>
  <actor>
    <name>雨乃哟</name>
    <role>up</role>
    <thumb>https://i2.hdslb.com/bfs/face/b86e40f345788bf1434b463018c8e752bfd88b10.jpg@128w_128h_1o.webp</thumb>
  </actor>
</movie>
  • 文件结构
    image
  • Plex海报
    image
    image
    image

建议:希望在批量下载的时候能够增加默认下载方式的选项

非常感谢开发了这么好用的下载工具,现在非常适合把我的收藏夹下载下来。
不过在批量下载视频的时候发现不能设置默认的下载方式,每一个视频都需要选择下载方式,增加了操作步骤,希望能增加一个选择默认下载方式的设置
另外,再次非常感谢

改进:程序图标没有大图标

程序图标没有大图标,当使用大图标时会特别突兀,尤其是在桌面,别的图标都是大图标,突然出现一个小图标。

似乎Chrome Driver不支持88之后的版本

命令行模式下登陆账号,Chrome的窗口弹出之后立刻闪退,但是在命令行模式下可以继续从命令行登录,log文件提示

This version of ChromeDriver only supports Chrome version 88
Current browser version is 92.0.4515.159 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

除此之外在挂着clash代理的时候,拉取不到最新版本号,之后下载登录时也会立刻闪退,关闭代理后问题解决,log文件也附在下面了
AV847663419_1630210456.log

macos上aria2c报错

问题:aria2c报错:aria2c: unrecognized option `--async-dns=true'
应该和异步dns选项有关系,事实上不论是关还是开都会报错

  1. aria2通过homebrew安装
  2. 在m1芯片mac和x64虚拟机上都会报错

截屏2021-06-29 14 14 58

[
AV673762801_1624947077.log
](url)

建议:关于chrome/driver自动补全的建议

直接上代码吧

def Schedule_cmd(blocknum, blocksize, totalsize):
    speed = (blocknum * blocksize) / (time.time() - start_time)
    # speed_str = " Speed: %.2f" % speed
    speed_str = " Speed: %s" % format_size(speed)
    recv_size = blocknum * blocksize

    # 设置下载进度条
    f = sys.stdout
    pervent = recv_size / totalsize
    percent_str = "%.2f%%" % (pervent * 100)
    n = round(pervent * 50)
    s = ('#' * n).ljust(50, '-')
    f.write(percent_str.ljust(8, ' ') + '[' + s + ']' + speed_str)
    f.flush()
    # time.sleep(0.1)
    f.write('\r')


def Schedule(blocknum, blocksize, totalsize):
    speed = (blocknum * blocksize) / (time.time() - start_time)
    # speed_str = " Speed: %.2f" % speed
    speed_str = " Speed: %s" % format_size(speed)
    recv_size = blocknum * blocksize

    # 设置下载进度条
    f = sys.stdout
    pervent = recv_size / totalsize
    percent_str = "%.2f%%" % (pervent * 100)
    n = round(pervent * 50)
    s = ('#' * n).ljust(50, '-')
    print(percent_str.ljust(6, ' ') + '-' + speed_str)
    f.flush()
    time.sleep(2)
    # print('\r')


# 字节bytes转化K\M\G
def format_size(bytes):
    try:
        bytes = float(bytes)
        kb = bytes / 1024
    except:
        print("传入的字节格式不对")
        return "Error"
    if kb >= 1024:
        M = kb / 1024
        if M >= 1024:
            G = M / 1024
            return "%.3fG" % (G)
        else:
            return "%.3fM" % (M)
    else:
        return "%.3fK" % (kb)


def download(url, save_as=None):
    print(f"正在下载{url}")
    if save_as is None:
        save_as = url.split("/")[-1]
    urllib.request.urlretrieve(url=url, filename=save_as,
                                       reporthook=Schedule_cmd)
    
    return save_as
def decompress(file, remove=True):
    shutil.unpack_archive(file)
    if remove:
        os.remove(file)
    print(f"{file}解压完毕")
start_time = time.time()

print("检查Chrome/Chrome-driver")
if platform.system() == "Linux" and os.path.exists("/etc/debian_version"):
    prefix = "sudo " if shutil.which("sudo") else ""
    if shutil.which("chromium-browser") is None:
        os.system(f"{prefix}apt -y install chromium-browser")
    if shutil.which("chromedriver") is None:
        os.system(f"{prefix}apt -y install chromium-chromedriver")
        os.system(f"{prefix}ln -s /usr/lib/chromium-browser/chromedriver /usr/bin")
elif platform.system() == "Linux" and os.path.exists("/etc/redhat-release"):
    prefix = "sudo " if shutil.which("sudo") else ""
    if shutil.which("chromium-browser") is None:
        os.system(f"{prefix}yum -y install chromium")
    if shutil.which("chromedriver") is None:
        os.system(f"{prefix}yum -y install chromedriver")
elif platform.system() == "Windows":
    if not os.path.exists("chrome-win\\chrome.exe"):
        decompress(download("https://npm.taobao.org/mirrors/chromium-browser-snapshots/Win/706915/chrome-win.zip"))
    if not os.path.exists("chromedriver.exe"):
        decompress(download("https://npm.taobao.org/mirrors/chromedriver/79.0.3945.36/chromedriver_win32.zip"))
options = webdriver.ChromeOptions()
if platform.system() == "Linux":
    options.add_argument("no-sandbox")
if platform.system() == "Windows":
    options.binary_location = "chrome-win\\chrome.exe"
driver = webdriver.Chrome(executable_path="chromedriver.exe" if platform.system() == "Windows" else "chromedriver", options=options)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.