刷视频脚本

function test222() {
let isNotice = false;
if (!("Notification" in window)) {
alert("This browser does not support desktop notification");
} else if (Notification.permission === "granted") {
// If it's okay let's create a notification
isNotice = true;
// var notification = new Notification("Hi there!");
} else if (Notification.permission !== "denied") {
Notification.requestPermission(function (permission) {
// 如果用户同意,就可以向他们发送通知
if (permission === "granted") {
isNotice = true;
// var notification = new Notification("Hi there!");
}
});
}
let img = `


捐赠


一块两块不嫌多,三毛五毛不嫌少
`;
$("body").append(img);
let liList = $(".new_demoul li");
let dataList = [];
for (let val of Array.from(liList)) {
let item = $(val).find(".change_chapter");

let duration = item.find(".course_study_menudate").text();
duration = duration.slice(1, -1);
duration = duration.split(":");
let durationTime = 0;
duration.reverse();
for (let i in duration) {
durationTime += 60 ** i * duration[i];
}
if (item.data("learnduration") >= durationTime) {
continue;
}
dataList.push({
lessonid: item.data("lessonid"),
courseid: courseid,
duration: durationTime,
});
}
if (isNotice) {
if (dataList.length == 0) {
new Notification(`当前课程已看完 换一个吧`);
return;
} else {
new Notification(`当前还有${dataList.length}课程`);
}
}
// console.log(dataList);
// return dataList;

let postIndex = 0;
function startPost() {
// console.log(dataList[postIndex], new Date());
// await (function () {
// return new Promise((resolve, reject) => {
// $.post(
// `https://www.bjjnts.cn/lessonStudy/${dataList[postIndex].courseid}/${dataList[postIndex].lessonid}`,
// {},
// () => {
// resolve();
// }
// );
// });
// })();
// console.log(liList.length, dataList.length);
// if (liList.length == dataList.length && postIndex == 0) {
// await (function () {
// return new Promise((resolve, reject) => {
// $.post(
// `https://www.bjjnts.cn/faceVerifyBase64`,
// {
// image_file: `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAARe0lEQVR4Xu3d+2/V9R3H8ffpjUsUoWSgFhYqUKxANlaNmdsMttwGaJEyraiJZvMS41+i8edtbDoYW+KGeOFqLC1I4hYCMgmXFopCR3UYWhRHLfS6fL6n38Npx6Vt+n739LyfZ1nc2p7P57wf74+vfO8n8fprb/QKLw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YG2dmQcClAAHjsu0UjYCNAAFj48wsCLgUIGBctp2iEbARIGBsnJkFAZcCBIzLtlM0AjYCBIyNM7Mg4FKAgHHZdopGwEaAgLFxZhYEXAoQMC7bTtEI2AgQMDbOzIKASwECxmXbKRoBGwECxsaZWRBwKUDAuGw7RSNgI0DA2DgzCwIuBQgYl22naARsBAgYG2dmQcClAAHjsu0UjYCNAAFj48wsCLgUIGBctp2iEbARIGBsnJkFAZcCBIzLtlM0AjYCBIyNM7Mg4FKAgHHZdopGwEaAgLFxZhYEXAoQMC7bTtEI2AgQMDbOzIKASwECxmXbKRoBGwECxsaZWRBwKUDAuGw7RSNgI0DA2DgzCwIuBf4HxOnAiydOC3sAAAAASUVORK5CYII=`,
// },
// () => {
// resolve();
// }
// );
// });
// })();
// }
// await (function () {
// return new Promise((resolve, reject) => {
// $.post(
// `https://www.bjjnts.cn/editVideoChapter/${dataList[postIndex].courseid}/${dataList[postIndex].lessonid}`,
// {
// duration: dataList[postIndex].duration,
// },
// () => {
// resolve();
// }
// );
// });
// })();

// let addTimeList = [];
// let addTimeLength = parseInt(dataList[postIndex].duration / 60);
// for (let i = 0; i < addTimeLength; i++) {
// addTimeList.push(60 * (i + 1));
// }
// addTimeList.push(
// (addTimeList[addTimeList.length - 1]
// ? addTimeList[addTimeList.length - 1]
// : 0) +
// (dataList[postIndex].duration % 60)
// );
// for (let v of addTimeList) {
// setTimeout(() => {
// addTime(dataList[postIndex], v);
// }, (v + 1) * 1000);
// }
// let itemIndex = 0;
// function addTime(item, time) {
// $.post(
// "/addstudentTaskVer2/" + item.courseid + "/" + item.lessonid,
// {
// learnTime: time,
// },
// () => {
// itemIndex++;
// if (addTimeList.length == itemIndex) {
// postIndex++;
// if (postIndex > dataList.length) {
// new Notification(`当前课程已看完 换一个吧`);
// return;
// }
// startPost();
// }
// }
// );
// }
$.cookie("lessonid", dataList[postIndex].lessonid);
$.post(
"/addstudentTaskVer2/" +
dataList[postIndex].courseid +
"/" +
dataList[postIndex].lessonid,
{
learnTime: dataList[postIndex].duration,
},
(res) => {
postIndex++;
if (postIndex > dataList.length) {
new Notification(`当前课程已看完 换一个吧`);
return;
}
console.log(dataList[postIndex], new Date());
setTimeout(() => {
startPost();
}, dataList[postIndex].duration * 1000 + Math.random() * 10000);
}
);
}
startPost();
}

你可能感兴趣的:(刷视频脚本)