mod: lint

mod: tweaks

opt: publish page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-04 11:37:13 +08:00
parent 2cfad80214
commit caa58e9d7d
313 changed files with 2751 additions and 2789 deletions

View File

@@ -1,4 +1,4 @@
import 'constants.dart';
import 'package:PiliPlus/http/constants.dart';
class Api {
// 推荐视频

View File

@@ -63,7 +63,7 @@ class DanmakuHttp {
int? pool, // 弹幕池选择0普通池 1字幕池 2特殊池代码/BAS弹幕默认普通池0
//int? rnd,// 当前时间戳*1000000若无此项则发送弹幕冷却时间限制为90s若有此项则发送弹幕冷却时间限制为5s
bool? colorful, //60001专属渐变彩色需要会员
int? checkbox_type, //是否带 UP 身份标识0普通4带有标识
int? checkboxType, //是否带 UP 身份标识0普通4带有标识
// String? csrf,//CSRF Token位于 Cookie Cookie 方式必要
// String? access_key,// APP 登录 Token APP 方式必要
}) async {
@@ -84,7 +84,7 @@ class DanmakuHttp {
'pool': pool,
'rnd': DateTime.now().microsecondsSinceEpoch,
'colorful': colorful == true ? 60001 : null,
'checkbox_type': checkbox_type,
'checkbox_type': checkboxType,
'csrf': Accounts.main.csrf,
// 'access_key': access_key,
}..removeWhere((key, value) => value == null);

View File

@@ -128,9 +128,10 @@ class Request {
..autoUncompress = false; // Http2Adapter没有自动解压, 统一行为
// 设置代理
if (enableSystemProxy) {
client.findProxy = (_) => 'PROXY $systemProxyHost:$systemProxyPort';
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
client
..findProxy = ((_) => 'PROXY $systemProxyHost:$systemProxyPort')
..badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
}
return client;
});

View File

@@ -86,10 +86,10 @@ class LoginHttp {
required String cid,
required String tel,
// String? deviceTouristId,
String? gee_challenge,
String? gee_seccode,
String? gee_validate,
String? recaptcha_token,
String? geeChallenge,
String? geeSeccode,
String? geeValidate,
String? recaptchaToken,
}) async {
int timestamp = DateTime.now().millisecondsSinceEpoch;
var data = {
@@ -100,16 +100,16 @@ class LoginHttp {
'cid': cid,
// if (deviceTouristId != null) 'device_tourist_id': deviceTouristId,
'disable_rcmd': '0',
if (gee_challenge != null) 'gee_challenge': gee_challenge,
if (gee_seccode != null) 'gee_seccode': gee_seccode,
if (gee_validate != null) 'gee_validate': gee_validate,
if (geeChallenge != null) 'gee_challenge': geeChallenge,
if (geeSeccode != null) 'gee_seccode': geeSeccode,
if (geeValidate != null) 'gee_validate': geeValidate,
'local_id': buvid,
// https://chinggg.github.io/post/appre/
'login_session_id':
md5.convert(utf8.encode(buvid + timestamp.toString())).toString(),
'mobi_app': 'android_hd',
'platform': 'android',
if (recaptcha_token != null) 'recaptcha_token': recaptcha_token,
if (recaptchaToken != null) 'recaptcha_token': recaptchaToken,
's_locale': 'zh_CN',
'statistics': Constants.statistics,
'tel': tel,
@@ -183,10 +183,10 @@ class LoginHttp {
required String password,
required String key,
required String salt,
String? gee_challenge,
String? gee_seccode,
String? gee_validate,
String? recaptcha_token,
String? geeChallenge,
String? geeSeccode,
String? geeValidate,
String? recaptchaToken,
}) async {
dynamic publicKey = RSAKeyParser().parse(key);
String passwordEncrypted =
@@ -209,15 +209,15 @@ class LoginHttp {
.base64),
'from_pv': 'main.homepage.avatar-nologin.all.click',
'from_url': Uri.encodeComponent('bilibili://pegasus/promo'),
if (gee_challenge != null) 'gee_challenge': gee_challenge,
if (gee_seccode != null) 'gee_seccode': gee_seccode,
if (gee_validate != null) 'gee_validate': gee_validate,
if (geeChallenge != null) 'gee_challenge': geeChallenge,
if (geeSeccode != null) 'gee_seccode': geeSeccode,
if (geeValidate != null) 'gee_validate': geeValidate,
'local_id': buvid, //LoginUtils.generateBuvid(),
'mobi_app': 'android_hd',
'password': passwordEncrypted,
'permission': 'ALL',
'platform': 'android',
if (recaptcha_token != null) 'recaptcha_token': recaptcha_token,
if (recaptchaToken != null) 'recaptcha_token': recaptchaToken,
's_locale': 'zh_CN',
'statistics': Constants.statistics,
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),

View File

@@ -564,6 +564,6 @@ class MsgHttp {
}
static String getDevId() {
return Uuid().v4();
return const Uuid().v4();
}
}

View File

@@ -23,8 +23,9 @@ class RetryInterceptor extends Interceptor {
}
(options..path = redirectUrl).maxRedirects--;
if (status == 303) {
options.data = null;
options.method = 'GET';
options
..data = null
..method = 'GET';
}
Request.dio
.fetch(options)

View File

@@ -605,7 +605,7 @@ class UserHttp {
}
}
static videoTags({required String bvid}) async {
static Future<Map<String, dynamic>> videoTags({required String bvid}) async {
var res =
await Request().get(Api.videoTags, queryParameters: {'bvid': bvid});
if (res.data['code'] == 0) {

View File

@@ -950,11 +950,11 @@ class VideoHttp {
}
String processList(List list) {
final sb = StringBuffer('WEBVTT\n\n');
sb.writeAll(
list.map((item) =>
'${item?['sid'] ?? 0}\n${subtitleTimecode(item['from'])} --> ${subtitleTimecode(item['to'])}\n${item['content'].trim()}'),
'\n\n');
final sb = StringBuffer('WEBVTT\n\n')
..writeAll(
list.map((item) =>
'${item?['sid'] ?? 0}\n${subtitleTimecode(item['from'])} --> ${subtitleTimecode(item['to'])}\n${item['content'].trim()}'),
'\n\n');
return sb.toString();
}