mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
@@ -262,9 +262,9 @@ class Api {
|
||||
'https://s.search.bilibili.com/main/suggest';
|
||||
|
||||
// 分类搜索
|
||||
static const String searchByType = '/x/web-interface/search/type';
|
||||
static const String searchByType = '/x/web-interface/wbi/search/type';
|
||||
|
||||
static const String searchAll = '/x/web-interface/search/all/v2';
|
||||
static const String searchAll = '/x/web-interface/wbi/search/all/v2';
|
||||
|
||||
// 记录视频播放进度
|
||||
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/report.md
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models_new/search/search_rcmd/data.dart';
|
||||
import 'package:PiliPlus/models_new/search/search_trending/data.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -53,7 +54,7 @@ class SearchHttp {
|
||||
int? pubBegin,
|
||||
int? pubEnd,
|
||||
}) async {
|
||||
var params = {
|
||||
var params = await WbiSign.makSign({
|
||||
'search_type': searchType.name,
|
||||
'keyword': keyword,
|
||||
'page': page,
|
||||
@@ -65,7 +66,7 @@ class SearchHttp {
|
||||
'category_id': ?categoryId,
|
||||
'pubtime_begin_s': ?pubBegin,
|
||||
'pubtime_end_s': ?pubEnd,
|
||||
};
|
||||
});
|
||||
var res = await Request().get(
|
||||
Api.searchByType,
|
||||
queryParameters: params,
|
||||
@@ -117,7 +118,7 @@ class SearchHttp {
|
||||
int? pubBegin,
|
||||
int? pubEnd,
|
||||
}) async {
|
||||
var params = {
|
||||
var params = await WbiSign.makSign({
|
||||
'keyword': keyword,
|
||||
'page': page,
|
||||
if (order?.isNotEmpty == true) 'order': order,
|
||||
@@ -128,7 +129,7 @@ class SearchHttp {
|
||||
'category_id': ?categoryId,
|
||||
'pubtime_begin_s': ?pubBegin,
|
||||
'pubtime_end_s': ?pubEnd,
|
||||
};
|
||||
});
|
||||
var res = await Request().get(
|
||||
Api.searchAll,
|
||||
queryParameters: params,
|
||||
|
||||
@@ -828,11 +828,11 @@ class VideoHttp {
|
||||
assert(aid != null || bvid != null);
|
||||
var res = await Request().get(
|
||||
Api.playInfo,
|
||||
queryParameters: {
|
||||
queryParameters: await WbiSign.makSign({
|
||||
'aid': ?aid,
|
||||
'bvid': ?bvid,
|
||||
'cid': cid,
|
||||
},
|
||||
}),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:PiliPlus/services/account_service.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -79,7 +80,10 @@ class HomeController extends GetxController
|
||||
|
||||
Future<void> querySearchDefault() async {
|
||||
try {
|
||||
var res = await Request().get(Api.searchDefault);
|
||||
var res = await Request().get(
|
||||
Api.searchDefault,
|
||||
queryParameters: await WbiSign.makSign({'web_location': 333.1365}),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
defaultSearch.value = res.data['data']?['name'] ?? '';
|
||||
// defaultSearch.value = res.data['data']?['show_name'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user