Coder Social home page Coder Social logo

Comments (7)

Henryhaohao avatar Henryhaohao commented on July 25, 2024 1

哈哈的确,直接用这个API很方便呀~😄
但是怎么获取不同画质的视频下载链接呢,还望指点,默认就直接是最高质量的 @daofeng2015

from bilibili_video_download.

blogwy avatar blogwy commented on July 25, 2024 1

https://api.bilibili.com/x/player/playurl?avid=44743619&cid=78328965&qn=80&otype=json
qn参数就是清晰度
可选值:
80 高清1080P
64 高清720P
32 清晰480P
16 流畅360P

上面是普通会员可选的清晰度。然后,大会员720+好像是72,1080+ 忘了。

from bilibili_video_download.

Henryhaohao avatar Henryhaohao commented on July 25, 2024 1

谢谢老哥啦~那我就用这个接口写个新代码了😄 @blogwy

from bilibili_video_download.

Henryhaohao avatar Henryhaohao commented on July 25, 2024 1

哈哈,不好意思大家~
今早有大佬提醒我了: 不管是什么视频 下载之后都是最低清晰度 哪怕选择了80也是只有480p的分辨率
我试了一下还真的是这样, 昨天都没注意到呢
所以我还是改回原来加密接口的版本吧, 可以下720,1080的视频
最后, 哈哈还是要感谢两位大大😄 @daofeng2015 @blogwy

from bilibili_video_download.

blogwy avatar blogwy commented on July 25, 2024 1

请求的时候header要加上这个:
headers: {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:56.0) Gecko/20100101 Firefox/56.0',
'Host': 'api.bilibili.com',
'Cookie': 'SESSDATA=bd125cdd%2C1554519358%2C6d4df231'
}
SESSDATA从登录的cookie里面取,你试试。我以前就是这么干的。但是不知道现在还可以吗。

from bilibili_video_download.

Henryhaohao avatar Henryhaohao commented on July 25, 2024 1

嗯 加上cookie的确可以获取到720p及以上的清晰度了;
谢谢大佬指点! @blogwy

from bilibili_video_download.

dfaofeng avatar dfaofeng commented on July 25, 2024 1

需要登录的.传入cookie就行了,b站默认游客只能获取到480p,登录720和1080,大会员可以720p/60,1080p/60

from bilibili_video_download.

Related Issues (20)

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.