mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
update sponsor block api (#1797)
* update sponsor block api * update --------- Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/build_config.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
@@ -17,6 +18,11 @@ abstract final class SponsorBlock {
|
||||
static String get blockServer => Pref.blockServer;
|
||||
static final options = Options(
|
||||
followRedirects: true,
|
||||
// https://github.com/hanydd/BilibiliSponsorBlock/wiki/API#1-%E5%85%AC%E7%94%A8%E5%8F%82%E6%95%B0
|
||||
headers: {
|
||||
'origin': Constants.appName,
|
||||
'x-ext-version': BuildConfig.versionName,
|
||||
},
|
||||
validateStatus: (status) => true,
|
||||
);
|
||||
|
||||
@@ -136,7 +142,7 @@ abstract final class SponsorBlock {
|
||||
'videoID': bvid,
|
||||
'cid': cid.toString(),
|
||||
'userID': Pref.blockUserID,
|
||||
'userAgent': Constants.userAgent,
|
||||
'userAgent': '${Constants.appName}/${BuildConfig.versionName}',
|
||||
'videoDuration': videoDuration,
|
||||
'segments': segments
|
||||
.map(
|
||||
|
||||
Reference in New Issue
Block a user