fix sponserblock:js

This commit is contained in:
zrose584 2020-10-21 10:29:57 +02:00
parent 832524e421
commit 3b5df36b03

View File

@ -17,8 +17,8 @@ function load_sponsorblock(){
let url = `/https://sponsor.ajay.app/api/skipSegments/${hash}`; let url = `/https://sponsor.ajay.app/api/skipSegments/${hash}`;
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(r => {
for (const video of data) { for (const video of r) {
if (video.videoID != data.video_id) continue; if (video.videoID != data.video_id) continue;
info_elem.innerText = `(${video.segments.length} segments)`; info_elem.innerText = `(${video.segments.length} segments)`;
const cat_n = video.segments.map(e=>e.category).sort() const cat_n = video.segments.map(e=>e.category).sort()