iawia002 / lux

👾 Fast and simple video download library and CLI tool written in Go
MIT License
25.97k stars 2.88k forks source link

bilibili不能下载1080p,全是480p #1167

Open jiecaoshixiao opened 1 year ago

jiecaoshixiao commented 1 year ago

就我bilibili不能下载1080p吗,全是480p,想下1080p还需要-c 加cookie

startonedu-teacher commented 1 year ago

The same problem. Is there any solution for this? Or maybe there might be some specific options we don't know.

rerelurelu commented 1 year ago

I had the same problem. But, I have solved that problem and the solution is below.

Note To be sure, I recommend that you clear your bilibili cookies and log back in before doing so. The version of lux is v0.16.0 and the browser used is Chrome.

  1. Create a file for cookie input We need to pass a cookie in order to download the file in 1080p.

    touch bilibili_cookie.txt
  2. Access bilibili and check your cookies After accessing bilibili, press F12 to open the developer tool. Then open Application > Storage > Cookies > https://www.bilibili.com and make sure that Name and Value are displayed.

  3. Edit bilibili_cookie.txt

image2

Writes the values in the yellow-circled area in the image above to bilibili_cookie.txt. Write in the form Name=Value;.

Warning Don't forget to write a ; for each Name=Value pair

For example

innersign=xxxxxx; l=xxxxxx; ...

When you are finished, save and close the file.

  1. Download a movie Specify bilibili_cookie.txt with the -c option when downloading.

For example, if you want to download a video in 1080p, the command would be as follows.

# If there is bilibili_cookie.txt in the working directory.
lux -c bilibili_cookie.txt -f 80-7 https://url/of/the/video/you/want/to/download

# If bilibili_cookie.txt is in a different directory than the working directory
lux -c path/to/bilibili_cookie.txt -f 80-7 https://url/of/the/video/you/want/to/download
tERyceNzAchE commented 1 year ago

I had the same problem. But, I have solved that problem and the solution is below.

This solution did not work for me.

martinguo-dc commented 1 year ago

I follow your steps to do, but a cookie error still appeared. @zoniha

Here is my example: D:\usual tools\lux\lux_downloadtext>lux -c path/to/bilibili_cookie.txt https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click&vd_source=8f0608bfaae2286e4a4dc9a819847861 Downloading https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click error: cookie error: 账号未登录 github.com/iawia002/lux/extractors/bilibili.genAPI /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:53 github.com/iawia002/lux/extractors/bilibili.bilibiliDownload /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:322 github.com/iawia002/lux/extractors/bilibili.extractNormalVideo /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:205 github.com/iawia002/lux/extractors/bilibili.(extractor).Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:300 github.com/iawia002/lux/extractors.Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/extractors.go:52 github.com/iawia002/lux/app.download /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:271 github.com/iawia002/lux/app.New.func1 /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:248 github.com/urfave/cli/v2.(App).RunContext /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 github.com/urfave/cli/v2.(*App).Run /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main /Users/iawia002/go/src/github.com/iawia002/lux/main.go:13 runtime.main /usr/local/Cellar/go/1.18.1/libexec/src/runtime/proc.go:250 runtime.goexit /usr/local/Cellar/go/1.18.1/libexec/src/runtime/asm_amd64.s:1571 'vd_source' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

abyss-stars commented 1 year ago

I met the same questions such this: Snipaste_2023-01-03_17-47-12

also i am sure that my cookies settings are right

SaraKale commented 1 year ago

Cookie.txt is invalid for me, but "SESSDATA=value" is valid example:

lux -c "SESSDATA=value" -i "url"
NOBB2333 commented 1 year ago

我遇到了同样的问题,例如: Snipaste_2023-01-03_17-47-12

我也确定我的 cookie 设置是正确的

let's see my config

as begining must sure ur txt file have no "enter" or \n ihave same problem with u, ,after i make this all in one row ,it work

