mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix get live second list
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -537,19 +537,20 @@ class FavHttp {
|
||||
static Future<LoadingState<List<SpaceFavData>?>> spaceFav({
|
||||
required int mid,
|
||||
}) async {
|
||||
Map<String, String> data = {
|
||||
'build': '8430300',
|
||||
final params = {
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'bili',
|
||||
'channel': 'master',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
'up_mid': mid.toString(),
|
||||
'up_mid': mid,
|
||||
};
|
||||
var res = await Request().get(
|
||||
Api.spaceFav,
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'bili-http-engine': 'cronet',
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/login.dart';
|
||||
import 'package:PiliPlus/http/ua_type.dart';
|
||||
import 'package:PiliPlus/models/common/live_search_type.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_area_list/area_item.dart';
|
||||
@@ -169,23 +170,25 @@ class LiveHttp {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'channel': 'master',
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'device': 'android',
|
||||
'device_name': 'android',
|
||||
'device_type': '0',
|
||||
'fnval': '912',
|
||||
'disable_rcmd': '0',
|
||||
'https_url_req': '1',
|
||||
if (moduleSelect == true) 'module_select': '1',
|
||||
'mobi_app': 'android_hd',
|
||||
'device_type': 0,
|
||||
'fnval': 912,
|
||||
'disable_rcmd': 0,
|
||||
'https_url_req': 1,
|
||||
if (moduleSelect == true) 'module_select': 1,
|
||||
'mobi_app': 'android',
|
||||
'network': 'wifi',
|
||||
'page': pn,
|
||||
'platform': 'android',
|
||||
if (isLogin) 'relation_page': '1',
|
||||
if (isLogin) 'relation_page': 1,
|
||||
's_locale': 'zh_CN',
|
||||
'scale': '2',
|
||||
'scale': 2,
|
||||
'statistics': Constants.statisticsApp,
|
||||
'ts': DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
};
|
||||
@@ -197,6 +200,23 @@ class LiveHttp {
|
||||
var res = await Request().get(
|
||||
Api.liveFeedIndex,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'buvid': LoginHttp.buvid,
|
||||
'fp_local':
|
||||
'1111111111111111111111111111111111111111111111111111111111111111',
|
||||
'fp_remote':
|
||||
'1111111111111111111111111111111111111111111111111111111111111111',
|
||||
'session_id': '11111111',
|
||||
'env': 'prod',
|
||||
'app-key': 'android',
|
||||
'User-Agent': Constants.userAgentApp,
|
||||
'x-bili-trace-id': Constants.traceId,
|
||||
'x-bili-aurora-eid': '',
|
||||
'x-bili-aurora-zone': '',
|
||||
'bili-http-engine': 'cronet',
|
||||
},
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(LiveIndexData.fromJson(res.data['data']));
|
||||
@@ -233,29 +253,31 @@ class LiveHttp {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'channel': 'master',
|
||||
'area_id': ?areaId,
|
||||
'parent_area_id': ?parentAreaId,
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'device': 'android',
|
||||
'device_name': 'android',
|
||||
'device_type': '0',
|
||||
'fnval': '912',
|
||||
'disable_rcmd': '0',
|
||||
'https_url_req': '1',
|
||||
'mobi_app': 'android_hd',
|
||||
'module_select': '0',
|
||||
'device_type': 0,
|
||||
'fnval': 912,
|
||||
'disable_rcmd': 0,
|
||||
'https_url_req': 1,
|
||||
'mobi_app': 'android',
|
||||
'module_select': 0,
|
||||
'network': 'wifi',
|
||||
'page': pn,
|
||||
'page_size': '20',
|
||||
'page_size': 20,
|
||||
'platform': 'android',
|
||||
'qn': '0',
|
||||
'qn': 0,
|
||||
'sort_type': ?sortType,
|
||||
'tag_version': '1',
|
||||
'tag_version': 1,
|
||||
's_locale': 'zh_CN',
|
||||
'scale': '2',
|
||||
'scale': 2,
|
||||
'statistics': Constants.statisticsApp,
|
||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
||||
'ts': DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
};
|
||||
AppSign.appSign(
|
||||
params,
|
||||
@@ -265,6 +287,23 @@ class LiveHttp {
|
||||
var res = await Request().get(
|
||||
Api.liveSecondList,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'buvid': LoginHttp.buvid,
|
||||
'fp_local':
|
||||
'1111111111111111111111111111111111111111111111111111111111111111',
|
||||
'fp_remote':
|
||||
'1111111111111111111111111111111111111111111111111111111111111111',
|
||||
'session_id': '11111111',
|
||||
'env': 'prod',
|
||||
'app-key': 'android',
|
||||
'User-Agent': Constants.userAgentApp,
|
||||
'x-bili-trace-id': Constants.traceId,
|
||||
'x-bili-aurora-eid': '',
|
||||
'x-bili-aurora-zone': '',
|
||||
'bili-http-engine': 'cronet',
|
||||
},
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(LiveSecondData.fromJson(res.data['data']));
|
||||
@@ -280,11 +319,13 @@ class LiveHttp {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'disable_rcmd': '0',
|
||||
'mobi_app': 'android_hd',
|
||||
'device': 'android',
|
||||
'disable_rcmd': 0,
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
@@ -317,11 +358,13 @@ class LiveHttp {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'disable_rcmd': '0',
|
||||
'mobi_app': 'android_hd',
|
||||
'device': 'android',
|
||||
'disable_rcmd': 0,
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
@@ -357,11 +400,13 @@ class LiveHttp {
|
||||
'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'disable_rcmd': '0',
|
||||
'mobi_app': 'android_hd',
|
||||
'device': 'android',
|
||||
'disable_rcmd': 0,
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
@@ -395,14 +440,16 @@ class LiveHttp {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'disable_rcmd': '0',
|
||||
'device': 'android',
|
||||
'disable_rcmd': 0,
|
||||
'need_entrance': 1,
|
||||
'parent_id': parentid,
|
||||
'source_id': 2,
|
||||
'mobi_app': 'android_hd',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
@@ -436,14 +483,16 @@ class LiveHttp {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'device': 'pad',
|
||||
'device': 'android',
|
||||
'page': page,
|
||||
'pagesize': 30,
|
||||
'keyword': keyword,
|
||||
'disable_rcmd': '0',
|
||||
'mobi_app': 'android_hd',
|
||||
'disable_rcmd': 0,
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
|
||||
@@ -57,21 +57,22 @@ class MemberHttp {
|
||||
required int mid,
|
||||
required int page,
|
||||
}) async {
|
||||
Map<String, String> data = {
|
||||
'build': '8430300',
|
||||
final params = {
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'bili',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
'pn': page.toString(),
|
||||
'ps': '10',
|
||||
'pn': page,
|
||||
'ps': 10,
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
'vmid': mid,
|
||||
};
|
||||
var res = await Request().get(
|
||||
Api.spaceArticle,
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'bili-http-engine': 'cronet',
|
||||
@@ -119,25 +120,26 @@ class MemberHttp {
|
||||
int? seriesId,
|
||||
includeCursor,
|
||||
}) async {
|
||||
Map<String, String> data = {
|
||||
if (aid != null) 'aid': aid.toString(),
|
||||
'build': '8430300',
|
||||
final params = {
|
||||
'aid': ?aid,
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'bili',
|
||||
'channel': 'master',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'ps': '20',
|
||||
if (pn != null) 'pn': pn.toString(),
|
||||
if (next != null) 'next': next.toString(),
|
||||
if (seasonId != null) 'season_id': seasonId.toString(),
|
||||
if (seriesId != null) 'series_id': seriesId.toString(),
|
||||
'qn': type == ContributeType.video ? '80' : '32',
|
||||
'ps': 20,
|
||||
'pn': ?pn,
|
||||
'next': ?next,
|
||||
'season_id': ?seasonId,
|
||||
'series_id': ?seriesId,
|
||||
'qn': type == ContributeType.video ? 80 : 32,
|
||||
'order': ?order,
|
||||
'sort': ?sort,
|
||||
if (includeCursor != null) 'include_cursor': includeCursor.toString(),
|
||||
'include_cursor': ?includeCursor,
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
'vmid': mid,
|
||||
};
|
||||
var res = await Request().get(
|
||||
switch (type) {
|
||||
@@ -148,7 +150,7 @@ class MemberHttp {
|
||||
ContributeType.bangumi => Api.spaceBangumi,
|
||||
ContributeType.comic => Api.spaceComic,
|
||||
},
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'bili-http-engine': 'cronet',
|
||||
@@ -193,25 +195,26 @@ class MemberHttp {
|
||||
required contain,
|
||||
required index,
|
||||
}) async {
|
||||
Map<String, String> data = {
|
||||
'aid': aid.toString(),
|
||||
'before_size': beforeSize.toString(),
|
||||
'after_size': afterSize.toString(),
|
||||
'cid': cid.toString(),
|
||||
'contain': contain.toString(),
|
||||
'index': index.toString(),
|
||||
'build': '8430300',
|
||||
final params = {
|
||||
'aid': aid,
|
||||
'before_size': beforeSize,
|
||||
'after_size': afterSize,
|
||||
'cid': cid,
|
||||
'contain': contain,
|
||||
'index': index,
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'bili',
|
||||
'channel': 'master',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
'vmid': mid,
|
||||
};
|
||||
var res = await Request().get(
|
||||
Api.spaceStory,
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'bili-http-engine': 'cronet',
|
||||
@@ -230,20 +233,21 @@ class MemberHttp {
|
||||
int? mid,
|
||||
dynamic fromViewAid,
|
||||
}) async {
|
||||
Map<String, String> data = {
|
||||
'build': '8430300',
|
||||
final params = {
|
||||
'build': 8430300,
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'bili',
|
||||
'channel': 'master',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
's_locale': 'zh_CN',
|
||||
'from_view_aid': ?fromViewAid,
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
'vmid': mid,
|
||||
};
|
||||
var res = await Request().get(
|
||||
Api.space,
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'bili-http-engine': 'cronet',
|
||||
@@ -341,7 +345,7 @@ class MemberHttp {
|
||||
'keyword': ?keyword,
|
||||
'order': order,
|
||||
'platform': 'web',
|
||||
'web_location': '1550101',
|
||||
'web_location': 1550101,
|
||||
'order_avoided': orderAvoided,
|
||||
'dm_img_list': '[]',
|
||||
'dm_img_str': dmImgStr,
|
||||
|
||||
@@ -227,7 +227,9 @@ class SearchHttp {
|
||||
final res = await Request().get(
|
||||
Api.searchRecommend,
|
||||
queryParameters: {
|
||||
'build': '8430300',
|
||||
'build': 8430300,
|
||||
'channel': 'master',
|
||||
'version': '8.43.0',
|
||||
'c_locale': 'zh_CN',
|
||||
'mobi_app': 'android',
|
||||
'platform': 'android',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
@@ -77,38 +76,38 @@ class VideoHttp {
|
||||
|
||||
// 添加额外的loginState变量模拟未登录状态
|
||||
static Future<LoadingState> rcmdVideoListApp({required int freshIdx}) async {
|
||||
Map<String, String> data = {
|
||||
'build': '2001100',
|
||||
final params = {
|
||||
'build': 2001100,
|
||||
'c_locale': 'zh_CN',
|
||||
'channel': 'master',
|
||||
'column': '4',
|
||||
'column': 4,
|
||||
'device': 'pad',
|
||||
'device_name': 'android',
|
||||
'device_type': '0',
|
||||
'disable_rcmd': '0',
|
||||
'flush': '5',
|
||||
'fnval': '976',
|
||||
'fnver': '0',
|
||||
'force_host': '2', //使用https
|
||||
'fourk': '1',
|
||||
'guidance': '0',
|
||||
'https_url_req': '0',
|
||||
'idx': freshIdx.toString(),
|
||||
'device_type': 0,
|
||||
'disable_rcmd': 0,
|
||||
'flush': 5,
|
||||
'fnval': 976,
|
||||
'fnver': 0,
|
||||
'force_host': 2, //使用https
|
||||
'fourk': 1,
|
||||
'guidance': 0,
|
||||
'https_url_req': 0,
|
||||
'idx': freshIdx,
|
||||
'mobi_app': 'android_hd',
|
||||
'network': 'wifi',
|
||||
'platform': 'android',
|
||||
'player_net': '1',
|
||||
'player_net': 1,
|
||||
'pull': freshIdx == 0 ? 'true' : 'false',
|
||||
'qn': '32',
|
||||
'recsys_mode': '0',
|
||||
'qn': 32,
|
||||
'recsys_mode': 0,
|
||||
's_locale': 'zh_CN',
|
||||
'splash_id': '',
|
||||
'statistics': Constants.statistics,
|
||||
'voice_balance': '0',
|
||||
'voice_balance': 0,
|
||||
};
|
||||
var res = await Request().get(
|
||||
Api.recommendListApp,
|
||||
queryParameters: data,
|
||||
queryParameters: params,
|
||||
options: Options(
|
||||
headers: {
|
||||
'buvid': LoginHttp.buvid,
|
||||
@@ -465,7 +464,7 @@ class VideoHttp {
|
||||
'id': id,
|
||||
'reason_id': ?reasonId,
|
||||
'feedback_id': ?feedbackId,
|
||||
'build': '1',
|
||||
'build': 1,
|
||||
'mobi_app': 'android',
|
||||
},
|
||||
);
|
||||
@@ -493,7 +492,7 @@ class VideoHttp {
|
||||
'id': id,
|
||||
'reason_id': ?reasonId,
|
||||
'feedback_id': ?feedbackId,
|
||||
'build': '1',
|
||||
'build': 1,
|
||||
'mobi_app': 'android',
|
||||
},
|
||||
);
|
||||
@@ -542,7 +541,6 @@ class VideoHttp {
|
||||
data: data,
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
log(res.toString());
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
} else {
|
||||
@@ -564,7 +562,6 @@ class VideoHttp {
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
);
|
||||
log(res.toString());
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'package:PiliPlus/http/live.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_feed_index/card_data_list_item.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_feed_index/card_list.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_feed_index/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_second_list/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_second_list/tag.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
@@ -48,16 +50,18 @@ class LiveController extends CommonListController {
|
||||
bool customHandleResponse(bool isRefresh, Success response) {
|
||||
if (isRefresh) {
|
||||
if (areaIndex.value == 0) {
|
||||
if (response.response.hasMore == 0) {
|
||||
LiveIndexData data = response.response;
|
||||
if (data.hasMore == 0) {
|
||||
isEnd = true;
|
||||
}
|
||||
topState.value = Pair(
|
||||
first: response.response.followItem,
|
||||
second: response.response.areaItem,
|
||||
first: data.followItem,
|
||||
second: data.areaItem,
|
||||
);
|
||||
} else {
|
||||
count = response.response.count;
|
||||
newTags = response.response.newTags;
|
||||
LiveSecondData data = response.response;
|
||||
count = data.count;
|
||||
newTags = data.newTags;
|
||||
if (sortType != null) {
|
||||
tagIndex.value =
|
||||
newTags?.indexWhere((e) => e.sortType == sortType) ?? -1;
|
||||
@@ -117,6 +121,9 @@ class LiveController extends CommonListController {
|
||||
}
|
||||
|
||||
void onSelectArea(int index, CardLiveItem? cardLiveItem) {
|
||||
if (isLoading) {
|
||||
return; // areaIndex conflict
|
||||
}
|
||||
if (index == areaIndex.value) {
|
||||
return;
|
||||
}
|
||||
@@ -134,6 +141,9 @@ class LiveController extends CommonListController {
|
||||
}
|
||||
|
||||
void onSelectTag(int index, String? sortType) {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
tagIndex.value = index;
|
||||
this.sortType = sortType;
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ class LiveAreaChildController
|
||||
);
|
||||
|
||||
void onSelectTag(int index, String? sortType) {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
tagIndex.value = index;
|
||||
this.sortType = sortType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user