zoukankan      html  css  js  c++  java
  • 极客时间视频下载

    极客时间视频下载

    使用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.setInterval(function(){
            console.log( $('title').text());
            let title = $('title').text();
            if( title.indexOf('完成')>-1) {
                //$('#dlVsaveBtn').click();
                $('#dlAllFinished').click();
                clearInterval(timer);
                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:function(xhr){
                //console.log("onreadystatechange called: %O",xhr)
    
                if (xhr.readyState === 4 && m3u8UrlRegex.test(xhr.responseURL)) {
                    if(timer){
                        //window.location.reload();
                        //window.location.href=window.location.href;
                        clearInterval(timer);
    
                    }
                    var ev1 = new KeyboardEvent('keydown', {
                        keyCode: 32
                    });
                    document.dispatchEvent(ev1);
    
                    if(confirm('保存视频')){
                        setTimeout(function(){
    
                            timer = window.setInterval(function(){
                                var ev = new KeyboardEvent('keydown', {
                                    keyCode: 39
                                });
                                document.dispatchEvent(ev);
                                console.log('keydown arrow right');
                            },1000 * 2);
                        },5000);
                    }
    
                    clearInterval(timer);
                    var ev2 = new KeyboardEvent('keydown', {
                        keyCode: 32
                    });
                    document.dispatchEvent(ev2);
    
                }
            }
        });
    
        window.onload = function(){
    
            //实际使用
            document.onkeydown=function(e){  //对整个页面文档监听
                var keyNum=window.event ? e.keyCode :e.which;  //获取被按下的键值
                //判断如果用户按下了空格键(keycode=32),
                if(keyNum==32){
                    //alert('您按下了空格');
                    clearInterval(timer);
    
    
                }
                if(keyNum==13){
                    //alert('您按下了回车');
                    clearInterval(timer);
    
    
                }
            }
    
    
        }
    
    })();

    Ctrl + S 保存脚本

    下载极客时间视频操作

    打开视频,点击CocoCut 的尝试嗅探一下

  • 相关阅读:
    hadoop配置支持LZO压缩格式并支持分片
    CSS 图片:如何使用 CSS 来布局图片
    CSS3 用户界面:用户界面特性来调整元素尺寸,框尺寸和外边框
    CSS3 多列:如何将文本内容设计成像报纸一样的多列布局?
    mac Pycharm:如何使用anaconda安装jieba
    pycharm如何安装jieba词频统计器?
    CSS3 动画:使元素从一种样式逐渐变化为另一种样式的效果
    CSS3 过渡:用鼠标移过逐渐改变它原有样式
    CSS3 3D 转换:使用 3D 转换来对元素进行格式化
    CSS3 2D 转换:对元素进行移动、缩放、转动、拉长或拉伸
  • 原文地址:https://www.cnblogs.com/zhaoyiguang/p/14198684.html
Copyright © 2011-2022 走看看