本人親測可用,兩種代碼皆可
功能: 自動設置 1.5倍速度(最快),靜音,自動切換下一課,跳過答題彈窗
進入智慧樹網頁版 ,按鍵盤F12出現以下界面,點擊Console(控制台),然后把下方代碼👇復制到輸入框,回車。
document.querySelector('.volumeIcon').click();//靜音處理
document.getElementsByClassName('speedTab15')[0].click();//1.5倍速播放
setInterval(function(){//每3秒執行一次
//判斷播放進度是否到達100%
if(document.getElementsByClassName('passTime')[0].style.width == '100%'){
setTimeout(function(){
//用js執行“下一集”按鈕的點擊事件,延遲1s執行
document.getElementById('nextBtn').click();
},1000);
setTimeout(function () {
//延遲4秒執行調節播放速率
document.querySelector('.volumeIcon').click();
document.getElementsByClassName('speedTab15')[0].click();//先設置一下播放速率為1.5倍速
},4000)
}
if(document.getElementsByClassName('bigPlayButton pointer')[0].style.display=='block')
{//用於檢測答題彈窗是否出現,並將其關閉
document.getElementsByClassName('topic-item')[0].click()//只選A,彈窗題目不影響成績,就不糾結選的對不對了
document.getElementsByClassName('el-dialog__footer')[5].click()
document.getElementsByClassName('el-dialog__headerbtn')[5].click()//點擊按鈕關閉
document.getElementsByClassName('playButton')[0].click()//點擊播放繼續
}
},3000);
var ti = $("body");
var video = $(".catalogue_ul1 li[id*=video-]");
var i = 1;
var v = 1;
video.css("color", "blue");
console.log("已選取" + video.length + "個小節,並已用藍色標明,請檢查是否有遺漏,如有遺漏,概不負責");
setTimeout(function () {
$('.speedTab15').click();
$('.volumeIcon').click();
console.log("已進行靜音和1.5倍加速");
}, 3000);
ti.on("DOMNodeInserted", function (e) {
if (e.target.textContent == "關閉") {
console.log("檢測到第" + i + "個彈題窗口");
window.setTimeout(function () {
document.getElementById("tmDialog_iframe").contentWindow.document.getElementsByClassName("answerOption")[0].getElementsByTagName("input")[0].click();
$(".popbtn_cancel").click();
console.log("已關閉");
}, 3000);
i++;
} else if (e.target.textContent == "本節視頻,累計觀看時間『100%』") {
console.log("檢測到視頻觀看完成,准備跳到下一節");
$('.next_lesson_bg').find('a').trigger('click');
console.log("已跳轉");
setTimeout(function () {
$('.volumeIcon').click();
$('.speedTab15').click();
console.log("已進行靜音和1.5倍加速");
}, 6000);
v++;
console.log("目前播放了" + v + "個視頻");
}
});
注意事項
3. 刷新網頁、人工跳轉課程等操作都會使代碼停止,需要重新輸入。
4. 瀏覽器最好用chrome(谷歌)或者火狐,如果是國產瀏覽器,請選擇極速模式(chrome內核),代碼會更穩定
5. 建議一次刷一個章節,單次刷課時間不要超過四個小時,否則可能會被后台鎖定!
6. 章節之間可能出現無法跳轉,是智慧樹防止刷課機制。需要手動點擊進下一章節的課程。
如果有用,請點個贊吧
如果有什么要補充的,歡迎下方👇評論區留言。
1份贊許 = 100分的認可,如果感覺還不錯,點個贊👍 支持一下吧 ~
————————————————
版權聲明:本文為CSDN博主「22 26 25」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/qq_41523096/article/details/86517273