coolcollege

原脚本为DingTalk 0.2版。更新了适配网址learning.coolcollege.cn,点击学习的视频,1秒钟后自动6倍数播放,点击中途的防挂机弹窗,进度100%时自动点击返回课程,后续的自动下一节课播放没空做了。

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         coolcollege
// @namespace    http://tampermonkey.net/
// @version      0.6.1
// @description  原脚本为DingTalk 0.2版。更新了适配网址learning.coolcollege.cn,点击学习的视频,1秒钟后自动6倍数播放,点击中途的防挂机弹窗,进度100%时自动点击返回课程,后续的自动下一节课播放没空做了。
// @author       Devilz
// @match        https://*.coolcollege.cn/*
// @icon         https://oss.coolcollege.cn/1925559134103670784.png
// @grant        none
// ==/UserScript==

window.isDOMLoaded = false;
window.isDOMRendered = false;

document.addEventListener('readystatechange', function () {
    if (document.readyState === "interactive" || document.readyState === "complete") {
        window.isDOMLoaded = true;
    }
});
~function (global){
    'use strict';

 var cli = function(){
   var v = document.querySelector("video");
   v.playbackRate = 6;
    console.log("6倍速启动");
   //var button = document.evaluate("//*[@class='prism-big-play-btn pause']", document).iterateNext();
   //console.log("button:"+button)
   var button2 = document.evaluate("//*[@class='new-watch-course-page__right__catalog__item active']/following-sibling::div[1]", document).iterateNext();
   var buttonContinue = document.evaluate("//*[@class='ant-btn ant-btn-primary']", document).iterateNext();
   var buttonPlaying = document.evaluate("//*[@class='prism-play-btn']", document).iterateNext();
   var buttonBigPlaying = document.evaluate("//*[@class='prism-big-play-btn']", document).iterateNext();
   var buttonBack = document.evaluate("//*[@class='ant-btn ant-btn-link']", document).iterateNext();
   var ifProgressFinished;
     if("width: 100%;" == document.evaluate("//*[@class='prism-progress-played']", document).iterateNext().getAttribute("style")){
         ifProgressFinished = true;
         console.log("ifProgressFinished:"+ifProgressFinished);
     }else{
         ifProgressFinished = false;
         console.log("ifProgressFinished:"+ifProgressFinished);
     }

     if ( ifProgressFinished ) {
         buttonBack.click();
         console.log("进度100%,返回");
     }
     if (!ifProgressFinished && buttonBigPlaying != undefined && buttonBigPlaying != null && buttonPlaying != undefined && buttonPlaying != null) {
         buttonBigPlaying.click();
         console.log("点击大播放键,开始播放。buttonBigPlaying:"+buttonBigPlaying);
     }else if(!ifProgressFinished && buttonPlaying != undefined && buttonPlaying != null){
         buttonPlaying.click();
         console.log("点击小播放键,开始播放。buttonPlaying:"+buttonPlaying);
     }
     if (!ifProgressFinished && buttonPlaying != undefined && buttonPlaying != null && buttonContinue != undefined && buttonContinue != null) {
         buttonContinue.click();
         console.log("点击弹窗,继续播放");
     }


 }
     var timer1 = setInterval(cli, 10000);
     // Your code here...
        if (global.eHook) {
         global.eHook.plugins({
             name: 'timer1',
             /**
              * 插件装载
              * @param util
              */
             mout: timer1
         });
     }
}(window);