mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
feat(sponsorblock): support actionTypes
This commit is contained in:
parent
c746794d74
commit
eecff5378d
2 changed files with 3 additions and 3 deletions
|
@ -99,7 +99,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
|||
try {
|
||||
return getJsonResponse(
|
||||
SponsorBlockUtils.getSponsors(request.getPathParameter("videoId"),
|
||||
request.getQueryParameter("category")).getBytes(UTF_8),
|
||||
request.getQueryParameter("category"), request.getQueryParameter("actionType")).getBytes(UTF_8),
|
||||
"public, max-age=3600");
|
||||
} catch (Exception e) {
|
||||
return getErrorResponse(e, request.getPath());
|
||||
|
|
|
@ -22,7 +22,7 @@ import static me.kavin.piped.consts.Constants.mapper;
|
|||
|
||||
public class SponsorBlockUtils {
|
||||
|
||||
public static String getSponsors(String id, String categories)
|
||||
public static String getSponsors(String id, String categories, String actionType)
|
||||
throws IOException {
|
||||
|
||||
if (StringUtils.isEmpty(categories))
|
||||
|
@ -34,7 +34,7 @@ public class SponsorBlockUtils {
|
|||
try {
|
||||
|
||||
var resp = RequestUtils.sendGetRaw(url + "/api/skipSegments/" + URLUtils.silentEncode(hash.substring(0, 4))
|
||||
+ "?categories=" + URLUtils.silentEncode(categories)).get();
|
||||
+ "?categories=" + URLUtils.silentEncode(categories) + "&actionTypes=" + URLUtils.silentEncode(actionType)).get();
|
||||
|
||||
if (resp.status() == 200) {
|
||||
var any = mapper.readTree(resp.body());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue