master
iotcat 4 years ago
parent 10e152333f
commit edc22ebaa5
  1. 16
      index.html

@ -51,10 +51,12 @@
cookie.set('last_watch', page.params.url);
}
var dp = {};
$.post("https://acg.watch/api/getQuality.php?url="+page.params.url, function(res){
options.video.quality = JSON.parse(res);
const dp = new DPlayer(options);
dp = new DPlayer(options);
/* recover history playing */
if(options.video.quality[0].url && options.video.quality[0].url != 'https://api.yimian.xyz/video?path=404.mp4'){
if(cookie.get($.md5(options.video.quality[0].url)) != null){
@ -74,7 +76,12 @@
$.post("https://acg.watch/api/getNext.php?url="+options.video.quality[0].url, function(res){
res = JSON.parse(res);
dp.notice("正在自动跳转至下一集", 4000);
setTimeout(function(){
setTimeout(next_video, 2000);
});
});
});
var next_video = function(){
cookie.set('last_watch', res.url);
history.pushState({},page.title,"https://acg.watch/player?url="+res.url);
page.params.url = res.url;
@ -99,10 +106,7 @@
//setTimeout(function(){dp.switchQuality(0);}, 1000);
});
}, 2000);
});
});
});
}
</script>
</body>

Loading…
Cancel
Save