继续教育专业课 自动刷课脚本(简单快捷,适合小白)

内容分享2周前发布
0 0 0

该脚本需要在Tampermonkey(篡改猴)扩展中使用。

1.首先看自己的专业课是否是这样的页面(如果是则可以使用该脚本)

继续教育专业课 自动刷课脚本(简单快捷,适合小白)2.(edge浏览器)新打开一个网页,ctrl+shift+O 打开,并新建一个标签页

继续教育专业课 自动刷课脚本(简单快捷,适合小白)

继续教育专业课 自动刷课脚本(简单快捷,适合小白)

右键进行编辑,重命名为自动刷课,URL栏填写以下内容:

javascript:(function(){const PROGRESS_THRESHOLD=95;const MAX_MIN=50;const DONE_THRESHOLD=0.98;const LIST_RETRY_MS=1000;const AFTER_BACK_WAIT_MS=1500;const PLAY_CLICK_INTERVAL=700;const PLAY_CLICK_MAX_TRY=120;const STUCK_RETRY_SEC=8;const LAST_LIST_KEY='reseayun_last_list';const RESUME_RELOAD='reseayun_resume_reload';if(window.__AUTO_COURSE_RUNNING__)return;window.__AUTO_COURSE_RUNNING__=true;const Runtime={mode:null,timers:new Set(),observers:new Set(),loops:new Set(),setMode(m){if(this.mode===m)return false;this.cleanup();this.mode=m;return true;},addTimer(id){this.timers.add(id);return id;},addLoop(id){this.loops.add(id);return id;},addObserver(o){this.observers.add(o);return o;},cleanup(){this.timers.forEach(id=>{try{clearInterval(id);}catch{}});this.loops.forEach(id=>{try{clearInterval(id);}catch{}});this.observers.forEach(o=>{try{o.disconnect();}catch{}});this.timers.clear();this.loops.clear();this.observers.clear();}};const isVisible=el=>!!el&&(()=>{const s=getComputedStyle(el);return s.display!=='none'&&s.visibility!=='hidden'&&s.opacity!=='0';})();function robustClick(el){if(!el)return;try{el.scrollIntoView({block:'center'});}catch{}try{el.focus({preventScroll:true});}catch{}const r=el.getBoundingClientRect();const cx=Math.max(5,Math.min(r.left+r.width/2,r.right-5));const cy=Math.max(5,Math.min(r.top+r.height/2,r.bottom-5));const base={bubbles:true,cancelable:true,view:window,clientX:cx,clientY:cy};['pointerdown','mousedown','pointerup','mouseup','click'].forEach(t=>{try{el.dispatchEvent(new MouseEvent(t,base));}catch{}});try{el.click();}catch{}}function mouseWake(el){if(!el)return;const r=el.getBoundingClientRect();const cx=Math.max(5,Math.min(r.left+r.width/2,r.right-5));const cy=Math.max(5,Math.min(r.bottom-10,r.bottom-5));const ev={bubbles:true,cancelable:true,view:window,clientX:cx,clientY:cy};try{el.dispatchEvent(new MouseEvent('mousemove',ev));}catch{}try{el.dispatchEvent(new MouseEvent('mouseover',ev));}catch{}}function safePlay(video){if(!video)return;try{video.muted=true;video.volume=0;video.setAttribute('playsinline','');video.setAttribute('webkit-playsinline','');video.autoplay=true;video.preload='auto';const ret=video.play();if(ret&&typeof ret.catch==='function')ret.catch(()=>{});}catch{}}(function attachGestureUnlock(){let attached=false;const attach=()=>{if(attached)return;const container=document.querySelector('#player-con')||document.querySelector('.prism-player');if(!container){setTimeout(attach,300);return;}attached=true;const unlockOnce=(e)=>{const v=document.querySelector('#player-con video, .prism-player video, video');if(v){v.muted=true;v.volume=0;try{v.setAttribute('playsinline','');v.setAttribute('webkit-playsinline','');}catch{}try{v.play();}catch{}}const big=document.querySelector('.prism-big-play-btn');const inner=document.querySelector('.prism-big-play-btn .outter');const barBtn=document.querySelector('.prism-controlbar .prism-play-btn')||document.querySelector('.prism-play-btn');if(big&&big.classList.contains('pause')&&isVisible(big))robustClick(big);if(inner&&isVisible(inner))robustClick(inner);if(barBtn&&!barBtn.classList.contains('playing'))robustClick(barBtn);container.removeEventListener('pointerdown',unlockOnce,true);container.removeEventListener('click',unlockOnce,true);};container.addEventListener('pointerdown',unlockOnce,true);container.addEventListener('click',unlockOnce,true);};if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',attach);}else{attach();}const mo=new MutationObserver(()=>{if(!attached)attach();});mo.observe(document.documentElement,{childList:true,subtree:true});setTimeout(()=>mo.disconnect(),30000);})();if(!window.__hardBackToList){window.__hardBackToList=function hardBackToList(){try{const v=document.querySelector('#player-con video, .prism-player video, video');if(v&&v.pause)v.pause();}catch{}try{let id=setInterval(()=>{},9999);for(let i=1;i<=id;i++)clearInterval(i);}catch{}try{let id=setTimeout(()=>{},9999);for(let i=1;i<=id;i++)clearTimeout(i);}catch{}const saved=localStorage.getItem(LAST_LIST_KEY);const refOk=document.referrer&&document.referrer.includes('/student/classroom/getclass/details/');const guessFromRef=refOk?document.referrer:null;const guessFromRegex=(function(){const m=location.href.match(/(https://student.reseayun.com/student/classroom/getclass/details/[^/]+/[^/]+)/);return m?m[1]:null;})();const target=saved||guessFromRef||guessFromRegex||location.href.match(/(https://student.reseayun.com/student/classroom/getclass/details/[^/]+/[^/]+)/)?.[1]||'https://student.reseayun.com/';if(target){localStorage.setItem(RESUME_RELOAD,'1');const sep=target.includes('?')?'&':'?';location.replace(target+sep+'_refresh='+Date.now());}else{history.back();}};}function detectModeByDOM(){const hasPlayer=!!document.querySelector('#player-con, .prism-player, video');const hasList=!!document.querySelector('.el-table__body tbody tr.el-table__row');if(hasPlayer&&!hasList)return 'player';if(hasList&&!hasPlayer)return 'list';if(hasPlayer)return 'player';if(hasList)return 'list';return null;}function readProgressValue(row){const inner=row.querySelector('.el-progress-bar__inner');if(inner&&inner.getAttribute('style')){const m=inner.getAttribute('style').match(/width:s*([d.]+)%/i);if(m)return Math.min(100,Math.max(0,parseFloat(m[1])));}const txt=(row.querySelector('.el-progress__text span')?.textContent||'').trim();const m2=txt.match(/(d{1,3})s*%/);if(m2)return Math.min(100,Math.max(0,parseInt(m2[1],10)));const aria=row.querySelector('.el-progress[aria-valuenow]')?.getAttribute('aria-valuenow');if(aria&&/^d+(.d+)?$/.test(aria))return Math.min(100,Math.max(0,parseFloat(aria)));return null;}function startListModule(){if(!Runtime.setMode('list'))return;if(localStorage.getItem(RESUME_RELOAD)==='1'){localStorage.removeItem(RESUME_RELOAD);console.log('[AUTO] 检测到刷新标记,强制刷新页面获取最新数据…');setTimeout(()=>{location.reload(true);},200);return;}const getRows=()=>Array.from(document.querySelectorAll('.el-table__body tbody tr.el-table__row')).filter(r=>r.offsetParent!==null);const isLocked=row=>!!row.querySelector('.lock-tag');const findWatchBtn=row=>{const btns=Array.from(row.querySelectorAll('button.el-button'));return btns.find(b=>/观看/.test((b.textContent||'').trim())&&!b.disabled);};function pickRow(){for(const r of getRows()){if(isLocked(r))continue;const pv=readProgressValue(r);if(pv!==null&&pv<=PROGRESS_THRESHOLD){const btn=findWatchBtn(r);if(btn)return{row:r,btn};}}for(const r of getRows()){if(isLocked(r))continue;if((r.textContent||'').includes('未完成')){const btn=findWatchBtn(r);if(btn)return{row:r,btn};}}return null;}function tryClick(){const target=pickRow();if(!target){Runtime.addTimer(setTimeout(tryClick,LIST_RETRY_MS));return;}const{row,btn}=target;try{localStorage.setItem(LAST_LIST_KEY,location.href.split('?')[0].split('&')[0]);}catch{}try{row.scrollIntoView({block:'center',behavior:'smooth'});}catch{}setTimeout(()=>robustClick(btn),120);}(function wait(){if(document.querySelector('.el-table__body')){Runtime.addTimer(setTimeout(tryClick,AFTER_BACK_WAIT_MS));}else{Runtime.addTimer(setTimeout(wait,400));}})();}function startPlayerModule(){if(!Runtime.setMode('player'))return;const startTime=Date.now(),maxMs=MAX_MIN*60*1000;let video=null,lastTime=0,lastTick=Date.now(),tries=0;let doneOnce=false;function bindVideoIfAny(){const v=document.querySelector('#player-con video, .prism-player video, video');if(!v||v===video)return;video=v;safePlay(video);const onCheck=()=>{const d=video.duration||0,c=video.currentTime||0;if(c>lastTime+0.1){lastTime=c;lastTick=Date.now();}if(video.paused)safePlay(video);const ratio=d>0?c/d:0;const timeExceeded=(Date.now()-startTime)>=maxMs;if(!doneOnce&&(ratio>=DONE_THRESHOLD||video.ended||timeExceeded)){doneOnce=true;window.__hardBackToList&&window.__hardBackToList();}};['loadeddata','canplay','playing','pause','stalled','waiting','timeupdate','ended'].forEach(e=>video.addEventListener(e,onCheck));if('requestVideoFrameCallback'in video){const step=()=>{onCheck();if(video)video.requestVideoFrameCallback(step);};video.requestVideoFrameCallback(step);}Runtime.addTimer(setInterval(()=>{if(!video)return;onCheck();},1000));}function clickControlsIfNeeded(){const container=document.querySelector('#player-con')||document.querySelector('.prism-player')||document.body;const big=document.querySelector('.prism-big-play-btn');const inner=document.querySelector('.prism-big-play-btn .outter');const bar=document.querySelector('.prism-controlbar');const barBtn=document.querySelector('.prism-controlbar .prism-play-btn')||document.querySelector('.prism-play-btn');mouseWake(container);const needClickBig=(big&&big.classList.contains('pause')&&isVisible(big))||(inner&&isVisible(inner));if(needClickBig)robustClick(big||inner);if(barBtn&&!barBtn.classList.contains('playing')){if(!isVisible(bar))mouseWake(container);robustClick(barBtn);}safePlay(video||document.querySelector('video'));}const loop=setInterval(()=>{tries++;bindVideoIfAny();const playingBtn=document.querySelector('.prism-big-play-btn.playing');const playingBtnHidden=playingBtn&&!isVisible(playingBtn);if(!playingBtnHidden||(Date.now()-lastTick>STUCK_RETRY_SEC*1000)){clickControlsIfNeeded();}if(Date.now()-lastTick<STUCK_RETRY_SEC*1000&&video&&!video.paused){setTimeout(()=>{if(Date.now()-lastTick<STUCK_RETRY_SEC*1000&&video&&!video.paused){clearInterval(loop);}},PLAY_CLICK_INTERVAL+200);}if(tries>=PLAY_CLICK_MAX_TRY)clearInterval(loop);},PLAY_CLICK_INTERVAL);Runtime.addLoop(loop);const mo=new MutationObserver(()=>bindVideoIfAny());mo.observe(document.documentElement,{childList:true,subtree:true});Runtime.addObserver(mo);bindVideoIfAny();}function boot(){const mode=detectModeByDOM();if(mode==='player')startPlayerModule();else if(mode==='list')startListModule();else Runtime.addTimer(setTimeout(boot,400));}boot();const sw=new MutationObserver(()=>{const detected=detectModeByDOM();if(detected&&detected!==Runtime.mode){Runtime.cleanup();if(detected==='player')startPlayerModule();if(detected==='list')startListModule();}});sw.observe(document.documentElement,{childList:true,subtree:true});Runtime.addObserver(sw);})();

点击保存。

3.安装Tampermonkey(篡改猴)扩展

安装完成之后,添加新脚本,将以下内容粘贴到:

// ==UserScript==

// @name         reseayun 自动触发刷课书签(修复版 – 返回后强制刷新)

// @namespace    reseayun-autoplay

// @version      1.3.0

// @match        https://student.reseayun.com/*

// @run-at       document-start

// @inject-into  page

// @noframes

// @grant        none

// ==/UserScript==

(function(){

  const BOOKMARK_KEY = 'reseayun_bookmarklet_code';

  const AUTO_RUN_FLAG = 'reseayun_auto_run_enabled';

  // 核心代码(修复版:返回后强制刷新列表)

  const CORE_CODE = `(function(){const PROGRESS_THRESHOLD=95;const MAX_MIN=50;const DONE_THRESHOLD=0.98;const LIST_RETRY_MS=1000;const AFTER_BACK_WAIT_MS=1500;const PLAY_CLICK_INTERVAL=700;const PLAY_CLICK_MAX_TRY=120;const STUCK_RETRY_SEC=8;const LAST_LIST_KEY='reseayun_last_list';const RESUME_RELOAD='reseayun_resume_reload';if(window.__AUTO_COURSE_RUNNING__)return;window.__AUTO_COURSE_RUNNING__=true;const Runtime={mode:null,timers:new Set(),observers:new Set(),loops:new Set(),setMode(m){if(this.mode===m)return false;this.cleanup();this.mode=m;return true;},addTimer(id){this.timers.add(id);return id;},addLoop(id){this.loops.add(id);return id;},addObserver(o){this.observers.add(o);return o;},cleanup(){this.timers.forEach(id=>{try{clearInterval(id);}catch{}});this.loops.forEach(id=>{try{clearInterval(id);}catch{}});this.observers.forEach(o=>{try{o.disconnect();}catch{}});this.timers.clear();this.loops.clear();this.observers.clear();}};const isVisible=el=>!!el&&(()=>{const s=getComputedStyle(el);return s.display!=='none'&&s.visibility!=='hidden'&&s.opacity!=='0';})();function robustClick(el){if(!el)return;try{el.scrollIntoView({block:'center'});}catch{}try{el.focus({preventScroll:true});}catch{}const r=el.getBoundingClientRect();const cx=Math.max(5,Math.min(r.left+r.width/2,r.right-5));const cy=Math.max(5,Math.min(r.top+r.height/2,r.bottom-5));const base={bubbles:true,cancelable:true,view:window,clientX:cx,clientY:cy};['pointerdown','mousedown','pointerup','mouseup','click'].forEach(t=>{try{el.dispatchEvent(new MouseEvent(t,base));}catch{}});try{el.click();}catch{}}function mouseWake(el){if(!el)return;const r=el.getBoundingClientRect();const cx=Math.max(5,Math.min(r.left+r.width/2,r.right-5));const cy=Math.max(5,Math.min(r.bottom-10,r.bottom-5));const ev={bubbles:true,cancelable:true,view:window,clientX:cx,clientY:cy};try{el.dispatchEvent(new MouseEvent('mousemove',ev));}catch{}try{el.dispatchEvent(new MouseEvent('mouseover',ev));}catch{}}function safePlay(video){if(!video)return;try{video.muted=true;video.volume=0;video.setAttribute('playsinline','');video.setAttribute('webkit-playsinline','');video.autoplay=true;video.preload='auto';const ret=video.play();if(ret&&typeof ret.catch==='function')ret.catch(()=>{});}catch{}}(function attachGestureUnlock(){let attached=false;const attach=()=>{if(attached)return;const container=document.querySelector('#player-con')||document.querySelector('.prism-player');if(!container){setTimeout(attach,300);return;}attached=true;const unlockOnce=(e)=>{const v=document.querySelector('#player-con video, .prism-player video, video');if(v){v.muted=true;v.volume=0;try{v.setAttribute('playsinline','');v.setAttribute('webkit-playsinline','');}catch{}try{v.play();}catch{}}const big=document.querySelector('.prism-big-play-btn');const inner=document.querySelector('.prism-big-play-btn .outter');const barBtn=document.querySelector('.prism-controlbar .prism-play-btn')||document.querySelector('.prism-play-btn');if(big&&big.classList.contains('pause')&&isVisible(big))robustClick(big);if(inner&&isVisible(inner))robustClick(inner);if(barBtn&&!barBtn.classList.contains('playing'))robustClick(barBtn);container.removeEventListener('pointerdown',unlockOnce,true);container.removeEventListener('click',unlockOnce,true);};container.addEventListener('pointerdown',unlockOnce,true);container.addEventListener('click',unlockOnce,true);};if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',attach);}else{attach();}const mo=new MutationObserver(()=>{if(!attached)attach();});mo.observe(document.documentElement,{childList:true,subtree:true});setTimeout(()=>mo.disconnect(),30000);})();if(!window.__hardBackToList){window.__hardBackToList=function hardBackToList(){try{const v=document.querySelector('#player-con video, .prism-player video, video');if(v&&v.pause)v.pause();}catch{}try{let id=setInterval(()=>{},9999);for(let i=1;i<=id;i++)clearInterval(i);}catch{}try{let id=setTimeout(()=>{},9999);for(let i=1;i<=id;i++)clearTimeout(i);}catch{}const saved=localStorage.getItem(LAST_LIST_KEY);const refOk=document.referrer&&document.referrer.includes('/student/classroom/getclass/details/');const guessFromRef=refOk?document.referrer:null;const guessFromRegex=(function(){const m=location.href.match(/(https:\/\/student\.reseayun\.com\/student\/classroom\/getclass\/details\/[^/]+\/[^/]+)/);return m?m[1]:null;})();const target=saved||guessFromRef||guessFromRegex||location.href.match(/(https:\/\/student\.reseayun\.com\/student\/classroom\/getclass\/details\/[^/]+\/[^/]+)/)?.[1]||'https://student.reseayun.com/';if(target){localStorage.setItem(RESUME_RELOAD,'1');const sep=target.includes('?')?'&':'?';location.replace(target+sep+'_refresh='+Date.now());}else{history.back();}};}function detectModeByDOM(){const hasPlayer=!!document.querySelector('#player-con, .prism-player, video');const hasList=!!document.querySelector('.el-table__body tbody tr.el-table__row');if(hasPlayer&&!hasList)return 'player';if(hasList&&!hasPlayer)return 'list';if(hasPlayer)return 'player';if(hasList)return 'list';return null;}function readProgressValue(row){const inner=row.querySelector('.el-progress-bar__inner');if(inner&&inner.getAttribute('style')){const m=inner.getAttribute('style').match(/width:\s*([\d.]+)%/i);if(m)return Math.min(100,Math.max(0,parseFloat(m[1])));}const txt=(row.querySelector('.el-progress__text span')?.textContent||'').trim();const m2=txt.match(/(\d{1,3})\s*%/);if(m2)return Math.min(100,Math.max(0,parseInt(m2[1],10)));const aria=row.querySelector('.el-progress[aria-valuenow]')?.getAttribute('aria-valuenow');if(aria&&/^\d+(\.\d+)?$/.test(aria))return Math.min(100,Math.max(0,parseFloat(aria)));return null;}function startListModule(){if(!Runtime.setMode('list'))return;if(localStorage.getItem(RESUME_RELOAD)==='1'){localStorage.removeItem(RESUME_RELOAD);console.log('[AUTO] 检测到刷新标记,强制刷新页面获取最新数据…');setTimeout(()=>{location.reload(true);},200);return;}const getRows=()=>Array.from(document.querySelectorAll('.el-table__body tbody tr.el-table__row')).filter(r=>r.offsetParent!==null);const isLocked=row=>!!row.querySelector('.lock-tag');const findWatchBtn=row=>{const btns=Array.from(row.querySelectorAll('button.el-button'));return btns.find(b=>/观看/.test((b.textContent||'').trim())&&!b.disabled);};function pickRow(){for(const r of getRows()){if(isLocked(r))continue;const pv=readProgressValue(r);if(pv!==null&&pv<=PROGRESS_THRESHOLD){const btn=findWatchBtn(r);if(btn)return{row:r,btn};}}for(const r of getRows()){if(isLocked(r))continue;if((r.textContent||'').includes('未完成')){const btn=findWatchBtn(r);if(btn)return{row:r,btn};}}return null;}function tryClick(){const target=pickRow();if(!target){Runtime.addTimer(setTimeout(tryClick,LIST_RETRY_MS));return;}const{row,btn}=target;try{localStorage.setItem(LAST_LIST_KEY,location.href.split('?')[0].split('&')[0]);}catch{}try{row.scrollIntoView({block:'center',behavior:'smooth'});}catch{}setTimeout(()=>robustClick(btn),120);}(function wait(){if(document.querySelector('.el-table__body')){Runtime.addTimer(setTimeout(tryClick,AFTER_BACK_WAIT_MS));}else{Runtime.addTimer(setTimeout(wait,400));}})();}function startPlayerModule(){if(!Runtime.setMode('player'))return;const startTime=Date.now(),maxMs=MAX_MIN*60*1000;let video=null,lastTime=0,lastTick=Date.now(),tries=0;let doneOnce=false;function bindVideoIfAny(){const v=document.querySelector('#player-con video, .prism-player video, video');if(!v||v===video)return;video=v;safePlay(video);const onCheck=()=>{const d=video.duration||0,c=video.currentTime||0;if(c>lastTime+0.1){lastTime=c;lastTick=Date.now();}if(video.paused)safePlay(video);const ratio=d>0?c/d:0;const timeExceeded=(Date.now()-startTime)>=maxMs;if(!doneOnce&&(ratio>=DONE_THRESHOLD||video.ended||timeExceeded)){doneOnce=true;window.__hardBackToList&&window.__hardBackToList();}};['loadeddata','canplay','playing','pause','stalled','waiting','timeupdate','ended'].forEach(e=>video.addEventListener(e,onCheck));if('requestVideoFrameCallback'in video){const step=()=>{onCheck();if(video)video.requestVideoFrameCallback(step);};video.requestVideoFrameCallback(step);}Runtime.addTimer(setInterval(()=>{if(!video)return;onCheck();},1000));}function clickControlsIfNeeded(){const container=document.querySelector('#player-con')||document.querySelector('.prism-player')||document.body;const big=document.querySelector('.prism-big-play-btn');const inner=document.querySelector('.prism-big-play-btn .outter');const bar=document.querySelector('.prism-controlbar');const barBtn=document.querySelector('.prism-controlbar .prism-play-btn')||document.querySelector('.prism-play-btn');mouseWake(container);const needClickBig=(big&&big.classList.contains('pause')&&isVisible(big))||(inner&&isVisible(inner));if(needClickBig)robustClick(big||inner);if(barBtn&&!barBtn.classList.contains('playing')){if(!isVisible(bar))mouseWake(container);robustClick(barBtn);}safePlay(video||document.querySelector('video'));}const loop=setInterval(()=>{tries++;bindVideoIfAny();const playingBtn=document.querySelector('.prism-big-play-btn.playing');const playingBtnHidden=playingBtn&&!isVisible(playingBtn);if(!playingBtnHidden||(Date.now()-lastTick>STUCK_RETRY_SEC*1000)){clickControlsIfNeeded();}if(Date.now()-lastTick<STUCK_RETRY_SEC*1000&&video&&!video.paused){setTimeout(()=>{if(Date.now()-lastTick<STUCK_RETRY_SEC*1000&&video&&!video.paused){clearInterval(loop);}},PLAY_CLICK_INTERVAL+200);}if(tries>=PLAY_CLICK_MAX_TRY)clearInterval(loop);},PLAY_CLICK_INTERVAL);Runtime.addLoop(loop);const mo=new MutationObserver(()=>bindVideoIfAny());mo.observe(document.documentElement,{childList:true,subtree:true});Runtime.addObserver(mo);bindVideoIfAny();}function boot(){const mode=detectModeByDOM();if(mode==='player')startPlayerModule();else if(mode==='list')startListModule();else Runtime.addTimer(setTimeout(boot,400));}boot();const sw=new MutationObserver(()=>{const detected=detectModeByDOM();if(detected&&detected!==Runtime.mode){Runtime.cleanup();if(detected==='player')startPlayerModule();if(detected==='list')startListModule();}});sw.observe(document.documentElement,{childList:true,subtree:true});Runtime.addObserver(sw);})();`;

  // 保存核心代码(自动更新)

  localStorage.setItem(BOOKMARK_KEY, CORE_CODE);

  localStorage.setItem(AUTO_RUN_FLAG, '1');

  // 自动运行函数

  function autoRun(){

    if (window.__AUTO_COURSE_RUNNING__) return;

    const code = localStorage.getItem(BOOKMARK_KEY);

    if (code) {

      try {

        eval(code);

      } catch(e) {

        console.error('[自动运行错误]', e);

      }

    }

  }

  // 页面加载后自动运行

  function triggerAutoRun() {

    if (document.readyState === 'loading') {

      document.addEventListener('DOMContentLoaded', () => {

        setTimeout(autoRun, 500);

      });

    } else {

      setTimeout(autoRun, 500);

    }

  }

  triggerAutoRun();

  // 监听 URL 变化(包括 location.replace)

  let lastHref = location.href;

  setInterval(() => {

    if (location.href !== lastHref) {

      lastHref = location.href;

      delete window.__AUTO_COURSE_RUNNING__;

      setTimeout(autoRun, 800);

    }

  }, 300);

  // 监听页面可见性变化

  document.addEventListener('visibilitychange', () => {

    if (!document.hidden) {

      setTimeout(autoRun, 300);

    }

  });

})();

 

保存之后,点击未启用 切换为已启用状态,并将你的脚本左边拉到绿色

继续教育专业课 自动刷课脚本(简单快捷,适合小白)

然后打开你的刷课界面,点击书签栏的“自动刷课”书签(首次运行),然后刷新当前页面,则可以开始自动刷课,刷完一个视频他会自动返回到该界面,然后刷下一个视频。继续教育专业课 自动刷课脚本(简单快捷,适合小白)

当该课程学完,选择下一个章节学习即可。

继续教育专业课 自动刷课脚本(简单快捷,适合小白)

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
none
暂无评论...