Comments (4)
from bilibili-api-collect.
from bilibili-api-collect.
I strongly suggest that you capture network requests with Charles, Fiddler or any else, and investigate the difference of headers between normal API request and your custom one.
What's more, without code examples passengers cannot help you much.
Seems that server side will detect API request source or any else. Try copy cURL and exec it within your Linux PC.
curl 'https://api.bilibili.com/pgc/player/web/v2/playurl?support_multi_audio=true&avid=875387952&cid=1319952964&qn=80&fnver=0&fnval=4048&fourk=1&gaia_source=&from_client=BROWSER&ep_id=782163&session=5a90f7022988409ff9fa72a3c25cd576&voice_balance=1&drm_tech_type=2' \
-H 'authority: api.bilibili.com' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: zh-CN,zh;q=0.9' \
-H 'cache-control: no-cache' \
-H $'cookie: ***' \
-H 'dnt: 1' \
-H 'origin: https://www.bilibili.com' \
-H 'pragma: no-cache' \
-H 'referer: https://www.bilibili.com/bangumi/play/ep782163' \
-H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'sec-gpc: 1' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
--compressed
Further investigation is needed.
from bilibili-api-collect.
I strongly suggest that you capture network requests with Charles, Fiddler or any else, and investigate the difference of headers between normal API request and your custom one.
What's more, without code examples passengers cannot help you much.
Seems that server side will detect API request source or any else. Try copy cURL and exec it within your Linux PC.
curl 'https://api.bilibili.com/pgc/player/web/v2/playurl?support_multi_audio=true&avid=875387952&cid=1319952964&qn=80&fnver=0&fnval=4048&fourk=1&gaia_source=&from_client=BROWSER&ep_id=782163&session=5a90f7022988409ff9fa72a3c25cd576&voice_balance=1&drm_tech_type=2' \ -H 'authority: api.bilibili.com' \ -H 'accept: application/json, text/plain, */*' \ -H 'accept-language: zh-CN,zh;q=0.9' \ -H 'cache-control: no-cache' \ -H $'cookie: ***' \ -H 'dnt: 1' \ -H 'origin: https://www.bilibili.com' \ -H 'pragma: no-cache' \ -H 'referer: https://www.bilibili.com/bangumi/play/ep782163' \ -H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "Windows"' \ -H 'sec-fetch-dest: empty' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-site: same-site' \ -H 'sec-gpc: 1' \ -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \ --compressedFurther investigation is needed.
我使用了您提供的命令(已修改cookie),但仍然没有效果,无法获取1080p以上的内容
并且,我是用的php,这是我的代码(部分代码已省略)
$sessiondata = $_GET['sessiondata'] ?? null;
function geturl($url, $cookie){
$headerArray = array("Content-type:application/json","Accept:application/json, text/plain, */*","Accept-Language:zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2","Cache-Control:no-cache","Connection:keep-alive","Origin:https://www.bilibili.com");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_COOKIE, urldecode($cookie));
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, "https://www.bilibili.com/");
curl_setopt($ch,CURLOPT_HTTPHEADER,$headerArray);
$output = curl_exec($ch);
curl_close($ch);
$output = json_decode($output,true);
return $output;
}
$preurl = "https://api.bilibili.com/pgc/player/web/v2/playurl?avid=" . $_GET['aid'] . "&cid=" . $_GET['cid'] . "&qn=127&fnver=0&fnval=4048&fourk=1&type=dash&otype=json&from_client=BROWSER&drm_tech_type=2";
echo json_encode(geturl($preurl, $sessiondata),JSON_UNESCAPED_UNICODE);
from bilibili-api-collect.
Related Issues (20)
- 求一个高级弹幕参数含义 HOT 6
- 频道相关失效
- New headers `deviceinfo` and `applist` found and simple analysis HOT 1
- web端密码登录校验规则是改变了吗 HOT 1
- [补充] 视频合集与列表 HOT 1
- 部分接口需要登陆,如何在py中登陆呢 HOT 2
- user/info 接口 用wbi 显示 403 权限不足 ,求解答 HOT 7
- 疑似新增 cookie `csrftoken` HOT 3
- 评论明细接口疑似新增校验,同样的参数只能获取到3条评论 HOT 4
- [Web API Risk Control] `dm_img` series risk control params collection HOT 2
- 新转正号?
- TV端的up视频列表, 可以一次拿到分P的所有cid HOT 6
- 昨天上传了一个视频,但是在老uwp客户端的bv号显示不对,而且这个bug延续至今 HOT 1
- 发送短信验证码_web端:86103 请下载最新版本哔哩哔哩App完成注册或继续登录 HOT 1
- Proto文件有格式错误 HOT 2
- 关于birthday字段的含义 HOT 4
- buvid_fp 这个是怎么来的 HOT 4
- 自己的直播间获取不了直播视频流 HOT 1
- APP端用户视频列表 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bilibili-api-collect.