master
iotcat 4 years ago
parent edc22ebaa5
commit 26bebdd3c7
  1. 71
      index.html

@ -50,9 +50,7 @@
}else{ }else{
cookie.set('last_watch', page.params.url); cookie.set('last_watch', page.params.url);
} }
var dp = {}; var dp = {};
$.post("https://acg.watch/api/getQuality.php?url="+page.params.url, function(res){ $.post("https://acg.watch/api/getQuality.php?url="+page.params.url, function(res){
options.video.quality = JSON.parse(res); options.video.quality = JSON.parse(res);
@ -71,43 +69,42 @@
} }
}, 1000); }, 1000);
/* next video */ /* next video */
dp.on('ended', function() { dp.on('ended', next_video);
cookie.set($.md5(options.video.quality[0].url), "0");
$.post("https://acg.watch/api/getNext.php?url="+options.video.quality[0].url, function(res){
res = JSON.parse(res);
dp.notice("正在自动跳转至下一集", 4000);
setTimeout(next_video, 2000);
});
});
}); });
var next_video = function(){ var next_video = function() {
cookie.set('last_watch', res.url); cookie.set($.md5(options.video.quality[0].url), "0");
history.pushState({},page.title,"https://acg.watch/player?url="+res.url); $.post("https://acg.watch/api/getNext.php?url="+options.video.quality[0].url, function(res){
page.params.url = res.url; res = JSON.parse(res);
$.post("https://acg.watch/api/getQuality.php?url="+res.url, function(res2){ dp.notice("正在自动跳转至下一集", 4000);
console.log(JSON.parse(res2)); setTimeout(function(){
dp.switchVideo( cookie.set('last_watch', res.url);
{ history.pushState({},page.title,"https://acg.watch/player?url="+res.url);
url: res.url, page.params.url = res.url;
quality: JSON.parse(res2), $.post("https://acg.watch/api/getQuality.php?url="+res.url, function(res2){
defaultQuality: 0 console.log(JSON.parse(res2));
}, dp.switchVideo(
{ {
id: $.md5(res.url+'').substr(0, 16), url: res.url,
api: 'https://danmaku.yimian.xyz/', quality: JSON.parse(res2),
maximum: 1000, defaultQuality: 0
addition: [], },
user: 'iotcat', {
bottom: '15%', id: $.md5(res.url+'').substr(0, 16),
unlimited: true, api: 'https://danmaku.yimian.xyz/',
} maximum: 1000,
); addition: [],
user: 'iotcat',
//setTimeout(function(){dp.switchQuality(0);}, 1000); bottom: '15%',
}); unlimited: true,
} }
);
//setTimeout(function(){dp.switchQuality(0);}, 1000);
});
}, 2000);
});
}
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save