mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 08:36:17 +08:00
@@ -7,13 +7,13 @@ import 'package:PiliPlus/utils/accounts.dart';
|
||||
class BlackHttp {
|
||||
static Future<LoadingState<BlackListData>> blackList({
|
||||
required int pn,
|
||||
int? ps,
|
||||
int ps = 50,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.blackLst,
|
||||
queryParameters: {
|
||||
'pn': pn,
|
||||
'ps': ps ?? 50,
|
||||
'ps': ps,
|
||||
're_version': 0,
|
||||
'jsonp': 'jsonp',
|
||||
'csrf': Accounts.main.csrf,
|
||||
|
||||
@@ -7,7 +7,7 @@ class FanHttp {
|
||||
static Future<LoadingState<FansData>> fans({
|
||||
int? vmid,
|
||||
int? pn,
|
||||
int? ps,
|
||||
int ps = 20,
|
||||
String? orderType,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
|
||||
@@ -7,7 +7,7 @@ class FollowHttp {
|
||||
static Future<LoadingState<FollowData>> followings({
|
||||
int? vmid,
|
||||
int? pn,
|
||||
int? ps,
|
||||
int ps = 50,
|
||||
String orderType = '',
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
@@ -32,7 +32,7 @@ class FollowHttp {
|
||||
static Future<LoadingState<FollowData>> followingsNew({
|
||||
int? vmid,
|
||||
int? pn,
|
||||
int? ps,
|
||||
int ps = 20,
|
||||
String orderType = '', // ''=>最近关注,'attention'=>最常访问
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
|
||||
@@ -280,16 +280,6 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 取消请求
|
||||
*
|
||||
* 同一个cancel token 可以用于多个请求,当一个cancel token取消时,所有使用该cancel token的请求都会被取消。
|
||||
* 所以参数可选
|
||||
*/
|
||||
void cancelRequests(CancelToken token) {
|
||||
token.cancel("cancelled");
|
||||
}
|
||||
|
||||
static String responseDecoder(
|
||||
List<int> responseBytes,
|
||||
RequestOptions options,
|
||||
|
||||
@@ -526,12 +526,12 @@ class MemberHttp {
|
||||
}
|
||||
|
||||
// 获取某分组下的up
|
||||
static Future<LoadingState<FollowData>> followUpGroup(
|
||||
static Future<LoadingState<FollowData>> followUpGroup({
|
||||
int? mid,
|
||||
int? tagid,
|
||||
int? pn,
|
||||
int? ps,
|
||||
) async {
|
||||
int ps = 20,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.followUpGroup,
|
||||
queryParameters: {
|
||||
|
||||
@@ -816,7 +816,7 @@ class VideoHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future vttSubtitles(String subtitleUrl) async {
|
||||
static Future<String?> vttSubtitles(String subtitleUrl) async {
|
||||
String subtitleTimecode(num seconds) {
|
||||
int h = seconds ~/ 3600;
|
||||
seconds %= 3600;
|
||||
@@ -842,8 +842,8 @@ class VideoHttp {
|
||||
|
||||
var res = await Request().get("https:$subtitleUrl");
|
||||
|
||||
if (res.data?['body'] is List) {
|
||||
return await compute(processList, res.data['body'] as List);
|
||||
if (res.data?['body'] case List list) {
|
||||
return compute<List, String>(processList, list);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user