import "pkg:/source/services/SponsorBlock.bs" function TaskMain() input = m.top.getField("input") videoId = input.videoId skipSegments = SponsorBlock.GetSkipSegmentsForVideo(videoId) barPath = invalid if skipSegments <> invalid barPath = `tmp:/sponsorblock_bar_${videoId}.png` SponsorBlock.GenerateProgressBarBackground(skipSegments, barPath) end if m.top.setField("output", { videoId: videoId, skipSegments: skipSegments, barPath: barPath }) end function