mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-24 20:35:50 +08:00
@@ -25,7 +25,7 @@ class AccountManager extends Interceptor {
|
||||
Api.replyReplyList,
|
||||
Api.heartBeat,
|
||||
Api.ab2c,
|
||||
Api.bangumiInfo,
|
||||
Api.pgcInfo,
|
||||
Api.liveRoomInfo,
|
||||
Api.liveRoomInfoH5,
|
||||
Api.onlineTotal,
|
||||
@@ -35,8 +35,8 @@ class AccountManager extends Interceptor {
|
||||
Api.liveRoomDmToken,
|
||||
Api.liveRoomDmPrefetch,
|
||||
Api.searchByType,
|
||||
Api.memberDynamicSearch,
|
||||
Api.memberArchive
|
||||
Api.dynSearch,
|
||||
Api.searchArchive
|
||||
},
|
||||
AccountType.recommend: {
|
||||
Api.recommendListWeb,
|
||||
@@ -52,7 +52,7 @@ class AccountManager extends Interceptor {
|
||||
Api.searchTrending,
|
||||
Api.searchRecommend,
|
||||
},
|
||||
AccountType.video: {Api.videoUrl, Api.bangumiVideoUrl}
|
||||
AccountType.video: {Api.ugcUrl, Api.pgcUrl}
|
||||
};
|
||||
|
||||
static const loginApi = {
|
||||
|
||||
@@ -85,7 +85,7 @@ class PiliScheme {
|
||||
String? id = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||
if (id != null) {
|
||||
bool isEp = path.contains('/ep/');
|
||||
PageUtils.viewBangumi(
|
||||
PageUtils.viewPgc(
|
||||
seasonId: isEp ? null : id,
|
||||
epId: isEp ? id : null,
|
||||
progress: uri.queryParameters['start_progress'],
|
||||
@@ -201,7 +201,7 @@ class PiliScheme {
|
||||
if (path.startsWith('/season')) {
|
||||
String? seasonId = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||
if (seasonId != null) {
|
||||
PageUtils.viewBangumi(seasonId: seasonId, epId: null);
|
||||
PageUtils.viewPgc(seasonId: seasonId, epId: null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -655,7 +655,7 @@ class PiliScheme {
|
||||
if (id != null) {
|
||||
bool isSeason = id.startsWith('ss');
|
||||
id = id.substring(2);
|
||||
PageUtils.viewBangumi(
|
||||
PageUtils.viewPgc(
|
||||
seasonId: isSeason ? id : null,
|
||||
epId: isSeason ? null : id,
|
||||
progress: uri.queryParameters['start_progress'],
|
||||
|
||||
@@ -8,21 +8,21 @@ class Em {
|
||||
return matches.lastOrNull?.group(1) ?? origin;
|
||||
}
|
||||
|
||||
static List<Map<String, String>> regTitle(String origin) {
|
||||
List<Map<String, String>> res = [];
|
||||
static List<({bool isEm, String text})> regTitle(String origin) {
|
||||
List<({bool isEm, String text})> res = [];
|
||||
origin.splitMapJoin(
|
||||
_exp,
|
||||
onMatch: (Match match) {
|
||||
String matchStr = match[0]!;
|
||||
res.add({'type': 'em', 'text': regCate(matchStr)});
|
||||
return matchStr;
|
||||
res.add((isEm: true, text: regCate(matchStr)));
|
||||
return '';
|
||||
},
|
||||
onNonMatch: (String str) {
|
||||
if (str != '') {
|
||||
str = decodeHtmlEntities(str);
|
||||
res.add({'type': 'text', 'text': str});
|
||||
res.add((isEm: false, text: str));
|
||||
}
|
||||
return str;
|
||||
return '';
|
||||
},
|
||||
);
|
||||
return res;
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:PiliPlus/models/common/dynamic/dynamics_type.dart';
|
||||
import 'package:PiliPlus/models/common/home_tab_type.dart';
|
||||
import 'package:PiliPlus/models/user/info.dart';
|
||||
import 'package:PiliPlus/models/user/stat.dart';
|
||||
import 'package:PiliPlus/pages/bangumi/controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
||||
import 'package:PiliPlus/pages/home/controller.dart';
|
||||
@@ -15,6 +14,7 @@ import 'package:PiliPlus/pages/live/controller.dart';
|
||||
import 'package:PiliPlus/pages/main/controller.dart';
|
||||
import 'package:PiliPlus/pages/media/controller.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/pages/pgc/controller.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart' as web;
|
||||
@@ -88,17 +88,17 @@ class LoginUtils {
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<BangumiController>(tag: HomeTabType.bangumi.name)
|
||||
Get.find<PgcController>(tag: HomeTabType.bangumi.name)
|
||||
..isLogin.value = true
|
||||
..mid = data.mid
|
||||
..queryBangumiFollow();
|
||||
..queryPgcFollow();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<BangumiController>(tag: HomeTabType.cinema.name)
|
||||
Get.find<PgcController>(tag: HomeTabType.cinema.name)
|
||||
..isLogin.value = true
|
||||
..mid = data.mid
|
||||
..queryBangumiFollow();
|
||||
..queryPgcFollow();
|
||||
} catch (_) {}
|
||||
} else {
|
||||
// 获取用户信息失败
|
||||
@@ -161,14 +161,14 @@ class LoginUtils {
|
||||
}
|
||||
|
||||
try {
|
||||
Get.find<BangumiController>(tag: HomeTabType.bangumi.name)
|
||||
Get.find<PgcController>(tag: HomeTabType.bangumi.name)
|
||||
..mid = null
|
||||
..isLogin.value = false
|
||||
..followState.value = LoadingState.loading();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<BangumiController>(tag: HomeTabType.cinema.name)
|
||||
Get.find<PgcController>(tag: HomeTabType.cinema.name)
|
||||
..mid = null
|
||||
..isLogin.value = false
|
||||
..followState.value = LoadingState.loading();
|
||||
|
||||
@@ -7,10 +7,9 @@ import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/models/live/live_room/item.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/section.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/section.dart';
|
||||
import 'package:PiliPlus/pages/contact/view.dart';
|
||||
import 'package:PiliPlus/pages/fav_panel/view.dart';
|
||||
import 'package:PiliPlus/pages/share/view.dart';
|
||||
@@ -439,17 +438,7 @@ class PageUtils {
|
||||
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||
DynamicLiveModel liveRcmd =
|
||||
item.modules.moduleDynamic!.major!.liveRcmd!;
|
||||
ModuleAuthorModel author = item.modules.moduleAuthor!;
|
||||
LiveItemModel liveItem = LiveItemModel.fromJson({
|
||||
'title': liveRcmd.title,
|
||||
'uname': author.name,
|
||||
'cover': liveRcmd.cover,
|
||||
'mid': author.mid,
|
||||
'face': author.face,
|
||||
'roomid': liveRcmd.roomId,
|
||||
'watched_show': liveRcmd.watchedShow,
|
||||
});
|
||||
toDupNamed('/liveRoom?roomid=${liveItem.roomId}');
|
||||
toDupNamed('/liveRoom?roomid=${liveRcmd.roomId}');
|
||||
break;
|
||||
|
||||
/// 合集查看
|
||||
@@ -477,7 +466,7 @@ class PageUtils {
|
||||
if (kDebugMode) debugPrint('DYNAMIC_TYPE_PGC_UNION 番剧');
|
||||
DynamicArchiveModel pgc = item.modules.moduleDynamic!.major!.pgc!;
|
||||
if (pgc.epid != null) {
|
||||
viewBangumi(epId: pgc.epid);
|
||||
viewPgc(epId: pgc.epid);
|
||||
}
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_MEDIALIST':
|
||||
@@ -688,7 +677,7 @@ class PageUtils {
|
||||
if (id != null) {
|
||||
bool isSeason = id.startsWith('ss');
|
||||
id = id.substring(2);
|
||||
viewBangumi(
|
||||
viewPgc(
|
||||
seasonId: isSeason ? id : null,
|
||||
epId: isSeason ? null : id,
|
||||
);
|
||||
@@ -697,14 +686,14 @@ class PageUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
static Future<void> viewBangumi(
|
||||
static Future<void> viewPgc(
|
||||
{dynamic seasonId, dynamic epId, String? progress}) async {
|
||||
try {
|
||||
SmartDialog.showLoading(msg: '资源获取中');
|
||||
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: epId);
|
||||
var result = await SearchHttp.pgcInfo(seasonId: seasonId, epId: epId);
|
||||
SmartDialog.dismiss();
|
||||
if (result['status']) {
|
||||
BangumiInfoModel data = result['data'];
|
||||
PgcInfoModel data = result['data'];
|
||||
|
||||
// epId episode -> progress episode -> first episode
|
||||
EpisodeItem? episode;
|
||||
@@ -759,7 +748,7 @@ class PageUtils {
|
||||
'pic': episode.cover,
|
||||
'heroTag': Utils.makeHeroTag(episode.cid),
|
||||
'videoType': SearchType.media_bangumi,
|
||||
'bangumiItem': data,
|
||||
'pgcItem': data,
|
||||
if (progress != null) 'progress': int.tryParse(progress)
|
||||
},
|
||||
preventDuplicates: false,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/models/video/reply/data.dart' show ReplyData;
|
||||
import 'package:PiliPlus/models_new/reply/data.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo;
|
||||
import 'package:PiliPlus/grpc/im.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/member.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
@@ -17,7 +18,7 @@ import 'package:PiliPlus/http/validate.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/models/login/model.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
|
||||
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
||||
import 'package:PiliPlus/pages/group_panel/view.dart';
|
||||
@@ -220,7 +221,7 @@ class RequestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
static ReplyInfo replyCast(res) {
|
||||
static ReplyInfo replyCast(Map res) {
|
||||
Map? emote = res['content']['emote'];
|
||||
emote?.forEach((key, value) {
|
||||
value['size'] = value['meta']['size'];
|
||||
@@ -261,7 +262,7 @@ class RequestUtils {
|
||||
// }
|
||||
// }
|
||||
|
||||
static Future<void> insertCreatedDyn(id) async {
|
||||
static Future<void> insertCreatedDyn(dynamic id) async {
|
||||
try {
|
||||
if (id != null) {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
@@ -284,11 +285,12 @@ class RequestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> checkCreatedDyn({id, dynText, isManual}) async {
|
||||
if (isManual == true || GStorage.enableCreateDynAntifraud) {
|
||||
static Future<void> checkCreatedDyn(
|
||||
{dynamic id, String? dynText, bool isManual = false}) async {
|
||||
if (isManual || GStorage.enableCreateDynAntifraud) {
|
||||
try {
|
||||
if (id != null) {
|
||||
if (isManual != true) {
|
||||
if (!isManual) {
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
}
|
||||
var res = await DynamicsHttp.dynamicDetail(id: id, clearCookie: true);
|
||||
@@ -340,11 +342,11 @@ class RequestUtils {
|
||||
required dynamic mediaId,
|
||||
required dynamic mid,
|
||||
}) {
|
||||
VideoHttp.allFavFolders(mid).then((res) {
|
||||
FavHttp.allFavFolders(mid).then((res) {
|
||||
if (context.mounted &&
|
||||
res['status'] &&
|
||||
(res['data'].list as List?)?.isNotEmpty == true) {
|
||||
List<FavFolderItemData> list = res['data'].list;
|
||||
List<FavVideoItemModel> list = res['data'].list;
|
||||
dynamic checkedId;
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -388,7 +390,7 @@ class RequestUtils {
|
||||
.where((e) => e.checked == true)
|
||||
.toList();
|
||||
SmartDialog.showLoading();
|
||||
VideoHttp.copyOrMoveFav(
|
||||
FavHttp.copyOrMoveFav(
|
||||
isCopy: isCopy,
|
||||
isFav: ctr is! LaterController,
|
||||
srcMediaId: mediaId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:PiliPlus/models/common/video/cdn_type.dart';
|
||||
import 'package:PiliPlus/models/live/live_room/room_info.dart';
|
||||
import 'package:PiliPlus/models/video/play/url.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_room_play_info/codec.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user