🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Reddit Video Downloader (with sound) [RedditSave]

Lets you download reddit videos with sound using RedditSave

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// fuente / autor 1N07
// Solo edite la url de descarga, ya que viddit y ripsave no me funcionan
// @edit: 		 Soadar
// @name         Reddit Video Downloader (with sound) [RedditSave]
// @namespace    1N07
// @version      0.5.4
// @description  Lets you download reddit videos with sound using RedditSave
// @author       1N07
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @match        https://www.reddit.com/*
// @exclude      https://www.reddit.com/message/compose/*
// @grant       GM_registerMenuCommand
// @grant       GM_unregisterMenuCommand
// @grant       GM_getValue
// @grant       GM_setValue
// @noframes
// ==/UserScript==

(function() {
    'use strict';

    $(function(){
        AddButtons();
        setInterval(AddButtons, 200);
    });

    function AddButtons() {
        //=== post page ===//
        if(window.location.href.includes("/comments/"))
        {
            let vid = $("div[data-test-id='post-content'] video");
            if(vid.length > 0 && !vid.find("source").prop("src").includes("external-preview.redd.it"))
            {
                let bar = $("div[data-test-id=post-content] > div:last");
                if(bar.length > 0 && bar.find(".downloadVid").length == 0) {
                    let saveButt = bar.find("button .icon-save").parent().parent();
                    saveButt.prop("style", "float: left;");
                    saveButt.after(`<div class="outerForDLB"></div>`);
                    bar.find(".outerForDLB").append(saveButt.clone().addClass("downloadVid"));
                    let dlButt = bar.find(".downloadVid");
                    dlButt.find("i.icon").removeClass("icon-save").addClass("icon-downvote");
                    dlButt.find("span:last").html('Download');
                    bar.find(".outerForDLB").prop("style", "float: right;");
                    //console.log("dlb: " + dlButt.length);

                    dlButt.click(function(e){
                        e.preventDefault();
                        let dlUrl = window.location.href.split("#")[0].split("?")[0];
						let urlCompleta = 'https://redditsave.com/info?url=' + dlUrl;
                        window.open(urlCompleta, "_blank");
                    });
                }
            }
        }

        //=== browse page ===//
        let targets = $("div.scrollerItem div > video");
        targets.each(function(){
            if($(this).find("source").length > 0 && !$(this).find("source").prop("src").includes("external-preview.redd.it"))
            {
                let bar = $(this).parent().parent().parent().parent().nextAll("div:last");
                if(bar.find(".icon-save").length == 0)
                    bar = bar.prev().parent().parent().nextAll("div:last");
                if(bar.find(".downloadVid").length == 0)
                {
                    let saveButt = bar.find("button .icon-save").parent().parent();
                    if(saveButt == null) alert("saveButt null!");
                    saveButt.prop("style", "float: left;");
                    saveButt.after(`<div class="outerForDLB"></div>`);
                    bar.find(".outerForDLB").append(saveButt.clone().addClass("downloadVid"));
                    let dlButt = bar.find(".downloadVid");
                    dlButt.find("i.icon").removeClass("icon-save").addClass("icon-downvote");
                    dlButt.find("span:last").html('Download');
                    bar.find(".outerForDLB").prop("style", "float: right;");

                    dlButt.click(function(e){
                        e.preventDefault();
                        let dlUrl = $(this).closest('div[data-click-id="background"]').find("a[data-click-id=body]:first").prop("href").split("#")[0].split("?")[0];
                        let urlCompleta = 'https://redditsave.com/info?url=' + dlUrl;
                        window.open(urlCompleta, "_blank");
                    });
                }
            }
        });
    }
})();