mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +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 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:PiliPlus/build_config.dart';
|
||||||
import 'package:PiliPlus/common/constants.dart';
|
import 'package:PiliPlus/common/constants.dart';
|
||||||
import 'package:PiliPlus/http/init.dart';
|
import 'package:PiliPlus/http/init.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
@@ -17,6 +18,11 @@ abstract final class SponsorBlock {
|
|||||||
static String get blockServer => Pref.blockServer;
|
static String get blockServer => Pref.blockServer;
|
||||||
static final options = Options(
|
static final options = Options(
|
||||||
followRedirects: true,
|
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,
|
validateStatus: (status) => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -136,7 +142,7 @@ abstract final class SponsorBlock {
|
|||||||
'videoID': bvid,
|
'videoID': bvid,
|
||||||
'cid': cid.toString(),
|
'cid': cid.toString(),
|
||||||
'userID': Pref.blockUserID,
|
'userID': Pref.blockUserID,
|
||||||
'userAgent': Constants.userAgent,
|
'userAgent': '${Constants.appName}/${BuildConfig.versionName}',
|
||||||
'videoDuration': videoDuration,
|
'videoDuration': videoDuration,
|
||||||
'segments': segments
|
'segments': segments
|
||||||
.map(
|
.map(
|
||||||
|
|||||||
Reference in New Issue
Block a user