aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/sponsorblock.js
diff options
context:
space:
mode:
authorzrose584 <57181548+zrose584@users.noreply.github.com>2020-10-18 17:58:16 +0200
committerzrose584 <57181548+zrose584@users.noreply.github.com>2020-10-18 18:48:52 +0200
commita8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2 (patch)
treec8da0b06304993904214b2018d8ea33355c0c02e /youtube/static/js/sponsorblock.js
parentf7f2b9fa06fd2218179636c712e43f0c4d65bd9e (diff)
downloadyt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.tar.lz
yt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.tar.xz
yt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.zip
proxy 'sponsor.ajay.app'
Diffstat (limited to 'youtube/static/js/sponsorblock.js')
-rw-r--r--youtube/static/js/sponsorblock.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube/static/js/sponsorblock.js b/youtube/static/js/sponsorblock.js
index 66dcf16..692de9b 100644
--- a/youtube/static/js/sponsorblock.js
+++ b/youtube/static/js/sponsorblock.js
@@ -12,14 +12,14 @@ document.addEventListener('DOMContentLoaded', ()=>{
function load_sponsorblock(){
const info_elem = Q('#skip_n');
if (info_elem.innerText.length) return; // already fetched
- const video_id = getVideoID();
- const hash = sha256(video_id).substr(0,4);
+ const hash = sha256(data.video_id).substr(0,4);
const video_obj = Q("video");
- fetch(`https://sponsor.ajay.app/api/skipSegments/${hash}`)
+ let url = `/https://sponsor.ajay.app/api/skipSegments/${hash}`;
+ fetch(url)
.then(response => response.json())
.then(data => {
for (const video of data) {
- if (video.videoID != video_id) continue;
+ if (video.videoID != data.video_id) continue;
info_elem.innerText = `(${video.segments.length} segments)`;
const cat_n = video.segments.map(e=>e.category).sort()
.reduce((acc,e) => (acc[e]=(acc[e]||0)+1, acc), {});