mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
opt: account (#1306)
* opt: account * opt: account * opt: live api * opt: buvid * Revert "opt: buvid" This reverts commit da1ea68f8bfd0b9af6958062557c85135ab8b08d. * tweak
This commit is contained in:
committed by
GitHub
parent
6b4fb0d611
commit
1345fd36e4
@@ -4,6 +4,7 @@ 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/account_type.dart';
|
||||
import 'package:PiliPlus/models/common/live_search_type.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_area_list/area_item.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_area_list/area_list.dart';
|
||||
@@ -20,12 +21,20 @@ import 'package:PiliPlus/models_new/live/live_search/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_second_list/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_superchat/data.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/app_sign.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class LiveHttp {
|
||||
static Future sendLiveMsg({roomId, msg, dmType, emoticonOptions}) async {
|
||||
abstract final class LiveHttp {
|
||||
static Account get recommend => Accounts.get(AccountType.recommend);
|
||||
|
||||
static Future sendLiveMsg({
|
||||
required Object roomId,
|
||||
required Object msg,
|
||||
Object? dmType,
|
||||
Object? emoticonOptions,
|
||||
}) async {
|
||||
String csrf = Accounts.main.csrf;
|
||||
var res = await Request().post(
|
||||
Api.sendLiveMsg,
|
||||
@@ -165,11 +174,10 @@ class LiveHttp {
|
||||
|
||||
static Future<LoadingState<LiveIndexData>> liveFeedIndex({
|
||||
required int pn,
|
||||
required bool isLogin,
|
||||
bool moduleSelect = false,
|
||||
}) async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'access_key': ?recommend.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'channel': 'master',
|
||||
'actionKey': 'appkey',
|
||||
@@ -187,7 +195,7 @@ class LiveHttp {
|
||||
'network': 'wifi',
|
||||
'page': pn,
|
||||
'platform': 'android',
|
||||
if (isLogin) 'relation_page': 1,
|
||||
if (recommend.isLogin) 'relation_page': 1,
|
||||
's_locale': 'zh_CN',
|
||||
'scale': 2,
|
||||
'statistics': Constants.statisticsApp,
|
||||
@@ -245,13 +253,12 @@ class LiveHttp {
|
||||
|
||||
static Future<LoadingState<LiveSecondData>> liveSecondList({
|
||||
required int pn,
|
||||
required bool isLogin,
|
||||
required areaId,
|
||||
required parentAreaId,
|
||||
required Object? areaId,
|
||||
required Object? parentAreaId,
|
||||
String? sortType,
|
||||
}) async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'access_key': ?recommend.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'channel': 'master',
|
||||
@@ -313,11 +320,9 @@ class LiveHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<List<AreaList>?>> liveAreaList({
|
||||
required bool isLogin,
|
||||
}) async {
|
||||
static Future<LoadingState<List<AreaList>?>> liveAreaList() async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'access_key': ?recommend.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
@@ -352,9 +357,7 @@ class LiveHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<List<AreaItem>>> getLiveFavTag({
|
||||
required bool isLogin,
|
||||
}) async {
|
||||
static Future<LoadingState<List<AreaItem>>> getLiveFavTag() async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
@@ -432,11 +435,10 @@ class LiveHttp {
|
||||
}
|
||||
|
||||
static Future<LoadingState<List<AreaItem>?>> liveRoomAreaList({
|
||||
required bool isLogin,
|
||||
required parentid,
|
||||
required Object parentid,
|
||||
}) async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'access_key': ?recommend.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
@@ -473,13 +475,12 @@ class LiveHttp {
|
||||
}
|
||||
|
||||
static Future<LoadingState<LiveSearchData>> liveSearch({
|
||||
required bool isLogin,
|
||||
required int page,
|
||||
required String keyword,
|
||||
required LiveSearchType type,
|
||||
}) async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'access_key': ?recommend.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
|
||||
Reference in New Issue
Block a user