// ==UserScript== // @name 西南科技大学视频学习 // @namespace https://greasyfork.org/zh-CN/users/707063-genexy // @version 202101141653 // @description 西南科技大学学习助手,快速看视频,尚课平台。 // @author 流浪的蛊惑 // @run-at document-end // @match *://www.onmooc.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; function getParams(c) { var d = { courseId: c.courseId, itemId: c.itemId, time1: CommonUtil.formatStr((new Date()).getTime(), 20), time2: CommonUtil.formatStr(parseInt(c.startTime), 20), time3: CommonUtil.formatStr(CommonUtil.timeToSeconds(c.videoTotalTime), 20), time4: CommonUtil.formatStr(parseInt(c.endTime), 20), videoIndex: c.videoIndex, time5: CommonUtil.formatStr(c.studyTimeLong, 20), terminalType: c.terminalType }; return d } function gtjjl(data){ var d = CommonUtil.getPlatformPath() + "/course/study/learningTime_saveVideoLearnDetailRecord.action"; var p = d + "?studyRecord=" + encodeURIComponent(data); $.ajax({ url: p, type: "GET", cache: false, success: function(e) { $("#gtjjg").html((new Date()).getTime()+"
"+e); } }); } var gjs=0; var sftj=true;//是否初始化 var gtime=0,gstu=null,gtjsj; setInterval(function(){ let gzj1=document.getElementsByClassName("dumascroll_area"); if(gzj1.length>0){ let gxx=localStorage.getItem(_ACTIVITYID_); let gj1=gzj1[0].getElementsByTagName("li"); for(let i=0;i0){ let gpro=document.getElementsByClassName("cont video1")[0]; gpro.innerHTML="
平台限制最高可以2倍速度学习,学习可多开,倍速学习中…
"; sftj=false; } gtjsj=30; } } if(gtime>0){ gstu.position+=2.1; gstu.endTime+=2.1; if(parseInt(gstu.position)>gtime){ gstu.position=gtime; gstu.endTime=gtime; gtjsj=0; } var gtj=getParams(gstu); gjs++; $("#gxxjd").text("当前进度:"+parseInt(gstu.position)+" 秒,总学时:"+gtime+" 秒。"); if(gjs>gtjsj){ gjs=0; gstu.startTime=parseInt(gstu.position); gtjjl((CommonUtil.encrypt(JSON.stringify(gtj)))); if(gtjsj==0){ gtime=0; localStorage.removeItem(_ACTIVITYID_); } } }else{ sftj=true; } },1000); })();