习题会自动跳过,你需要手动点回来做,可改默认播放速度
当前为
// ==UserScript==
// @name 传智自动刷视频
// @namespace shuidas
// @version 0.4
// @description 习题会自动跳过,你需要手动点回来做,可改默认播放速度
// @author shuidas
// @match *://*.ityxb.com/preview/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
//↙
var speed = 1; //←想改默认速度在这里改
//↖
var num = 0; //初始视频位数 第一个序号是0
var max = 0; //获取网页视频总数默认为0
//$('video')[0].playbackRate=? 自己控制台手动改倍速
setTimeout(function() {
$('.point-item-box>div:first-child')[num].parentElement.parentElement.parentElement.setAttribute('class','chapter-item-box');//关掉第一个列表
$('.point-item-box>div:first-child')[num].parentElement.parentElement.style.display = 'none';
max = $('.point-item-box').length - 1;
while($('.point-item-box>div:first-child')[num].children[1].innerHTML == "100%"){
num++;
if(num > max)
return;
}
$('.point-item-box')[num].click();
console.log('当前播放标题:'+$('.point-item-box>div:first-child')[num].children[0].children[1].title);
$('.point-item-box>div:first-child')[num].parentElement.parentElement.parentElement.setAttribute('class','chapter-item-box expand');//展开列表
$('.point-item-box>div:first-child')[num].parentElement.parentElement.style.display = null;
setTimeout(function() {
$('video')[0].muted = true;
$('video')[0].playbackRate=speed;
$('video+div+div')[0].children[13].innerHTML=speed+"倍速"; //显示倍速
$('video')[0].parentNode.children[8].lastChild.innerText=speed+"倍速";
$('video')[0].parentNode.children[8].children[4].style.color='white'; //标白
var str=6; //标蓝
switch (speed){
case 1.5:
str=2;break;
case 2:
str=1;break;
case 2.5:
str=0;break;
case 1.25:
str=3;break;
case 1:
str=4;break;
case 0.5:
str=5;break;
}
$('video')[0].parentNode.children[8].children[str].style.color='rgb(7, 130, 245)';
$('video')[0].play();
$('video')[0].muted = false;
$('video+div+div')[0].children[16].click()},500);//播放视频
},1000);
setTimeout(function() {$("video")[0].addEventListener("ended", function() { //播放结束换下一个视频
num++;
if(num > max)
return;
$('.point-item-box')[num].click();
console.log('当前播放标题:'+$('.point-item-box>div:first-child')[num].children[0].children[1].title);
$('.point-item-box>div:first-child')[num].parentElement.parentElement.parentElement.setAttribute('class','chapter-item-box expand');//展开列表
$('.point-item-box>div:first-child')[num].parentElement.parentElement.style.display = null;
setTimeout(function() {
$('video')[0].muted = true;
$('video')[0].playbackRate=speed;
$('video+div+div')[0].children[13].innerHTML=speed+"倍速";
$('video')[0].parentNode.children[8].lastChild.innerText=speed+"倍速";
$('video')[0].play();
$('video')[0].muted = false;
$('video+div+div')[0].children[16].click()},500); //播放视频
});},1000);
})();