Greasy Fork is available in English.

课程助手-云创学习网

开关章节自动播放,解放双手

// ==UserScript==
// @name         课程助手-云创学习网
// @namespace    https://github.com/Twtcer
// @version      0.10.1
// @match        *://yk.myunedu.com/*
// @description  开关章节自动播放,解放双手
// @author       heihei
// @grant        none
// @license     MIT
// ==/UserScript==

(load)();

// window.onload = load();

function load(){
   //  'use strict';
    console.log('start...');
    $('.studyVideo .leftContent-top').click();
    $('.video-react-paused').click();
    $('.video-react-menu-button').click();

    var timer = setInterval(function() {
        var currentCourse = $('.studyVideo-leftContent .videoItem-sel').parent().parent().parent().parent();
        var currentChapter = $('.studyVideo-leftContent .videoItem-sel');
        console.log(`专题:${$(currentCourse).find('.videoChapter-titleContent-title').text()},当前任务:${$(currentChapter).text()}`);

        if($('.video-react-paused').length>0)
        {
            var nextChapter = $(currentChapter).next();
            // 下一节存在&不存在观看时间则下一节
            if(
                $(nextChapter).attr('class')==='videoItem' &&
                $(nextChapter).find('.videoItem-textContent-time').text().indexOf('观看时间')>0
            ){
                // 视频下一个
                $(nextChapter).click();
            }
            else{
                // 下一节是否存在
                if($(nextChapter).attr('class')==='videoChapter'){
                    // 下一章第一个
                    $(nextChapter).find('.videoItem').eq(0).click();
                }
                else {
                    console.log('本课程播放完毕');
                }

            }
        }
  }, 5000);
}