├── assets
├── image-20231013131227594.png
├── image-20231013131247416.png
├── image-20231013131545509.png
└── image-20231013131645043.png
├── .idea
├── misc.xml
├── vcs.xml
├── .gitignore
├── inspectionProfiles
│ ├── profiles_settings.xml
│ └── Project_Default.xml
├── modules.xml
└── UCAS-MOOC-AutoWatch.iml
├── README.md
├── REAMD-eng.md
├── LICENSE
└── src
└── script2.js
/assets/image-20231013131227594.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linkedlist771/UCAS-MOOC-AutoWatch/HEAD/assets/image-20231013131227594.png
--------------------------------------------------------------------------------
/assets/image-20231013131247416.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linkedlist771/UCAS-MOOC-AutoWatch/HEAD/assets/image-20231013131247416.png
--------------------------------------------------------------------------------
/assets/image-20231013131545509.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linkedlist771/UCAS-MOOC-AutoWatch/HEAD/assets/image-20231013131545509.png
--------------------------------------------------------------------------------
/assets/image-20231013131645043.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linkedlist771/UCAS-MOOC-AutoWatch/HEAD/assets/image-20231013131645043.png
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/UCAS-MOOC-AutoWatch.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UCAS-MOOC-AutoWatch
2 | > 这个脚本适用于果壳`研一英语慕课`自动刷课,
3 | > 主要通过油猴脚本来实现自动刷课和选课。
4 | >
5 | > 如果该项目对你有用,或者喜欢该项目,请不要吝啬点赞。
6 |
7 |
8 | [中文版](README.md) | [English Version](REAMD-eng.md)
9 | ## 主要脚本:
10 | [script1.js](src/script1.js) 用于自动刷课,主要是通过`setInterval`来实现的。
11 |
12 | [script2.js](src/script2.js) 用于自动选课,主要是通过`MutationObserver`来实现的。
13 |
14 | ## 使用方法:
15 |
16 | > 首先需要配置油猴脚本,该配置方案在主流视频网站都有教程,这里不过多介绍。
17 |
18 | ### 1.直接使用油猴下载:
19 |
20 | **安装两个必须的脚本**
21 |
22 | 1. [✅国科大慕课自动刷课脚本: 版本1 (greasyfork.org)](https://greasyfork.org/zh-CN/scripts/477309-国科大慕课自动刷课脚本-版本1)
23 |
24 | 2. [✅国科大慕课自动刷课脚本: 版本2 (greasyfork.org)](https://greasyfork.org/zh-CN/scripts/477732-国科大慕课自动刷课脚本-版本2)
25 |
26 |
27 | ### 2.使用油猴创建代码(此教程适用于方法1中的链接被举报下架):
28 |
29 | **打开油猴脚本页面**
30 |
31 | 
32 |
33 | **添加[script1.js](src/script1.js) 与[script2.js](src/script2.js) 到自定义脚本中**
34 |
35 | 
36 |
37 | 直接复制即可,添加两个脚本在其中。
38 |
39 | ### 3. 启动脚本
40 |
41 | 1. 首先进入国科大英语慕课页面(不开脚本进入。)
42 |
43 | 
44 |
45 | 2. 开启脚本,然后刷新一下页面,如果看到视频开始自动播放则证明已经成功,这个时候就可以不管了。
46 |
47 | 
48 |
49 | > 注: 可能存在刷完一章的课出现弹窗卡主的情况,此时取消脚本,重复1,2步骤即可解决。
50 |
--------------------------------------------------------------------------------
/REAMD-eng.md:
--------------------------------------------------------------------------------
1 | # UCAS-MOOC-AutoWatch
2 | > This script is designed for the UCAS "First Year English MOOC" automatic course watching, mainly implemented through Tampermonkey scripts for automatic course watching and course selection.
3 |
4 | > If you find this project useful or like it, please don't hesitate to give it a thumbs up.
5 |
6 | [中文版](README.md) | [English Version](REAMD-eng.md)
7 |
8 | ## Main Scripts:
9 | [script1.js](src/script1.js) is used for automatic course watching, mainly implemented through `setInterval`.
10 |
11 | [script2.js](src/script2.js) is used for automatic course selection, mainly implemented through `MutationObserver`.
12 |
13 | ## How to Use:
14 |
15 | > First, you need to configure the Tampermonkey script. There are tutorials on mainstream video websites, so I won't go into detail here.
16 |
17 | ### 1. Directly use Tampermonkey to download:
18 |
19 | **Install the two required scripts**
20 |
21 | 1. [✅UCAS MOOC Auto Course Watching Script: Version 1 (greasyfork.org)](https://greasyfork.org/zh-CN/scripts/477309-国科大慕课自动刷课脚本-版本1)
22 |
23 | 2. [✅UCAS MOOC Auto Course Watching Script: Version 2 (greasyfork.org)](https://greasyfork.org/zh-CN/scripts/477310-国科大慕课自动刷课脚本-版本2)
24 |
25 | ### 2. Use Tampermonkey to create code (this tutorial is for when the links in method 1 are reported and removed):
26 |
27 | **Open the Tampermonkey script page**
28 |
29 | 
30 |
31 | **Add [script1.js](src/script1.js) and [script2.js](src/script2.js) to custom scripts**
32 |
33 | 
34 |
35 | Just copy and paste. Add both scripts to it.
36 |
37 | ### 3. Launch the script
38 |
39 | 1. First, go to the UCAS English MOOC page (enter without the script).
40 |
41 | 
42 |
43 | 2. Turn on the script, then refresh the page. If you see the video starting to play automatically, it means it's successful. You can leave it running now.
44 |
45 | 
46 |
47 | > Note: There might be a pop-up window that gets stuck after finishing a chapter. In this case, turn off the script and repeat steps 1 and 2 to solve the issue.
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/src/script2.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name ✅国科大慕课自动刷课脚本: 版本2
3 | // @namespace xhygtf
4 | // @version 2.6.0
5 | // @description 国科大刷课版本2, 请配合刷课版本1一起使用
6 | // @author Muketool
7 | // @match *://*.chaoxing.com/*
8 | // @match *://*.edu.cn/*
9 | // @match *://*.nbdlib.cn/*
10 | // @match *://*.hnsyu.net/*
11 | // @match *://*.mooc.ucas.edu.cn/*
12 | // @connect api.muketool.com
13 | // @connect api2.muketool.com
14 | // @run-at document-end
15 | // @grant unsafeWindow
16 | // @grant GM_xmlhttpRequest
17 | // @grant GM_setValue
18 | // @grant GM_getValue
19 | // @grant GM_setClipboard
20 | // @license MIT
21 | // @supportURL http://docs.muketool.com
22 | // @homepage http://www.muketool.com
23 | // @original-script https://greasyfork.org/zh-CN/scripts/369625-%E8%B6%85%E6%98%9F%E7%BD%91%E8%AF%BE%E5%8A%A9%E6%89%8B
24 | // @original-author wyn665817
25 | // @original-script https://scriptcat.org/script-show-page/10/code
26 | // @original-author coder_tq
27 | // @original-license MIT
28 | // ==/UserScript==
29 | GM_setValue("video_url", 0)
30 |
31 | // 下方为脚本设置,设置修改后,需要刷新或重新打开网课页面才会生效
32 | var setting = {
33 |
34 | //这里设置脚本所使用的题库接口。默认使用Muketool的题库,您也可以自行替换为其他题库服务器。(修改第三方题库后可能需要同时修改部分其他代码,一点都不了解的就不要乱改了)
35 | //脚本自带两个题库接口:“http://api.muketool.com”(默认使用该接口)和“http://api2.muketool.com”,
36 | //二个题库试题数据一样,区别在于前者使用加速线路,响应更快但是易受攻击;后者采用国外高防线路速度略慢但无视网络攻击。如果您发现其中一个题库失联,可以尝试切换为另一个。
37 | tiku: 'http://api.muketool.com'
38 |
39 | // 常用设置
40 | , time: 8E3 // 默认响应速度为5秒,不建议小于5秒。5E3 == 5000,科学记数法,表示毫秒数
41 | , review: 0 // 复习模式,完整挂机视频(音频)时长,支持挂机任务点已完成的视频和音频,默认关闭
42 | , queue: 1 // 队列模式,开启后任务点逐一完成,关闭则单页面所有任务点同时进行,默认开启
43 | , video: 1 // 视频支持后台、切换窗口不暂停,支持多视频,默认开启。1代表开启,0代表关闭
44 | , work: 1 // 自动答题功能(章节测验),作业需要手动开启查询,高准确率,默认开启
45 | , audio: 1 // 音频自动播放,与视频功能共享vol和rate参数,默认开启
46 | , book: 1 // 图书阅读任务点,非课程阅读任务点,默认开启
47 | , docs: 1 // 文档阅读任务点,PPT类任务点自动完成阅读任务,默认开启
48 |
49 | // 本区域参数,上方为任务点功能,下方为独立功能
50 | , jump: 1 // 自动切换任务点、章节、课程(需要配置course参数),默认开启
51 | , read: '65' // 挂机课程阅读时间,单位是分钟,'65'代表挂机65分钟,请手动打开阅读页面,默认'65'分钟
52 | , face: 1 // 解除面部识别(不支持二维码类面部采集),此功能仅为临时解除,默认开启
53 | , total: 1 // 显示课程进度的统计数据,在学习进度页面的上方展示,默认开启
54 |
55 | // 仅开启video(audio)时,修改此处才会生效
56 | , line: '公网1' // 视频播放的默认资源线路,此功能适用于系统默认线路无资源,默认'公网1'
57 | , http: '标清' // 视频播放的默认清晰度,无效参数则使用系统默认清晰度,默认'标清'
58 | // 本区域参数,上方为video功能独享,下方为audio功能共享
59 | , vol: '0' // 默认音量的百分数,设定范围:[0,100],'0'为静音,默认'0'
60 | , rate: '1' // 视频播放默认倍率,参数范围0∪[0.0625,16],'0'为秒过,默认'1'倍
61 |
62 | // 仅开启work时,修改此处才会生效
63 | // auto: 1 已放置面板,请在面板配置,默认为自动提交 // 答题完成后自动提交,默认开启
64 | , none: 0 // 无匹配答案时执行默认操作,关闭后若题目无匹配答案则会暂时保存已作答的题目,默认开启
65 | , scale: 0 // 富文本编辑器高度自动拉伸,用于文本类题目,答题框根据内容自动调整大小,默认关闭
66 |
67 | // 仅开启jump时,修改此处才会生效
68 | , course: 0 // 当前课程完成后自动切换课程,仅支持按照根目录课程顺序切换,默认开启
69 | , lock: 1 // 跳过未开放(图标是锁)的章节,即闯关模式或定时发放的任务点,默认开启
70 |
71 | // 自动登录功能配置区
72 | , school: '账号为手机号可以不修改此参数' // 学校/单位/机构码,要求完整有效可查询,例如'清华大学'
73 | , username: '' // 学号/工号/借书证号(邮箱/手机号/账号),例如'2018010101',默认''
74 | , password: '' // 密码,例如'123456',默认''
75 |
76 | // 脚本的信息,主要用于接口适配和升级检测
77 | , script: 'v1cx', version: '1.1.4'
78 |
79 | }, _self = unsafeWindow, url = location.pathname, top = _self;
80 |
81 | var tmpSubmit = 1; //本次
82 | Object.defineProperty(setting, "auto", {
83 | get: function () {
84 | if (tmpSubmit >= 2) {
85 | return tmpSubmit === 3;
86 | }
87 | return GM_getValue("autosubmit");
88 | }, set: function (value) {
89 | tmpSubmit = value + 2;
90 | }
91 | });
92 |
93 | setting.notice = '公告栏';
94 |
95 | if (url != '/studyApp/studying' && top != _self.top) document.domain = location.host.replace(/.+?\./, '');
96 |
97 | try {
98 | while (top != _self.top) {
99 | top = top.parent.document ? top.parent : _self.top;
100 | if (top.location.pathname == '/mycourse/studentstudy') break;
101 | }
102 | } catch (err) {
103 | // console.log(err);
104 | top = _self;
105 | }
106 |
107 | var $ = _self.jQuery || top.jQuery, parent = _self == top ? self : _self.parent, Ext = _self.Ext || parent.Ext || {},
108 | UE = _self.UE, vjs = _self.videojs;
109 |
110 | // 回到旧版页面
111 | $('.Header').find('a:contains(回到旧版)')[0] ? $('.Header').find('a:contains(回到旧版)')[0].click() : '';
112 |
113 | String.prototype.toCDB = function () {
114 | return this.replace(/\s/g, '').replace(/[\uff01-\uff5e]/g, function (str) {
115 | return String.fromCharCode(str.charCodeAt(0) - 65248);
116 | }).replace(/[“”]/g, '"').replace(/[‘’]/g, "'").replace(/。/g, '.');
117 | };
118 |
119 | setting.normal = ''; // ':visible'
120 | // setting.time += Math.ceil(setting.time * Math.random()) - setting.time / 2;
121 | setting.job = [':not(*)'];
122 |
123 | setting.video && setting.job.push('iframe[src*="/video/index.html"]');
124 | setting.work && setting.job.push('iframe[src*="/work/index.html"]');
125 | setting.audio && setting.job.push('iframe[src*="/audio/index.html"]');
126 | setting.book && setting.job.push('iframe[src*="/innerbook/index.html"]');
127 | setting.docs && setting.job.push('iframe[src*="/ppt/index.html"]', 'iframe[src*="/pdf/index.html"]');
128 |
129 | setting.tip = !setting.queue || top != _self && jobSort($ || Ext.query);
130 |
131 | setInterval(function() {
132 | location.reload(); // 刷新当前网页
133 | }, 300000
134 | ); // 300000毫秒等于5分钟
135 |
136 |
137 | if (url == '/mycourse/studentstudy') {
138 | _self.checkMobileBrowerLearn = $.noop;
139 | var classId = location.search.match(/cla[zs]{2}id=(\d+)/i)[1] || 0,
140 | courseId = _self.courseId || location.search.match(/courseId=(\d+)/i)[1] || 0;
141 | setting.lock || $('#coursetree').on('click', '[onclick*=void], [href*=void]', function () {
142 | _self.getTeacherAjax(courseId, classId, $(this).parent().attr('id').slice(3));
143 | });
144 | } else if (url == '/ananas/modules/video/index.html' && setting.video) {
145 | if (setting.review) _self.greenligth = Ext.emptyFn;
146 | checkPlayer(_self.supportH5Video());
147 | click_bo();
148 | } else if (url == '/work/doHomeWorkNew' || url == '/api/work' || url == '/work/addStudentWorkNewWeb' || url == '/mooc2/work/dowork') {
149 | console.log("进入答题界面!");
150 | if (!UE) {
151 | var len = ($ || Ext.query || Array)('font:contains(未登录)', document).length;
152 | setTimeout(len == 1 ? top.location.reload : parent.greenligth, setting.time);
153 | } else if (setting.work) {
154 | setTimeout(relieveLimit, 0);
155 | beforeFind();
156 | }
157 | } else if (url == '/ananas/modules/audio/index.html' && setting.audio) {
158 | if (setting.review) _self.greenligth = Ext.emptyFn;
159 | // _self.videojs = hookAudio;
160 | _self.alert = console.log;
161 | let OriginPlayer = _self.videojs.getComponent('Player')
162 | let woailiyinhe = function (tag, options, ready) {
163 | var config = options;
164 | config.plugins.studyControl.enableSwitchWindow = 1;
165 | config.plugins.seekBarControl.enableFastForward = 1;
166 | if (!setting.queue) delete config.plugins.studyControl;
167 | let player = OriginPlayer.call(this, tag, options, ready)
168 | var a = '',
169 | img = '';
170 | player.volume(Math.round(setting.vol) / 100 || 0);
171 | player.playbackRate(setting.rate > 16 || setting.rate < 0.0625 ? 1 : setting.rate);
172 | Ext.get(player.controlBar.addChild('Button').el_).setHTML(a + img + '').dom.title = '下载音频';
173 | player.on('loadeddata', function () {
174 | setting.tip && this.play().catch(Ext.emptyFn);
175 | });
176 | player.one('firstplay', function () {
177 | setting.rate === '0' && config.plugins.seekBarControl.sendLog(this.children_[0], 'ended', Math.floor(this.cache_.duration));
178 | });
179 | player.on('ended', function () {
180 | Ext.fly(frameElement).parent().addCls('ans-job-finished');
181 | });
182 | return player;
183 | }
184 | woailiyinhe.prototype = Object.create(OriginPlayer.prototype)
185 | _self.videojs.getComponent('Component').components_['Player'] = woailiyinhe
186 | } else if (url == '/ananas/modules/innerbook/index.html' && setting.book && setting.tip) {
187 | setTimeout(function () {
188 | _self.setting ? _self.top.onchangepage(_self.getFrameAttr('end')) : _self.greenligth();
189 | }, setting.time);
190 | } else if (url.match(/^\/ananas\/modules\/(ppt|pdf)\/index\.html$/) && setting.docs && setting.tip) {
191 | setTimeout(function () {
192 | _self.setting ? _self.finishJob() : _self.greenligth();
193 | }, setting.time);
194 | frameElement.setAttribute('download', 1);
195 | } else if (url == '/knowledge/cards') {
196 | $ && checkToNext();
197 | } else if (url.match(/^\/(course|zt)\/\d+\.html$/)) {
198 | setTimeout(function () {
199 | +setting.read && _self.sendLogs && $('.course_section:eq(0) .chapterText').click();
200 | }, setting.time);
201 | } else if (url == '/ztnodedetailcontroller/visitnodedetail') {
202 | setting.read *= 60 / $('.course_section').length;
203 | setting.read && _self.sendLogs && autoRead();
204 | } else if (url == '/mycourse/studentcourse') {
205 | var gv = location.search.match(/d=\d+&/g);
206 | setting.total && $('', {
207 | href: '/moocAnalysis/chapterStatisticByUser?classI' + gv[1] + 'courseI' + gv[0] + 'userId=' + _self.getCookie('_uid') + '&ut=s',
208 | target: '_blank',
209 | title: '点击查看章节统计',
210 | style: 'margin: 0 25px;',
211 | html: '本课程共' + $('.icon').length + '节,剩余' + $('em:not(.openlock)').length + '节未完成'
212 | }).appendTo('.zt_logo').parent().width('auto');
213 | } else if (url.match(/^\/visit\/(courses|interaction)$/)) {
214 | setting.face && $('.zmodel').on('click', '[onclick^=openFaceTip]', DisplayURL);
215 | } else if (location.host.match(/^passport2/)) {
216 | setting.username && getSchoolId();
217 | } else if (location.hostname == 'i.mooc.chaoxing.com') {
218 | _self.layui.use('layer', function () {
219 | this.layer.open({
220 | content: '拖动进度条、倍速播放、秒过可能会导致不良记录!题库在慢慢补充,搜不到的题目系统会在全网检索并定时补充进题库。本脚本完全免费下载和使用,严禁倒卖!',
221 | title: 'Muketool超星网课助手提示',
222 | btn: '了解并继续使用',
223 | offset: 't',
224 | closeBtn: 0
225 | });
226 | });
227 | } else if (url == '/widget/pcvote/goStudentVotePage') {
228 | $(':checked').click();
229 | $('.StudentTimu').each(function (index) {
230 | var ans = _self.questionlist[index].answer;
231 | $(':radio, :checkbox', this).each(function (num) {
232 | ans[num].isanswer && this.click();
233 | });
234 | $(':text', this).val(function (num) {
235 | return $(ans[num].content).text().trim();
236 | });
237 | });
238 | } else if (url == '/work/selectWorkQuestionYiPiYue') {
239 | submitAnswer(getIframe().parent(), $.extend(true, [], parent._data));
240 | }
241 |
242 | function getIframe(tip, win, job) {
243 | if (!$) return Ext.get(frameElement || []).parent().child('.ans-job-icon') || Ext.get([]);
244 | do {
245 | win = win ? win.parent : _self;
246 | job = $(win.frameElement).prevAll('.ans-job-icon');
247 | } while (!job.length && win.parent.frameElement);
248 | return tip ? win : job;
249 | }
250 |
251 | function jobSort($) {
252 | var fn = $.fn ? [getIframe(1), 'length'] : [self, 'dom'],
253 | sel = setting.job.join(', :not(.ans-job-finished) > .ans-job-icon' + setting.normal + ' ~ ');
254 | if ($(sel, fn[0].parent.document)[0] == fn[0].frameElement) return true;
255 | if (!getIframe()[fn[1]] || getIframe().parent().is('.ans-job-finished')) return null;
256 | setInterval(function () {
257 | $(sel, fn[0].parent.document)[0] == fn[0].frameElement && fn[0].location.reload();
258 | }, setting.time);
259 | }
260 |
261 | // 检查播放器
262 | function checkPlayer(tip) {
263 | _self.alert = console.log;
264 | let OriginPlayer = _self.videojs.getComponent('Player')
265 | let woailiyinhe = function (tag, options, ready) {
266 | let config = options
267 | if (!config) {
268 | return options;
269 | }
270 | var line = Ext.Array.filter(Ext.Array.map(config.playlines, function (value, index) {
271 | return value.label == setting.line && index;
272 | }), function (value) {
273 | return Ext.isNumber(value);
274 | })[0] || 0, http = Ext.Array.filter(config.sources, function (value) {
275 | return value.label == setting.http;
276 | })[0];
277 | config.playbackRates = [0.5, 1, 1.5, 2, 4, 8, 16];
278 | config.playlines.unshift(config.playlines[line]);
279 | config.playlines.splice(line + 1, 1);
280 | config.plugins.videoJsResolutionSwitcher.default = http ? http.res : 360;
281 | config.plugins.studyControl.enableSwitchWindow = 1;
282 | config.plugins.timelineObjects.url = '/richvideo/initdatawithviewer?';
283 | config.plugins.seekBarControl.enableFastForward = 1;
284 |
285 | if (!setting.queue) delete config.plugins.studyControl;
286 | let player = OriginPlayer.call(this, tag, options, ready)
287 | var a = '',
288 | img = '';
289 | player.playbackRate = function (t) {
290 | if (void 0 === t) return;
291 | this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : setting.rate;
292 | this.techCall_("setPlaybackRate", t)
293 | };
294 | player.volume(Math.round(setting.vol) / 100 || 0);
295 | Ext.get(player.controlBar.addChild('Button').el_).setHTML(a + img + '').dom.title = '下载视频';
296 | player.on('loadstart', function () {
297 | setting.tip && this.play().catch(Ext.emptyFn);
298 | this.playbackRate(setting.rate > 16 || setting.rate < 0.0625 ? 1 : setting.rate);
299 | });
300 | player.one(['loadedmetadata', 'firstplay'], function () {
301 | setting.two = setting.rate === '0' && setting.two < 1;
302 | setting.two && config.plugins.seekBarControl.sendLog(this.children_[0], 'ended', Math.floor(this.cache_.duration));
303 | });
304 | player.on('ended', function () {
305 | Ext.fly(frameElement).parent().addCls('ans-job-finished');
306 | });
307 | return player;
308 | }
309 | woailiyinhe.prototype = Object.create(OriginPlayer.prototype)
310 | _self.videojs.getComponent('Component').components_['Player'] = woailiyinhe
311 | Ext.isSogou = Ext.isIos = Ext.isAndroid = false;
312 | var data = Ext.decode(_self.config('data')) || {};
313 | delete data.danmaku;
314 | data.doublespeed = 1;
315 | frameElement.setAttribute('data', Ext.encode(data));
316 |
317 | //_self.videojs = hookVideo;
318 | if (tip) return;
319 | _self.supportH5Video = function () {
320 | return true;
321 | };
322 | alert('此浏览器不支持html5播放器,请更换浏览器(推荐使用微软Edge浏览器或谷歌Chrome浏览器)');
323 | }
324 |
325 |
326 | function click_bo() {
327 | var interval = setInterval(function () {
328 | if (document.querySelector("#video > button")) {
329 | var video = document.getElementById("video_html5_api");
330 | var video_url = video.src;
331 | var suspend = document.querySelector("#video > div.vjs-control-bar > button.vjs-play-control.vjs-control.vjs-button.vjs-paused");
332 | if (getIframe().parent().is('.ans-job-finished')) {
333 | console.log("播放完毕");
334 | GM_setValue("video_url", 0);
335 | clearInterval(interval);
336 | } else if (suspend && suspend.textContent == "播放" && video_url == GM_getValue("video_url")) {
337 | video.play();
338 | } else if (document.querySelector("#video > button") && GM_getValue("video_url") == 0) {
339 | video.play();
340 | GM_setValue("video_url", video_url);
341 | }
342 | if (document.querySelector('#video > div > div > button[title="静音"]') && setting.vol == "0") {
343 | video.muted = "0";
344 | }
345 |
346 | }
347 | }, Math.floor(Math.random() * 3000) + 500);
348 | }
349 |
350 | function hookVideo() {
351 | }
352 |
353 | function relieveLimit() {
354 | if (setting.scale) _self.UEDITOR_CONFIG.scaleEnabled = false;
355 | $.each(UE.instants, function () {
356 | var key = this.key;
357 | this.ready(function () {
358 | this.destroy();
359 | UE.getEditor(key);
360 | });
361 | });
362 | }
363 |
364 | function beforeFind() {
365 | setting.regl = parent.greenligth || $.noop;
366 | if ($.type(parent._data) == 'array') return setting.regl();
367 | var maximize = $('