NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Download from www.redgifs.com // @namespace Violentmonkey Scripts // @match https://www.redgifs.com/* // @grant none // @version 1.01 // @author ape-that-presses-keys // @license MIT // @description Adds a download button to each video. // @downloadURL https://openuserjs.org/install/ape-that-presses-keys/Download_from_www.redgifs.com.user.js // @updateURL https://openuserjs.org/meta/ape-that-presses-keys/Download_from_www.redgifs.com.meta.js // ==/UserScript== function dl() { let i = document.querySelector("img.Player-Poster").src; let u = i.substring(0, i.length - 11); if (document.querySelector("video").src.substring(0, 4) == "blob") { u = u + ".m4s"; } else { u = u + ".mp4"; } window.open(u, "_blank"); } let dl_button = document.createElement("button"); dl_button.id = "redgifs_dl_button"; dl_button.onclick = dl; dl_button.innerText = "DL"; let append_dl_button_interval = setInterval(() => { let parent_element = document.querySelector(".GifPreview-SideBarWrap"); let dl_button_exists = document.querySelector("#redgifs_dl_button"); // add dl button if the DOM nodes we use currently exist and it's not already added if (parent_element && !dl_button_exists) { document.querySelector(".GifPreview-SideBarWrap").appendChild(dl_button); } }, 500);