FuckEducoder

This scipt is used for unfreezing educoder's copy restriction.

目前為 2023-11-14 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name FuckEducoder
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description This scipt is used for unfreezing educoder's copy restriction.
  6. // @author SunSeaLucky
  7. // @match https://www.educoder.net/tasks/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @run-at document-start
  11. // @license MIT
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  13. // ==/UserScript==
  14.  
  15. //此为该脚本最后版本(可能),更新已停止
  16.  
  17. //设置随机测试时间区间上限
  18. const max = 30000;
  19. //设置随机测试时间区间下限
  20. const min = 5000;
  21. // 目前设置随机时间的方法出现严重Bug,请谨慎使用!若仍想快速刷时间,请进入微信头歌小程序,在对应的实例界面左右滑动,可快速刷到int最大值
  22. const setRandomTime = false;
  23.  
  24. (function () {
  25. 'use strict';
  26. let oldFetch = fetch;
  27. function hookFetch(...args) {
  28. return new Promise((resolve, reject) => {
  29. oldFetch.apply(this, arguments).then((response) => {
  30. if (arguments[0].indexOf('homework_common_id') !== -1) {
  31. const oldJson = response.json;
  32. response.json = function () {
  33. return new Promise((resolve, reject) => {
  34. oldJson.apply(this, arguments).then((result) => {
  35. if (setRandomTime) result.game.cost_time = Math.floor(Math.random() * (max - min + 1)) + min;
  36. result.shixun.forbid_copy = false;
  37. result.shixun.vip = true;
  38. resolve(result);
  39. });
  40. });
  41. };
  42. }
  43. resolve(response);
  44. });
  45. });
  46. }
  47. window.fetch = hookFetch;
  48. })();