您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Lets you download reddit videos with sound using RedditSave
// ==UserScript== // @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, edited by Soadar, enhanced by Grok // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js // @match https://www.reddit.com/* // @match https://*.reddit.com/* // @exclude https://www.reddit.com/message/compose/* // @grant none // @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=' + encodeURIComponent(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) return; // Skip if 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=' + encodeURIComponent(dlUrl); window.open(urlCompleta, "_blank"); }); } } }); } })();