|
只有自动下一集,自动答卡视频的题目,自动答题。因为之前是跟TP对着干的,所以尽量做到模拟手动了,避免行为检测,所以只有这几个功能,够用。F12后,控制台粘贴文本里的JS代码,回车即可。虽然不是第一个用JavaScript搞这个的,好歹是自己写的,算原创吗。
var fa = $("body");
var btn = $("<li></li>");
var v_done = 0;
var flag = 1;
var json = {
"background": "#FF7A38",
"height": "16px",
"padding": "5px",
"z-index": 999999,
"cursor": "pointer",
"top": "0px",
"left": "0px",
"position": "fixed"
};
btn.css(json);
btn.html("<span id='lfsenior'>点击开启</span>");
fa.append(btn);
btn.click(function () {
setInterval(function () {
var video = $("iframe").contents().find("iframe").contents();
var frameObj = $("iframe").eq(0).contents().find("iframe.ans-insertvideo-online");
var videoNum = frameObj.length;
var ul = video.find(".ans-videoquiz-opts:visible");
function playvideo(frameObj, v_done) {
var v = undefined;
v = frameObj.contents().eq(v_done).find("video#video_html5_api").get(0);
v.play();
}
var next_play = function () {
setTimeout(() => {
$(document).scrollTop($(document).height()-$(window).height());
$(".orientationright").click();
});
}
var load = video.find("#loading");
if (load.css("visibility") != "hidden") {
return;
}
if (ul) {
video.find(".ans-videoquiz-opts input[value='true']").attr("checked", true);
video.find(".ans-videoquiz-submit").trigger("click");
}
var time = frameObj.contents().eq(v_done).find("video#video_html5_api").get(0)
if (time.currentTime != time.duration && videoNum >= (v_done + 1)) {
playvideo(frameObj, v_done);
if(flag == 0){
flag = 1;
}
}
if (time.currentTime >= time.duration && videoNum >= (v_done + 1) && flag == 1) {
v_done++;
if (videoNum < (v_done + 1)){
v_done = 0;
next_play();
}
flag = 0;
}
$("#lfsenior").html("开启成功,小节数:" + videoNum + " 当前小节" + (v_done+1));
}, 100);
}); |
|