让我们看看我的配置 开头必须确保您的txt文件没有“enter”或“\n` 我和你有同样的问题,当我去掉换行,它就起作用了 还有一件事 我是下载全部列表 -p

l=v;b_lsid=A437ED710_18646A6026A;b_timer=%7B%22ffp%22%3A%7B%22333.788.fp.risk_FF855B3C%22%3A%221823F4CDB42%22%7D%7D;fingerprint=79cb2e73a4e0d87cb37640af0ec10777;PVID=1;b_ut=5;buvid4=D049881D-DBBF-3D1A-F34D-73BBE93C98E877673-022072718-QMGIJd%2B6%2F0wJsKPOgWil4Q%3D%3D;bp_video_offset_5968613=761862696700215000;CURRENT_FNVAL=4048;DedeUserID__ckMd5=750001c36f09aa1e;bili_jct=07909e27a7306d4aacad2a1e9ce1cda3;CURRENT_QUALITY=80;LIVE_BUVID=AUTO6716707625093650;innersign=1;SESSDATA=ddeeea63%2C1691759066%2Ceac84%2A21;i-wanna-go-back=-1;buvid_fp=ee16009ab907c6b406d7fef749067b07;theme_style=light;rpdid=|(Y|l~lkmll0J'uYY)~))ull;nostalgia_conf=-1;b_nut=100;sid=72rvovo3;bsource=search_bing;DedeUserID=5968613;l=v;CURRENT_BLACKGAP=1;_uuid=E141882A-8BFB-BD1F-F9B2-99AB91587EF877172infoc;buvid3=FF855B3C-667B-1FF2-30B2-011F9DF8241E76517infoc;
lux -c "bilibili_cookie.txt" -i -p "https://www.bilibili.com/video/BV1K7411J75M/?p=3&vd_source=0dcd1aeacc2d7bcb0df18eb2c33bb434"
savagekw commented 1 year ago

don't need to copy all other values, just this is enough for me.

Cookie.txt is invalid for me, but "SESSDATA=value" is valid example:

lux -c "SESSDATA=value" -i "url"
yyh12138 commented 1 year ago

only SESSDATA are required in bili_cookie.txt, and they will refresh when user signs in again

tianyaloveprogram commented 1 year ago

why need this config or download by this way?

DoudiNCer commented 1 year ago

I had the same problem. But, I have solved that problem and the solution is below.

Note To be sure, I recommend that you clear your bilibili cookies and log back in before doing so. The version of lux is v0.16.0 and the browser used is Chrome.

  1. Create a file for cookie input We need to pass a cookie in order to download the file in 1080p.
touch bilibili_cookie.txt
  1. Access bilibili and check your cookies After accessing bilibili, press F12 to open the developer tool. Then open Application > Storage > Cookies > https://www.bilibili.com and make sure that Name and Value are displayed.
  2. Edit bilibili_cookie.txt

image2

Writes the values in the yellow-circled area in the image above to bilibili_cookie.txt. Write in the form Name=Value;.

Warning Don't forget to write a ; for each Name=Value pair

For example

innersign=xxxxxx; l=xxxxxx; ...

When you are finished, save and close the file.

  1. Download a movie Specify bilibili_cookie.txt with the -c option when downloading.

For example, if you want to download a video in 1080p, the command would be as follows.

# If there is bilibili_cookie.txt in the working directory.
lux -c bilibili_cookie.txt -f 80-7 https://url/of/the/video/you/want/to/download

# If bilibili_cookie.txt is in a different directory than the working directory
lux -c path/to/bilibili_cookie.txt -f 80-7 https://url/of/the/video/you/want/to/download

貌似只需要“SESSDATA”属性就可以(我没大会员,只下1080p)(参考了另一个项目 yutto,它只要给出这个属性的值进行)

syayys commented 11 months ago

I follow your steps to do, but a cookie error still appeared. @zoniha

Here is my example: D:\usual tools\lux\lux_downloadtext>lux -c path/to/bilibili_cookie.txt https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click&vd_source=8f0608bfaae2286e4a4dc9a819847861 Downloading https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click error: cookie error: 账号未登录 github.com/iawia002/lux/extractors/bilibili.genAPI /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:53 github.com/iawia002/lux/extractors/bilibili.bilibiliDownload /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:322 github.com/iawia002/lux/extractors/bilibili.extractNormalVideo /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:205 github.com/iawia002/lux/extractors/bilibili.(extractor).Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:300 github.com/iawia002/lux/extractors.Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/extractors.go:52 github.com/iawia002/lux/app.download /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:271 github.com/iawia002/lux/app.New.func1 /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:248 github.com/urfave/cli/v2.(App).RunContext /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 github.com/urfave/cli/v2.(*App).Run /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main /Users/iawia002/go/src/github.com/iawia002/lux/main.go:13 runtime.main /usr/local/Cellar/go/1.18.1/libexec/src/runtime/proc.go:250 runtime.goexit /usr/local/Cellar/go/1.18.1/libexec/src/runtime/asm_amd64.s:1571 'vd_source' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

我也是,该怎么解决啊555

NOBB2333 commented 11 months ago

I follow your steps to do, but a cookie error still appeared. @zoniha Here is my example: D:\usual tools\lux\lux_downloadtext>lux -c path/to/bilibili_cookie.txt https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click&vd_source=8f0608bfaae2286e4a4dc9a819847861 Downloading https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click error: cookie error: 账号未登录 github.com/iawia002/lux/extractors/bilibili.genAPI /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:53 github.com/iawia002/lux/extractors/bilibili.bilibiliDownload /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:322 github.com/iawia002/lux/extractors/bilibili.extractNormalVideo /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:205 github.com/iawia002/lux/extractors/bilibili.(extractor).Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:300 github.com/iawia002/lux/extractors.Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/extractors.go:52 github.com/iawia002/lux/app.download /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:271 github.com/iawia002/lux/app.New.func1 /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:248 github.com/urfave/cli/v2.(App).RunContext /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 github.com/urfave/cli/v2.(*App).Run /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main /Users/iawia002/go/src/github.com/iawia002/lux/main.go:13 runtime.main /usr/local/Cellar/go/1.18.1/libexec/src/runtime/proc.go:250 runtime.goexit /usr/local/Cellar/go/1.18.1/libexec/src/runtime/asm_amd64.s:1571 'vd_source' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

我也是,该怎么解决啊555

登录、刷新、复制、保存

image

bilibili_cookie.txt

buvid3=FF855B3C-667B-1FF2-30B2-011F9DF8241E76517infoc; CURRENT_BLACKGAP=1; CURRENT_FNVAL=4048; _uuid=E141882A-8BFB-BD1F-F9B2-99AB91587EF877172infoc; buvid_fp=ee16009ab907c6b406d7fef749067b07; b_nut=100; i-wanna-go-back=-1; DedeUserID=5968613; DedeUserID__ckMd5=750001c36f09aa1e; nostalgia_conf=-1; buvid4=D049881D-DBBF-3D1A-F34D-73BBE93C98E877673-022072718-QMGIJd%2B6%2F0wJsKPOgWil4Q%3D%3D; b_ut=5; rpdid=|(Y|l~lkmll0J'uYY)~))ull; LIVE_BUVID=AUTO6716707625093650; header_theme_version=CLOSE; CURRENT_PID=8d16e8c0-cfc1-11ed-b71a-693906e58095; home_feed_column=5; FEED_LIVE_VERSION=V8; bsource=search_bing; CURRENT_QUALITY=80; browser_resolution=1994-1002; PVID=1; fingerprint=acb5c884296f2c6a90376bb6d469ddd4; SESSDATA=358c456b%2C1705144027%2C6d0c0%2A71KGBGsZclsXVDLXoWzdN1iPmyQBrf9Yr6i6l-2dg-wS42kZyyBjqXgabUvqfVfK7KUvcYygAADQA; bili_jct=abc03b648e015c2dd3c05ac81209e44d; sid=7dpgxubx; bp_video_offset_5968613=819263392521912600; b_lsid=9F10A2242_189694666DF

Powershell

lux -c .\bilibili_cookie.txt -p "https://www.bilibili.com/video/BV1dP4y1c7qd?p=9&vd_source=0dcd1aeacc2d7bcb0df18eb2c33bb434"
syayys commented 11 months ago

%HWM`~K0D)X IPQCWBI(HF2 wow我完全复制你的代码还是显示未登录

syayys commented 11 months ago

JGE TP~RJLS_33E`E}MF4O 还是失败了 cookies应该没找错,还是未登录

NOBB2333 commented 11 months ago

JGE TP~RJLS_33E`E}MF4O 还是失败了 cookies应该没找错,还是未登录

