Closed pepapu closed 6 years ago
annie 的 cookies 格式不一样,具体看一下 README
cookies 没问题的话就可以的,0mb 可能是网络问题,你多试两次
提问前我就是看了#37,按照F12复制Request URL
为https://www.bilibili.com/bangumi/play/xxxxx/
内全部的Cookie:
信息。
经测试,这样做可以获得普通视频(https://www.bilibili.com/video/av数字数字数字/
)的1080p+,但番剧类(https://www.bilibili.com/bangumi/play/ep数字数字数字/
)一律是0MiB
如果直接用番剧内标题下的avXXXXXX
链接,提示越界panic: runtime error: index out of range
。
番剧不能用普通的那种链接下,必须用 bangumi 这种地址
普通视频有番没有,是不是那个番本来就没有 1080p+
我所有测试的视频都带有1080p+版本,
随便测试了几个
异世界居酒屋~古都阿伊特力亚的居酒屋阿信~:第1话 关东煮的马铃薯 / 炸雏鸡块
https://www.bilibili.com/bangumi/play/ep199969/
女神异闻录5 动画版:第1话 我是你 你是我
https://www.bilibili.com/bangumi/play/ep200332/
ALICE or ALICE:第2话 玛可和可可挑战做菜
https://www.bilibili.com/bangumi/play/ep199898/
我是选中1080p+
的状态下复制的cookies
最后的结果全部是这样(1080p都是正常返回结果)
Status Code: 200
Site: 哔哩哔哩 bilibili.com
Title: ALICE or ALICE:第2话 玛可和可可挑战做菜
Type: video
Streams: # All available quality
[default] -------------------
Size: 0.00 MiB (0 Bytes)
# download with: annie -f default "URL"
https://www.bilibili.com/bangumi/play/ep200514/
这个是非官网上传的日剧,但带有企业认证,应该是正版,同样也返回0.00MiB
Status Code: 200
Site: 哔哩哔哩 bilibili.com
Title: 真田丸:第9回 驱引
Type: video
Streams: # All available quality
[default] -------------------
Size: 0.00 MiB (0 Bytes)
# download with: annie -f default "URL"
如果不加载cookies直接获取,annie -d -i https://www.bilibili.com/bangumi/play/ep199898/
,返回的就是正常结果
Status Code: 200
Site: 哔哩哔哩 bilibili.com
Title: ALICE or ALICE:第2话 玛可和可可挑战做菜
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P
Size: 27.12 MiB (28433672 Bytes)
# download with: annie -f default "URL"
然后随便找了几个带1080p+的普通视频
https://www.bilibili.com/video/av21796818/
Status Code: 200
Site: 哔哩哔哩 bilibili.com
Title: 【英雄联盟 不一样的CG混剪】英雄从未消失 P1
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P+
Size: 156.54 MiB (164143273 Bytes)
# download with: annie -f default "URL"
https://www.bilibili.com/video/av21972738/
Status Code: 200
Site: 哔哩哔哩 bilibili.com
Title: 【曼食慢语】我在这道甜点里藏了颗草莓少女心,切开看看吧 #夜深了,请放毒#
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P+
Size: 275.74 MiB (289137872 Bytes)
# download with: annie -f default "URL"
全部都能得到正确结果
OK,我空了调试一下
我试了几个都可以哎
$ annie -i -c ~/Desktop/cookies.txt https://www.bilibili.com/bangumi/play/ep200514
Site: 哔哩哔哩 bilibili.com
Title: 真田丸:第9回 驱引
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P+
Size: 1296.45 MiB (1359430859 Bytes)
# download with: annie -f default "URL"
$ annie -i -c ~/Desktop/cookies.txt https://www.bilibili.com/bangumi/play/ep198381
Site: 哔哩哔哩 bilibili.com
Title: 狐妖小红娘:第79话 南国公主的吃货本色
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P+
Size: 950.46 MiB (996624860 Bytes)
# download with: annie -f default "URL"
换linux (mint)试了下,结果和windows10下一样,返回0.00MiB
现象上来说可能和地区限定的番剧一样, 但试了下港澳台限定在国内ip下annie返回的size是0.12MiB,而不是0.00MiB
Site: 哔哩哔哩 bilibili.com
Title: 銀河英雄傳說 Die Neue These(僅限港澳台地區):第2话 阿斯提會戰
Type: video
Streams: # All available quality
[default] -------------------
Size: 0.12 MiB (124627 Bytes)
# download with: annie -f default "URL"
那问题只可能出在cookies上,我有2个大会员号,结果都一样, 是否是我复制的cookies有问题? 我加载了以下这些cookies
_dfcaptcha
bili_jct
buvid3
DedeUserID
DedeUserID__ckMd5
finger
fts
LIVE_BUVID
SESSDATA
sid
你在 chrome 里面把 request 头里面的所有 cookie 都复制上
就是复制了所有的cookies, 想不出还有什么其他变量,没法确定是不是个例,debug信息也都正常 只能等待其他用户的反馈,确认下是否是个例
同时我试了lulu用非cookies.sqlite方式查询,用firefox扩展cookies.txt 导出cookies为Netscape HTTP Cookie的cookies.txt文件, 结果无法得到1080p+,表现为和没加载cookies的状态一样,得到了普通1080和720、480等格式
备注:annie的cookies.txt是按照
name=value; name2=value2; ...
格式吧?试验的时候我都按这个格式,而lulu我用的是Netscape HTTP Cookie格式
推测是否和cookies有关?但lulu的sqlite格式又能准确得到1080p+的文件
annie的cookies.txt是按照name=value; name2=value2; ...格式吧?试验的时候我都按这个格式,而lulu我用的是Netscape HTTP Cookie格式
是的,和 lulu 不一样
@iawia002 请问你的cookies是复制哪个request的?
Chrome -> Network -> Request Headers -> Cookie
cookies我是拿到了,但还是获取不了1080P+的视频
cookies如下
dssid dsess balh_season_ep183799 buvid3 finger fts sid DedeUserID DedeUserID__ckMd5 SESSDATA bili_jct LIVE_BUVID rpdid balh_season_ss21680 CURRENT_QUALITY _dfcaptcha
@asyuan 普通(非番剧)有 1080P+ 的视频你能获取到吗?你的情况是不是和 @pepapu 一样
普通(非番剧)的1080P+的视频能获取到,就是番剧的视频获取不到,和@pepapu的情况一样。
我确实发现了一个问题,这个问题会导致除了动漫的其他番剧下载不了,但是你测试的狐妖小红娘不应该出现这个问题,我在本地也没有复现
你们访问一下下面这个地址,把结果贴上来我看一下:
我的结果如下,有 1080P+:
{
"accept_description": [
"高清 1080P+",
"高清 1080P",
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"accept_format": "hdflv2,flv,flv720,flv480,flv360",
"accept_quality": [
112,
80,
64,
32,
15
],
"bp": 0,
"code": 0,
"durl": [
{
"backup_url": [
"http://cn-hbyc2-dx-v-07.acgvideo.com/vg5/upgcxcode/51/65/36386551/36386551-1-112.flv?expires=1524202200&platform=pc&ssig=K2wScni-x6ck6g03CFC3nQ&oi=3063167962&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfa=2028618451&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9",
"http://upos-hz-mirrorks3.acgvideo.com/upgcxcode/51/65/36386551/36386551-1-112.flv?e=ig8euxZM2rNcNbRg7WTzhwdlhbU1hbTVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEVEuxTEto8i8o859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&deadline=1524202452&dynamic=1&gen=playurl&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&oi=3063167962&os=ks3&platform=pc&rate=1256300&trid=4d4a869f486a450c947a30912c39f7b9&uipk=5&uipv=5&um_deadline=1524202452&um_sign=f90e053456d1fdac206effc60d943775&upsig=27ed326de5a7ff1ed1c24d2858c8584e"
],
"length": 399187,
"order": 1,
"size": 295162635,
"url": "http://cn-scnc3-dx.acgvideo.com/vg5/upgcxcode/51/65/36386551/36386551-1-112.flv?expires=1524202200&platform=pc&ssig=K2wScni-x6ck6g03CFC3nQ&oi=3063167962&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfa=2028618451&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9"
},
{
"backup_url": [
"http://cn-hbyc2-dx-v-07.acgvideo.com/vg0/upgcxcode/51/65/36386551/36386551-2-112.flv?expires=1524202200&platform=pc&ssig=keKx744scXak5_Dt0Rtb9g&oi=3063167962&nfa=JyHZPkZRe2vq7g7YI3K1kw==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9",
"http://upos-hz-mirrorks3.acgvideo.com/upgcxcode/51/65/36386551/36386551-2-112.flv?e=ig8euxZM2rNcNbRz7zUzhwdlhbuBhwTVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEVEuxTEto8i8o859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&deadline=1524202452&dynamic=1&gen=playurl&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&oi=3063167962&os=ks3&platform=pc&rate=1375300&trid=4d4a869f486a450c947a30912c39f7b9&uipk=5&uipv=5&um_deadline=1524202452&um_sign=622f4154ef490150bf48962ad9a0a75a&upsig=d8bacad7d4352e721807e803f5aba971"
],
"length": 280854,
"order": 2,
"size": 227278464,
"url": "http://cn-scnc3-dx.acgvideo.com/vg7/upgcxcode/51/65/36386551/36386551-2-112.flv?expires=1524202200&platform=pc&ssig=83L1qQM-arPg_vZ4GCejzg&oi=3063167962&nfa=JyHZPkZRe2vq7g7YI3K1kw==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9"
},
{
"backup_url": [
"http://cn-hbyc2-dx-v-07.acgvideo.com/vg3/upgcxcode/51/65/36386551/36386551-3-112.flv?expires=1524202200&platform=pc&ssig=5-spq2FfeE2vY6fpPe9acQ&oi=3063167962&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9",
"http://upos-hz-mirroross.acgvideo.com/upgcxcode/51/65/36386551/36386551-3-112.flv?e=ig8euxZM2rNcNbRgnwR3hwdlhbUjhzTVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEVEuxTEto8i8o859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&deadline=1524202452&dynamic=1&gen=playurl&oi=3063167962&os=oss&platform=pc&rate=1281800&trid=4d4a869f486a450c947a30912c39f7b9&uipk=5&uipv=5&um_deadline=1524202452&um_sign=8d57d9570a555deb0fb6d2df7db3ec7d&upsig=7fbfc1b0bf72fe823f8fe1e0fd4ce3cc"
],
"length": 367147,
"order": 3,
"size": 277123012,
"url": "http://cn-scnc3-dx.acgvideo.com/vg6/upgcxcode/51/65/36386551/36386551-3-112.flv?expires=1524202200&platform=pc&ssig=vKWGG4pyIKyIavYtXpdhsQ&oi=3063167962&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9"
},
{
"backup_url": [
"http://cn-hbyc2-dx-v-07.acgvideo.com/vg4/upgcxcode/51/65/36386551/36386551-4-112.flv?expires=1524202200&platform=pc&ssig=YBmbP0ecM3QRf3tCU0vJfQ&oi=3063167962&nfa=B2jsoD9cEoAmG7KPYo7s2g==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9",
"http://upos-hz-mirrorkodou.acgvideo.com/upgcxcode/51/65/36386551/36386551-4-112.flv?e=ig8euxZM2rNcNbRMhzh1hwdlhb4j7bNVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEVEuxTEto8i8o859r1qXg8xNEVE5XREto8GuFGv2U7SuxI72X6fTr859IB_&deadline=1524202452&gen=playurl&oi=3063167962&os=kodou&platform=pc&trid=4d4a869f486a450c947a30912c39f7b9&uipk=5&uipv=5&upsig=dff1900b1091a8ac4d5fc35fc59dccf3"
],
"length": 463702,
"order": 4,
"size": 391312474,
"url": "http://cn-scnc3-dx.acgvideo.com/vg4/upgcxcode/51/65/36386551/36386551-4-112.flv?expires=1524202200&platform=pc&ssig=YBmbP0ecM3QRf3tCU0vJfQ&oi=3063167962&nfa=B2jsoD9cEoAmG7KPYo7s2g==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4d4a869f486a450c947a30912c39f7b9"
}
],
"format": "hdflv2",
"from": "local",
"has_paid": false,
"quality": 112,
"result": "suee",
"seek_param": "start",
"seek_type": "offset",
"status": 2,
"timelength": 1510890,
"vip_status": 1,
"vip_type": 2
}
{ "accept_description": [ "高清 1080P+", "高清 1080P", "高清 720P", "清晰 480P", "流畅 360P" ], "accept_format": "hdflv2,flv,flv720,flv480,flv360", "accept_quality": [ 112, 80, 64, 32, 15 ], "bp": 0, "code": 0, "durl": [ { "backup_url": [ "http://cn-jsnt2-dx-v-13.acgvideo.com/vg1/upgcxcode/51/65/36386551/36386551-1-112.flv?expires=1524202500&platform=pc&ssig=v4bf9gAsQBjWhHIxsm9NjA&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfa=2028618659&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6", "http://cn-hbyc2-dx-v-07.acgvideo.com/vg5/upgcxcode/51/65/36386551/36386551-1-112.flv?expires=1524202500&platform=pc&ssig=96v3gB_fgX3tYzLbOww31A&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfa=2028618659&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" ], "length": 399187, "order": 1, "size": 295162635, "url": "http://cn-zjwz3-dx-v-11.acgvideo.com/vg4/upgcxcode/51/65/36386551/36386551-1-112.flv?expires=1524202500&platform=pc&ssig=HOet1wEAbY20qfQqYqY1uA&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfa=2028618659&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" }, { "backup_url": [ "http://cn-jsnt2-dx-v-13.acgvideo.com/vg2/upgcxcode/51/65/36386551/36386551-2-112.flv?expires=1524202500&platform=pc&ssig=mMGyCJhC--oVIo1kexc2TQ&oi=3683225534&nfa=JyHZPkZRe2vq7g7YI3K1kw==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6", "http://cn-hbyc2-dx-v-07.acgvideo.com/vg0/upgcxcode/51/65/36386551/36386551-2-112.flv?expires=1524202500&platform=pc&ssig=mgo_mZ2tBRjVGbOOnEh9IA&oi=3683225534&nfa=JyHZPkZRe2vq7g7YI3K1kw==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" ], "length": 280854, "order": 2, "size": 227278464, "url": "http://cn-zjwz3-dx-v-11.acgvideo.com/vg2/upgcxcode/51/65/36386551/36386551-2-112.flv?expires=1524202500&platform=pc&ssig=mMGyCJhC--oVIo1kexc2TQ&oi=3683225534&nfa=JyHZPkZRe2vq7g7YI3K1kw==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" }, { "backup_url": [ "http://cn-jsnt2-dx-v-13.acgvideo.com/vg5/upgcxcode/51/65/36386551/36386551-3-112.flv?expires=1524202500&platform=pc&ssig=DfIETqaZyWvyc1itmWE22A&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6", "http://cn-hbyc2-dx-v-07.acgvideo.com/vg3/upgcxcode/51/65/36386551/36386551-3-112.flv?expires=1524202500&platform=pc&ssig=1L_K1s7oCAymlRzaiJLfWQ&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" ], "length": 367147, "order": 3, "size": 277123012, "url": "http://cn-zjwz3-dx-v-11.acgvideo.com/vg5/upgcxcode/51/65/36386551/36386551-3-112.flv?expires=1524202500&platform=pc&ssig=DfIETqaZyWvyc1itmWE22A&oi=3683225534&nfa=7YaHycOrw0UDEXwF5P/9zQ==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" }, { "backup_url": [ "http://cn-jsnt2-dx-v-13.acgvideo.com/vg0/upgcxcode/51/65/36386551/36386551-4-112.flv?expires=1524202500&platform=pc&ssig=-uHUFvGwmLmmEzfJT3hAYA&oi=3683225534&nfa=B2jsoD9cEoAmG7KPYo7s2g==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6", "http://cn-hbyc2-dx-v-07.acgvideo.com/vg4/upgcxcode/51/65/36386551/36386551-4-112.flv?expires=1524202500&platform=pc&ssig=lc4_4REp8E28FgscP5dEew&oi=3683225534&nfa=B2jsoD9cEoAmG7KPYo7s2g==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" ], "length": 463702, "order": 4, "size": 391312474, "url": "http://cn-zjwz3-dx-v-11.acgvideo.com/vg3/upgcxcode/51/65/36386551/36386551-4-112.flv?expires=1524202500&platform=pc&ssig=cU2na20u88PZH78x1UENXA&oi=3683225534&nfa=B2jsoD9cEoAmG7KPYo7s2g==&dynamic=1&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=853c988f247841dcab42449dcc1eb8b6" } ], "format": "hdflv2", "from": "local", "has_paid": false, "quality": 112, "result": "suee", "seek_param": "start", "seek_type": "offset", "status": 2, "timelength": 1510890, "vip_status": 1, "vip_type": 2 }
这结果正常呀,你再用 annie 试一下,加一个 -d,把输出的结果贴上来
annie -i -d ...
@iawia002 没问题
@asyuan OK,那我把你上面那条暴露 cookie 的评论也删了
@pepapu @asyuan 试一下 0.6.7,如果还有问题再贴上来
更新到0.6.7就可以了
$ annie -c ~/Downloads/cookies.txt -i https://www.bilibili.com/bangumi/play/ep198381 Site: 哔哩哔哩 bilibili.com Title: 狐妖小红娘:第79话 南国公主的吃货本色 Type: video Streams: # All available quality [default] ------------------- Quality: 高清 1080P+ Size: 950.46 MiB (996624860 Bytes) # download with: annie -f default "URL"
顺便说一下,0.6.7 引入了短链接,B 站可以直接用 av 或者 ep 来下
$ annie -i ep198381
Site: 哔哩哔哩 bilibili.com
Title: 狐妖小红娘:第79话 南国公主的吃货本色
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P
Size: 485.23 MiB (508798478 Bytes)
# download with: annie -f default "URL"
1080P+ cookies
我是用以下四项
-c "sid=****; DedeUserID=12345678; DedeUserID__ckMd5=123456789abcdf; SESSDATA=e123456f%2C1234567822%2Cabcde45;"
之前用lulu,加载firefox的cookies.sqlite就可以下载1080p+了。 annie可以下到1080p,但不知道如何通过大会员下1080p+,试了下复制请求头里的cookies加载后-i 显示size是0.00MiB