首页 > 其他分享 >无限制下载器脚本

无限制下载器脚本

时间:2023-05-30 14:57:50浏览次数:28  
标签:脚本 document 限制 mp4 window video download audio 下载

无限制下载器下载视频,利用bat脚本使用FFmpeg合并音视频文件

油猴脚本

// ==UserScript==
// @name         Unlimited_downloader
// @name:zh-CN   无限制下载器
// @namespace    ooooooooo.io
// @version      0.1.9
// @description  Get video and audio binary streams directly, breaking all download limitations. (As long as you can play, then you can download!)
// @description:cmd      ffmpeg -i videoA.mp4 -i videoB.mp4 -map 0:v -map 1:a -c:v copy -c:a copy videoC.mp4
// @description:control  document.querySelector('video').playbackRate = 16
// @description:url      https://greasyfork.org/zh-CN/scripts/445751-unlimited-downloader
// @description:ffmpeg   https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
// @description:zh-Cn  直接获取视频和音频二进制流,打破所有下载限制。(只要你可以播放,你就可以下载!)
// @author       dabaisuv
// @match        *://*/*
// @exclude      https://mail.qq.com/*
// @exclude      https://wx.mail.qq.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';
    console.log(`Unlimited_downloader: begin......${location.href}`);


    //Setting it to 1 will automatically download the video after it finishes playing.
    window.autoDownload = 1;


    window.isComplete = 0;
    window.audio = [];
    window.video = [];
    window.downloadAll = 0;
    window.quickPlay = 1.0;

    const _endOfStream = window.MediaSource.prototype.endOfStream
    window.MediaSource.prototype.endOfStream = function () {
        window.isComplete = 1;
        return _endOfStream.apply(this, arguments)
    }
    window.MediaSource.prototype.endOfStream.toString = function() {
        console.log('endOfStream hook is detecting!');
        return _endOfStream.toString();
    }

    const _addSourceBuffer = window.MediaSource.prototype.addSourceBuffer
    window.MediaSource.prototype.addSourceBuffer = function (mime) {
        console.log("MediaSource.addSourceBuffer ", mime)
        if (mime.toString().indexOf('audio') !== -1) {
            window.audio = [];
            console.log('audio array cleared.');
        } else if (mime.toString().indexOf('video') !== -1) {
            window.video = [];
            console.log('video array cleared.');
        }
        let sourceBuffer = _addSourceBuffer.call(this, mime)
        const _append = sourceBuffer.appendBuffer
        sourceBuffer.appendBuffer = function (buffer) {
            console.log(mime, buffer);
            if (mime.toString().indexOf('audio') !== -1) {
                window.audio.push(buffer);
            } else if (mime.toString().indexOf('video') !== -1) {
                window.video.push(buffer)
            }
            _append.call(this, buffer)
        }

        sourceBuffer.appendBuffer.toString = function () {
            console.log('appendSourceBuffer hook is detecting!');
            return _append.toString();
        }
        return sourceBuffer
    }

    window.MediaSource.prototype.addSourceBuffer.toString = function () {
        console.log('addSourceBuffer hook is detecting!');
        return _addSourceBuffer.toString();
    }

    function download() {
        let a = document.createElement('a');
        a.href = window.URL.createObjectURL(new Blob(window.audio));
        a.download = 'audio_' + document.title + '.mp4';
        a.click();
        a.href = window.URL.createObjectURL(new Blob(window.video));
        a.download = 'video_' + document.title + '.mp4';
        a.click();
        window.downloadAll = 0;
        window.isComplete = 0;


        // window.open(window.URL.createObjectURL(new Blob(window.audio)));
        // window.open(window.URL.createObjectURL(new Blob(window.video)));
        // window.downloadAll = 0

        // GM_download(window.URL.createObjectURL(new Blob(window.audio)));
        // GM_download(window.URL.createObjectURL(new Blob(window.video)));
        // window.isComplete = 0;

        // const { createFFmpeg } = FFmpeg;
        // const ffmpeg = createFFmpeg({ log: true });
        // (async () => {
        //     const { audioName } = new File([new Blob(window.audio)], 'audio');
        //     const { videoName } = new File([new Blob(window.video)], 'video')
        //     await ffmpeg.load();
        //     //ffmpeg -i audioLess.mp4 -i sampleAudio.mp3 -c copy output.mp4
        //     await ffmpeg.run('-i', audioName, '-i', videoName, '-c', 'copy', 'output.mp4');
        //     const data = ffmpeg.FS('readFile', 'output.mp4');
        //     let a = document.createElement('a');
        //     let blobUrl = new Blob([data.buffer], { type: 'video/mp4' })
        //     console.log(blobUrl);
        //     a.href = URL.createObjectURL(blobUrl);
        //     a.download = 'output.mp4';
        //     a.click();
        // })()
        // window.downloadAll = 0;
    }

    setInterval(() => {
        if (window.downloadAll === 1) {
            download();
        }
    }, 2000);

    //    setInterval(() => {
    //        if(window.quickPlay !==1.0){
    //              document.querySelector('video').playbackRate = window.quickPlay;
    // }
    //
    //   }, 2000);

    if (window.autoDownload === 1) {
        let autoDownInterval = setInterval(() => {
            //document.querySelector('video').playbackRate = 16.0;
            if (window.isComplete === 1) {
                download();
            }
        }, 2000);
    }

    (function (that) {
        let removeSandboxInterval = setInterval(() => {
            if (that.document.querySelectorAll('iframe')[0] !== undefined) {
                that.document.querySelectorAll('iframe').forEach((v, i, a) => {
                    let ifr = v;
                    // ifr.sandbox.add('allow-popups');
                    ifr.removeAttribute('sandbox');
                    const parentElem = that.document.querySelectorAll('iframe')[i].parentElement;
                    a[i].remove();
                    parentElem.appendChild(ifr);
                });
                clearInterval(removeSandboxInterval);
            }
        }, 1000);
    })(window);




    // Your code here...
})();