你这个不对,少信息,你直接在附加找打包好的exe,是7M,解压后17M左右,用那个,b站有接口,很多种类COOKIE 找不到 翻翻前面人的,人家说的很清楚了,去 Application 里面找,那事全部的数据,你自己找的不全,要不要偷懒一个个手K,要么找到合适的 image

image

image

buvid3=FF855B3C-667B-1FF2-30B2-011F9DF8241E76517infoc; CURRENT_BLACKGAP=1; CURRENT_FNVAL=4048; _uuid=E141882A-8BFB-BD1F-F9B2-99AB91587EF877172infoc; buvid_fp=ee16009ab907c6b406d7fef749067b07; b_nut=100; i-wanna-go-back=-1; DedeUserID=5968613; DedeUserID__ckMd5=750001c36f09aa1e; nostalgia_conf=-1; buvid4=D049881D-DBBF-3D1A-F34D-73BBE93C98E877673-022072718-QMGIJd%2B6%2F0wJsKPOgWil4Q%3D%3D; b_ut=5; rpdid=|(Y|l~lkmll0J'uYY)~))ull; LIVE_BUVID=AUTO6716707625093650; header_theme_version=CLOSE; CURRENT_PID=8d16e8c0-cfc1-11ed-b71a-693906e58095; home_feed_column=5; FEED_LIVE_VERSION=V8; bsource=search_bing; CURRENT_QUALITY=80; browser_resolution=1994-1002; PVID=1; fingerprint=acb5c884296f2c6a90376bb6d469ddd4; SESSDATA=358c456b%2C1705144027%2C6d0c0%2A71KGBGsZclsXVDLXoWzdN1iPmyQBrf9Yr6i6l-2dg-wS42kZyyBjqXgabUvqfVfK7KUvcYygAADQA; bili_jct=abc03b648e015c2dd3c05ac81209e44d; sid=7dpgxubx; bp_video_offset_5968613=819263392521912600; b_lsid=9F10A2242_189694666DF

要还不行,只能说你无缘了

syayys commented 11 months ago

附加找打包好的exe,是7M,解压后17M左右

谢谢你的回复,附加找打包好的exe,是7M,解压后17M左右 ,,请问这个在哪里下载

ilovecwr commented 10 months ago

I use macOS Big Sur. The following lines work for me.

touch bilibili_cookie.txt echo 'SESSDATA=value;' > bilibili_cookie.txt lux -c "bilibili_cookie.txt" ..................

ljh2023 commented 9 months ago

朋友们,使用sessdata的确可以,我的cookie也搞了好多次都不行,但是命令行使用sessdata就可以

999sanfentang commented 8 months ago

不需要复制所有其他值,这对我来说就足够了。

Cookie.txt 对我来说无效,但“SESSDATA=value”是有效的示例:

lux -c "SESSDATA=value" -i "url"

太好了

tuantuanyyyy commented 8 months ago

sessdata=value测试了一下不行,cookie一开始用也不行,后来账号重新登陆了以下,更新了cookie之后确实是可以了

lanpigwen commented 5 months ago

image

获取-c cookie.txt格式(key=value;key=value;...)

可以下载一个获取cookie的插件:cookie editor,然后导出(export 选择Netscape),就导出到了粘贴板上,再新建个cookie.txt,粘贴进去就行。再参考-c cookie.txt

JR-Eagle commented 2 months ago

I follow your steps to do, but a cookie error still appeared. @zoniha

Here is my example: D:\usual tools\lux\lux_downloadtext>lux -c path/to/bilibili_cookie.txt https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click&vd_source=8f0608bfaae2286e4a4dc9a819847861 Downloading https://www.bilibili.com/video/av776801254/?spm_id_from=333.880.my_history.page.click error: cookie error: 账号未登录 github.com/iawia002/lux/extractors/bilibili.genAPI /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:53 github.com/iawia002/lux/extractors/bilibili.bilibiliDownload /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:322 github.com/iawia002/lux/extractors/bilibili.extractNormalVideo /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:205 github.com/iawia002/lux/extractors/bilibili.(extractor).Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/bilibili/bilibili.go:300 github.com/iawia002/lux/extractors.Extract /Users/iawia002/go/src/github.com/iawia002/lux/extractors/extractors.go:52 github.com/iawia002/lux/app.download /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:271 github.com/iawia002/lux/app.New.func1 /Users/iawia002/go/src/github.com/iawia002/lux/app/app.go:248 github.com/urfave/cli/v2.(App).RunContext /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 github.com/urfave/cli/v2.(*App).Run /Users/iawia002/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main /Users/iawia002/go/src/github.com/iawia002/lux/main.go:13 runtime.main /usr/local/Cellar/go/1.18.1/libexec/src/runtime/proc.go:250 runtime.goexit /usr/local/Cellar/go/1.18.1/libexec/src/runtime/asm_amd64.s:1571 'vd_source' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

清楚bili网站的cookie后,会退出登录.需要重新登录,再复制sessdata=value

bobbyz007 commented 1 month ago

亲测只需要保存SESSDATA就可以了。