mod: 更新playUrl接口
This commit is contained in:
@ -11,7 +11,7 @@ class Api {
|
|||||||
|
|
||||||
// 视频流
|
// 视频流
|
||||||
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
||||||
static const String videoUrl = '/x/player/playurl';
|
static const String videoUrl = '/x/player/wbi/playurl';
|
||||||
|
|
||||||
// 视频详情
|
// 视频详情
|
||||||
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
|
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
|
||||||
|
@ -122,27 +122,33 @@ class VideoHttp {
|
|||||||
static Future videoUrl(
|
static Future videoUrl(
|
||||||
{int? avid, String? bvid, required int cid, int? qn}) async {
|
{int? avid, String? bvid, required int cid, int? qn}) async {
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
// 'avid': avid,
|
|
||||||
'bvid': bvid,
|
|
||||||
'cid': cid,
|
'cid': cid,
|
||||||
// 'qn': qn ?? 80,
|
'qn': qn ?? 80,
|
||||||
// 获取所有格式的视频
|
// 获取所有格式的视频
|
||||||
'fnval': 4048,
|
'fnval': 4048,
|
||||||
// 'fnver': '',
|
|
||||||
'fourk': 1,
|
|
||||||
// 'session': '',
|
|
||||||
// 'otype': '',
|
|
||||||
// 'type': '',
|
|
||||||
// 'platform': '',
|
|
||||||
// 'high_quality': ''
|
|
||||||
};
|
};
|
||||||
|
if (avid != null) {
|
||||||
|
data['avid'] = avid;
|
||||||
|
}
|
||||||
|
if (bvid != null) {
|
||||||
|
data['bvid'] = bvid;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map params = await WbiSign().makSign({
|
||||||
|
...data,
|
||||||
|
'fourk': 1,
|
||||||
|
'voice_balance': 1,
|
||||||
|
'gaia_source': 'pre-load',
|
||||||
|
'web_location': 1550101,
|
||||||
|
});
|
||||||
|
|
||||||
// 免登录查看1080p
|
// 免登录查看1080p
|
||||||
if (userInfoCache.get('userInfoCache') == null &&
|
if (userInfoCache.get('userInfoCache') == null &&
|
||||||
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
|
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
|
||||||
data['try_look'] = 1;
|
data['try_look'] = 1;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
var res = await Request().get(Api.videoUrl, data: data);
|
var res = await Request().get(Api.videoUrl, data: params);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
|
Reference in New Issue
Block a user