bat 文件脚本


@echo off
rem 原文件示例:audio_14应用1.mp4、video_14应用1.mp4
rem 输入文件名,输入"audio_14应用1"或"video_14应用1"
set /p str=请输入合并文件名:

rem 切割字符串文件名,切除前6个字符,请根据需求自定义
set a=%str:~6%
rem 音频输出文件
set audio=audio.aac

rem 生成音频文件
ffmpeg -i "audio_%a%.mp4" -acodec copy %audio%

rem 合成视频文件
ffmpeg -i "video_%a%.mp4" -i %audio% -map 0:v -map 1:a -c:v copy -c:a copy "%a%.mp4"

rem 每次执行完删除生成的音频文件
if exist %audio% (
 del %audio%
)

rem pause

浏览器控制台命令

document.querySelector('video').playbackRate = 16

标签:脚本,document,限制,mp4,window,video,download,audio,下载
From: https://www.cnblogs.com/ninakitty/p/17443209.html

相关文章

  • zabbix监控脚本01-磁盘监控一
    1基础说明(1)配合的监控工具zabbix,被监控端操作系统版本信息操作系统:CentOSLinuxrelease7.4.1708(Core)内核版本:3.10.0-693.el7.x86_64(2)说明:此处的脚本直接使用的是linux下进程文件的数据做计算(3)文件内容说明:/proc/pid/iorchar:读出的总字节数,read或者pread()中的......
  • 微软自动化框架playwright-录制脚本(比较繁琐)
    之前我们已经配置好了playwright的运行环境,也下载好了对应的浏览器和工具。现在就可以使用playwright了。  各种自动化框架都会有脚本录制功能,playwright也不例外。很早之前的badboy工具,发展到每种浏览器都有对应的录制插件。今天我们就来看下微软自动化框架playwright是如何......
  • Linux(Ubuntu)下设置开机自启shell脚本执行Java程序jar包
    Linux(Ubuntu)下设置开机自启shell脚本执行Java程序jar包 原创软件测试日常记录2023-01-1907:19:29博主文章分类:ubuntu©著作权文章标签ubuntujarlinuxJAVAjava文章分类运维阅读数122 经常需要在Linux服务器上设置开机启动jar包,首先编写一个启动jar包的脚本,这里以/......
  • 非常不错的springboot启动shell脚本
    #!/bin/bashJAVA_OPTIONS_INITIAL=-Xms256MJAVA_OPTIONS_MAX=-Xmx256M_JAR_KEYWORDS=/wls/appsystem/ruoyi/apps/ruoyi-admin.jarAPP_NAME=ruoyi-adminAPPLICATION_FILE=/wls/appsystem/ruoyi/config/application.propertiesAPPLICATION_YAML_FILE=/wls/appsystem/ruoyi......
  • 通用巡检脚本
    #CPU、内存、硬盘部分,部分awk取值需要根据实际情况修改#进程需要选择要关注的进程#数据库部分,如无巡检备机状态需要,可修改为mysql-u-p-h[备机ip]来远程检查#会在指定位置生成一个当日的.log文件,内部有命令执行的结果部分1#!/bin/bash23./etc/init.d/functions4......
  • 设置浏览器下载apk后默认不安装
    1.浏览器消息处理:修改文档:vendor/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/DownloadHandler.java 2.RULutil过滤信息 修改文档:frameworks/base/core/java/android/webkit/URLUtil.java ......
  • Java实现打包压缩文件或文件夹生成zip以实现多文件批量下载
    有时候在系统中需要一次性下载多个文件,但逐个下载文件比较麻烦。这时候,最好的解决办法是将所有文件打包成一个压缩文件,然后下载这个压缩文件,这样就可以一次性获取所有所需的文件了。下面是一个名为CompressUtil的工具类的代码,它提供了一些方法来处理文件压缩和下载操作:importor......
  • 苹果公司限制员工使用AI工具ChatGPT
    ​      导读:苹果公司最近发布了一份内部备忘录,禁止员工使用生成式AI平台(包括ChatGPT和GitHub的Copilot等)用于工作任务。 本文字数:600,阅读时长大约:2分钟 苹果公司最近发布了一份内部备忘录,禁止员工使用生成式AI平台(包括ChatGPT和GitHub的Copilot等)用于工作任务。这......
  • gitlab--不同的 stage 不重新下载代码、GIT_CHECKOUT、制品 artifacts
    介绍在gitlabci中,不同的stage都会重新下载代码,例如下面的.gitlab-ci.ymldefault:image:ruby:2.7.5stages:#运行的阶段顺序-build-test-deploybuild:#job的名称stage:build#阶段的名称script:-ls-l-echo123>test1.txt#......
  • Shell脚本开发项目
    一、日志文件的备份和还原shell脚本:客户机:1、通过修改配置文件,来实现发送日志到远程服务器 vim/etc/rsyslog.conf*.*@@remote…前面的*服务名称(日志文件)后面的*代表等级@@TCP协议发送写入登录日志的服务 authpriv.*@@192.168.134.130:514(远程服务器的ip和端口)2.临时关闭防火......