[一劳永逸]钉钉云课堂倍速播放教程
按本文所述方法进行倍速播放,学习记录会按实际播放时间记录。因此建议直接看这篇:钉钉云课堂倍速播放与修改学习进度的方法。
本文参考 https://solstice23.top/archives/1075 并改进,感谢原作者提供思路!
思路
云课堂的本质是一个(套壳的)网页,限制特别多,例如不允许开控制台等等。我们可以从另一个角度入手,中间人注入 js 来实现目的。
暴力地把 js 脚本用 base64 编码后插入到<head>
里。
提示
该方法仅 PC 端可用(其实手机也不是不行)。
一、安装 Fiddler
点击这里下载安装。
二、设置 Fiddler 捕获 HTTPS 流量
打开 Fiddler,点击顶栏 “Tools”,在弹出的菜单中点击 “Options…”。
在弹出的窗口中切换到顶部的 “HTTPS” 菜单,勾选 “Capture HTTPS CONNECTs” 和 “Decrypt HTTPS traffic” 复选框,然后点击 OK。
勾选后会弹出安装证书的窗口,确认即可。
如果出现下面这样的黄条,点击黄条即可。
三、中间人注入
在 Fiddler 中按下 Ctrl+R
。弹出一个代码编辑器窗口。
在代码编辑器窗口按下 Ctrl+F
,在弹出的窗口中输入 OnBeforeResponse 并按下回车。找到 OnBeforeResponse 函数(下图所示)。
复制下面的代码,并粘贴到下图中的位置,然后按下 Ctrl+S
来保存。
以下代码部分来自 HTML5 播放器增强插件,对原作者深表感谢!
注意:代码第一行特别长。
var sToInsert = "<script src=data:application/javascript;base64,KGZ1bmN0aW9uKCl7dmFyIGh0bWxfcGxheWVyX2VuaGFuY2U9e2ZvbnRTaXplOjIwLHBsYXllcjpmdW5jdGlvbigpe3JldHVybiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJ2aWRlbyIpfSx0aXBzOmZ1bmN0aW9uKHN0cil7dmFyIHN0eWxlPWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNodG1sX3BsYXllcl9lbmhhbmNlX3RpcHMiKS5zdHlsZTtkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjaHRtbF9wbGF5ZXJfZW5oYW5jZV90aXBzIikuaW5uZXJUZXh0PX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Wx0ZXIucmVzZXQoKTtfdGhpcy5zZXR0aXBzKCk7X3RoaXMuaXNGb3VjcygpO2RvY3VtZW50Lm9ua2V5ZG93bj1fdGhpcy5idXR0b259LDEwMDApfX19LGxvYWQ6ZmFsc2V9O2h0bWxfcGxheWVyX2VuaGFuY2UuaW5pdCgpO2RvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoIkRPTU5vZGVJbnNlcnRlZCIsZnVuY3Rpb24oKXtodG1sX3BsYXllcl9lbmhhbmNlLmluaXQoKX0pfSkoKTs=></script>";
oSession.utilDecodeResponse();
oSession.utilReplaceOnceInResponse('</head>', sToInsert + '</head>', 0);
快捷键说明
播放速度调节
按键 C:加速播放 +0.1
按键 X:减速播放 -0.1
按键 Z:正常速度播放
播放时间定位
方向键右→:快进 3 秒
方向键左←:后退 3 秒
按键 F:下一帧
按键 D:上一帧
音量调节
方向键上↑:音量升高 1%
方向键下↓:音量降低 1%
图像参数调节
按键 E:亮度增加%
按键 W:亮度减少%
按键 T:对比度增加%
按键 R:对比度减少%
按键 U:饱和度增加%
按键 Y:饱和度减少%
按键 O:色相增加 1 度
按键 I:色相减少 1 度
按键 K:模糊增加 1 px
按键 J:模糊减少 1 px
按键 Q:图像复位
画面调节
按键 S:画面旋转 90 度
按键回车:进入全屏(只支持部分网站 B 站,油管),还想增加什么网站的话,和我反馈一下!
兼容性问题
可以使用组合键临时停用插件,例如 播放/暂停 默认为空格键,那么使用 Ctrl+space(空格键) 即可暂停使用一次插件。
如何“永逸”
每次打开钉钉云课堂之前先打开 Fiddler。
2022 年 2 月 18 日更新
许多人评论倍速播放失效,这可能是因为播放页面不是钉钉本身的云课堂,而是在钉钉内打开了其他网页,且倍速播放脚本不支持这些网站。
理论上用上面的方法可以在网页内注入别的油猴脚本,如果你确需倍速播放的功能,可以联系我(CherryBlossomCnblogs@outlook.com)有偿修改代码。