SponsorBlock job
This commit is contained in:
1 parent
115b457241
commit
9f5efb0ba7
4 files changed
+35
-31
No files matched your search
@@ -69,7 +69,7 @@ namespace SponsorBlock
|
||||
return m.sponsorBlockConfig.categories[category].short_title
|
||||
end function
|
||||
|
||||
function GetSkipSegmentsForVideo(videoId as string) as object
|
||||
function GetSkipSegmentsForVideo(videoId as string, cancellation = invalid as dynamic) as object
|
||||
if m.sponsorBlockConfig = invalid or StringUtils.IsNullOrEmpty(m.sponsorBlockConfig.serverAddress)
|
||||
return invalid
|
||||
end if
|
||||
@@ -85,9 +85,9 @@ namespace SponsorBlock
|
||||
' From SponsorBlock docs: It should be the first 4 - 32 characters (4 is recommended).
|
||||
hashPrefix = CryptoUtils.GetSha256(videoId).Left(4)
|
||||
url = `${m.sponsorBlockConfig.serverAddress}${SponsorBlock.SKIP_SEGMENT_ENDPOINT}/${hashPrefix}?categories=${categoriesJson}&actionTypes=${actionTypesJson}`
|
||||
response = HttpClient.Get(url).Await()
|
||||
response = HttpClient.Get(url).Cancellation(cancellation).Await()
|
||||
if not response.IsSuccess()
|
||||
LogError("SponsorBlockService: GetSkipSegmentsForVideo failed", response.ErrorMessage())
|
||||
LogError("GetSkipSegmentsForVideo failed:", response.ErrorMessage())
|
||||
return invalid
|
||||
end if
|
||||
|
||||
|
||||
Reference in new issue
Block a user