Files
playlet-piped/src/source/services/SponsorBlock.bs
T
2022-11-02 19:40:05 -04:00

17 lines
656 B
Plaintext

import "pkg:/source/roku_modules/rokurequests/Requests.brs"
namespace RokuYoutube.Services.SponsorBlock
const API_URL = "https://sponsor.ajay.app"
const SKIP_SEGMENT_ENDPOINT = "/api/skipSegments"
const CATEGORIES = "&category=sponsor&category=selfpromo&category=interaction&category=intro&category=outro&category=preview&category=music_offtopic"
function GetSkipSegmentsForVideo(videoId as string)
url = `${API_URL}${SKIP_SEGMENT_ENDPOINT}?videoID=${videoId}${CATEGORIES}`
response = Requests().get(url)
if response.statuscode = 200
return response.json
end if
end function
end namespace