刷网课小玩意
作者:互联网
改编自:https://www.cnblogs.com/yueshutong/p/9634322.html
超星尔雅自动刷网课代码(对每个课程需要修改参数)
1 var fa = $("body"); 2 var btn = $("<li></li>"); 3 var json = { 4 "background": "#31e16d", 5 "height": "16px", 6 "padding": "5px", 7 "z-index": 999999, 8 "cursor": "pointer", 9 "top": "300px", 10 "right": "120px", 11 "position": "fixed" 12 }; 13 var bbb=143077348; 14 btn.css(json); 15 btn.html("<span id='lfsenior'>开启自动播放模式</span>"); 16 fa.append(btn); 17 18 btn.click(function () { 19 20 setInterval(function () { 21 //获取iframe 22 var video = $("iframe").contents().find("iframe").contents(); 23 //播放函数 24 var play = function () { 25 video.find("#video > button").click(); 26 var jy = video.find("#video > div.vjs-control-bar > div.vjs-volume-panel.vjs-control.vjs-volume-panel-vertical > button"); 27 if (jy.attr("title") != "取消静音") { 28 jy.click() 29 } 30 } 31 //如果正在加载 32 var load = video.find("#loading"); 33 if (load.css("visibility") != "hidden") { 34 return; 35 } 36 //获取当前进度 37 var spans = video.find("#video > div.vjs-control-bar > div.vjs-progress-control.vjs-control > div").attr("aria-valuenow"); 38 // 如果还没播放完 39 if (spans < 99) { 40 play(); 41 } 42 //如果播放结束 43 44 if (spans >= 99) { 45 //从第二章第1节开始,切换到下一个视频 46 getTeacherAjax('203679166','7507307',nex); 47 nex=nex+1; 48 } 49 $("#lfsenior").html("自动模式已开启,本章进度:" + spans + "%"); 50 }, 100); 51 52 });View Code
转载自:https://www.cnblogs.com/yueshutong/p/9381575.html
智慧树自动刷网课代码(全自动)
1 var fa=$("body"); 2 var btn=$("<li></li>"); 3 var json={ 4 "background":"#31e16d", 5 "height":"16px", 6 "padding":"5px", 7 "cursor": "pointer", 8 "top":"300px", 9 "right":"80px", 10 "position": "fixed" 11 }; 12 btn.css(json); 13 btn.html("<span id='lfsenior'>开启自动播放模式</span>"); 14 fa.append(btn); 15 var bodywidth=$("#body").css("width"); 16 var mainwidth=$("#main").css("width"); 17 btn.click(function () { 18 $("#lfsenior").html("自动模式已开启"); 19 //关闭弹题 20 setInterval(function(){ 21 $(".popboxes_close").click(); 22 //获取当前进度 23 var spans=$(".current_play span"); 24 var progress=spans[spans.size()-1].innerHTML; 25 if("100"==progress.substring(progress.lastIndexOf("『")+1,progress.lastIndexOf("』")-1)){ 26 //播放完毕 27 $(".next_lesson a").click(); 28 }else{ 29 $("#vjs_mediaplayer_html5_api")[0].play(); 30 $("#vjs_mediaplayer_html5_api")[0].muted=true; 31 } 32 $("#lfsenior").html("自动模式已开启,本章进度:"+progress+"%"); 33 },100); 34 35 36 });View Code
标签:小玩意,vjs,网课,html,video,spans,var,btn 来源: https://www.cnblogs.com/mmmqqdd/p/10963435.html