极客时间视频下载
使用google浏览器,安装扩展 CocoCut设置、Tampermonkey设置、下载极客时间视频操作
使用google浏览器,安装扩展
google浏览器需要安装扩展 :
CoCoCut 以及 Tampermonkey
CoCoCut视频下载扩展
Tampermonkey扩展
Tampermonkey设置
进入管理面板
添加脚本
CocoCut录制完成自动保存关闭
// ==UserScript== // @name CocoCut录制完成自动保存关闭 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://cococut.net/zh_cn/hls.html // @grant none // ==/UserScript== function) { 'use strict'; var timer = window.setIntervalfunction){ console.log $'title').text)); let title = $'title').text); if title.indexOf'完成')>-1) { //$'#dlVsaveBtn').click); $'#dlAllFinished').click); clearIntervaltimer); window.opener=null; window.open'','_self'); window.close); } },1000 * 3); }));
添加脚本
极客视频加速缓存
// ==UserScript== // @name 极客视频加速缓存 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author gsj // @match https://time.geekbang.org/course/detail/* // @grant none // @require https://unpkg.com/ajax-hook@1.8.3/dist/ajaxhook.min.js // ==/UserScript== function) { 'use strict'; // Your code here... const m3u8UrlRegex = /^.*.m3u8$/; var timer ; hookAjax{ //拦截回调 onreadystatechange:functionxhr){ //console.log"onreadystatechange called: %O",xhr) if xhr.readyState === 4 && m3u8UrlRegex.testxhr.responseURL)) { iftimer){ //window.location.reload); //window.location.href=window.location.href; clearIntervaltimer); } var ev1 = new KeyboardEvent'keydown', { keyCode: 32 }); document.dispatchEventev1); ifconfirm'保存视频')){ setTimeoutfunction){ timer = window.setIntervalfunction){ var ev = new KeyboardEvent'keydown', { keyCode: 39 }); document.dispatchEventev); console.log'keydown arrow right'); },1000 * 2); },5000); } clearIntervaltimer); var ev2 = new KeyboardEvent'keydown', { keyCode: 32 }); document.dispatchEventev2); } } }); window.onload = function){ //实际使用 document.onkeydown=functione){ //对整个页面文档监听 var keyNum=window.event ? e.keyCode :e.which; //获取被按下的键值 //判断如果用户按下了空格键keycode=32), ifkeyNum==32){ //alert'您按下了空格'); clearIntervaltimer); } ifkeyNum==13){ //alert'您按下了回车'); clearIntervaltimer); } } } }));
Ctrl + S 保存脚本
下载极客时间视频操作
打开视频,点击CocoCut 的尝试嗅探一下




