opt: note

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-29 10:56:35 +08:00
parent eea5257da2
commit 6ea8ffea7a
6 changed files with 50 additions and 21 deletions

View File

@@ -735,5 +735,7 @@ class Api {
static const String delNote = '/x/note/del';
static const String delPublishNote = '/x/note/publish/del';
static const String archiveNote = '/x/note/list/archive';
}

View File

@@ -270,13 +270,17 @@ class Request {
}
static String headerUa({type = 'mob'}) {
return type == 'mob'
? Platform.isIOS
? 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 BiliApp/62000200'
: 'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36'
: type == 'ios'
? 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 BiliApp/62000200'
: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15';
return switch (type) {
'mob' => Platform.isIOS
? 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 BiliApp/62000200'
: 'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36',
'android' =>
'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36',
'ios' =>
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 BiliApp/62000200',
_ =>
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15'
};
}
static String responseDecoder(List<int> responseBytes, RequestOptions options,

View File

@@ -1176,12 +1176,13 @@ class VideoHttp {
}
static Future delNote({
required bool isPublish,
required List noteIds,
}) async {
final res = await Request().post(
Api.delNote,
isPublish ? Api.delPublishNote : Api.delNote,
data: {
'note_ids': noteIds.join(','),
isPublish ? 'cvids' : 'note_ids': noteIds.join(','),
'csrf': Accounts.main.csrf,
},
options: Options(