四川文理视频学习

四川文理学院视频课程自动学习,登陆平台后请刷新一次,等待自动开始!

  1. // ==UserScript==
  2. // @name 四川文理视频学习
  3. // @namespace https://gf.qytechs.cn/zh-CN/users/707063-genexy
  4. // @version 202012051758
  5. // @description 四川文理学院视频课程自动学习,登陆平台后请刷新一次,等待自动开始!
  6. // @author 流浪的蛊惑
  7. // @match *://*.wdjycj.com/*
  8. // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js
  9. // @grant none
  10. // ==/UserScript==
  11. var vlist=null,lessonid=null,token=null,tot=0,dqs=0;
  12. function setvlist(data){//提交课程学习进度
  13. for(let i=0;i<data.length;i++){
  14. ++tot;
  15. $.ajax({
  16. method:"POST",
  17. url:"http://nbc.wdjycj.com/api/lesson/saveUserHour",
  18. dataType:"json",
  19. contentType:"application/json",
  20. data:"{\"hour_id\":\""+data[i].id+"\",\"play_time\":\""+data[i].play_time+"\",\"token\":\""+token+"\",\"host\":\"www.wdjycj.com\"}",
  21. success:function(e){
  22. let n=document.getElementsByTagName("h2")[0];
  23. n.innerText="已学:"+(++dqs)+" 加载:"+tot ;
  24. }
  25. });
  26. }
  27. }
  28. function getvlist(){//获取所有课程信息
  29. $.ajax({
  30. method:"POST",
  31. url:"http://nbc.wdjycj.com/api/user/semesterstudyRate",
  32. dataType:"json",
  33. contentType:"application/json",
  34. data:"{\"token\":\""+token+"\",\"host\":\"www.wdjycj.com\"}",
  35. success:function(e){
  36. for(let i=0;i<e.data.length;i++){
  37. for(let j=0;j<e.data[i].lists.length;j++){
  38. getvhour(e.data[i].lists[j].id);
  39. }
  40. }
  41. }
  42. });
  43. }
  44. function getvhour(kcid){
  45. $.ajax({
  46. method:"POST",
  47. url:"http://nbc.wdjycj.com/api/lesson/getLessonHour",
  48. dataType:"json",
  49. contentType:"application/json",
  50. data:"{\"id\":\""+kcid+"\",\"token\":\""+token+"\",\"host\":\"www.wdjycj.com\"}",
  51. success:function(e){
  52. setvlist(e.data.data);
  53. }
  54. });
  55. }
  56. (function() {
  57. 'use strict';
  58. var href=location.href;
  59. switch(window.location.pathname){
  60. case "/user-index":
  61. setInterval(function(){
  62. if(token==null){
  63. let usi=JSON.parse(localStorage.getItem("userInfo"));
  64. token=usi.token;//获取访问令牌
  65. getvlist();
  66. }
  67. },1000);
  68. break;
  69. }
  70. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址