// ==UserScript==
// @name YouTube Multi Downloader v4.0 (MP3, FHD, AVI, MP4, FLV, M4V, WKV, ACC, WOV, OGG, etc)
// @description This script helps to add a download button. Saveclipbro.com features the fastest ways to download YouTube videos and audios, ensuring quality. Supported Services: YouTube, Dailymotion, Vimeo, Twitter, Vine, Facebook, Instagram, Xvideos, CNN, SoundCloud, Redtube, Freesound, Pornhub, Reddit, Liveleak and more! You will like!
// @namespace https://greasyfork.org/users/152924
// @homepageURL https://greasyfork.org/scripts/34613
// @supportURL https://greasyfork.org/scripts/34613/feedback
// @author Punisher
// @version 4.0
// @date 2018-11-30
// @compatible chrome
// @compatible firefox
// @compatible opera
// @compatible safari
// @license CC BY-NC-ND 4.0 International. https://creativecommons.org/licenses/by-nc-nd/4.0/
// @match *://*.youtube.com/*
// @downloadURL none
// ==/UserScript==
(function() {
if (document.getElementById("polymer-app") || document.getElementById("masthead") || window.Polymer) {
setInterval(function() {
if (window.location.href.indexOf("watch?v=") < 0) {
return false;
}
if (document.getElementById("meta-contents") && document.getElementById("punisher") === null) {
Addytpolymer();
}
}, 100);
} else {
setInterval(function() {
if (window.location.href.indexOf("watch?v=") < 0) {
return false;
}
if (document.getElementById("watch8-sentiment-actions") && document.getElementById("punisher") === null) {
AddhtmlDV();
}
}, 100);
}
function AddhtmlDV() {
if (document.getElementById("watch8-sentiment-actions")) {
var wrap = document.getElementById('watch8-sentiment-actions');
var button = "
";
var style = "";
var tmp = wrap.innerHTML;
wrap.innerHTML = tmp + button + style;
}
}
function Addytpolymer() {
var buttonDiv = document.createElement("span");
buttonDiv.style.width = "170%";
buttonDiv.id = "punisher";
var addButton = document.createElement("a");
addButton.appendChild(document.createTextNode("DOWNLOAD"));
addButton.style.width = "170px";
addButton.style.position = "relative";
addButton.style.letterSpacing = "0.007px";
addButton.style.boxSizing = "border-box";
addButton.style.minWidth = "5.14em";
addButton.style.height = "inherit";
addButton.style.backgroundColor = "#3a3a3a";
addButton.style.color = "#ffffff";
addButton.style.cursor = "pointer";
addButton.style.padding = "10px 16px";
addButton.style.marginTop = "5px";
addButton.style.margin = "0px 3px";
addButton.style.border = "0";
addButton.style.borderRadius = "2px";
addButton.style.fontFamily = "inherit";
addButton.style.fontStyle = "inherit";
addButton.style.fontSize = "1.4rem";
addButton.style.textAlign = "center";
addButton.style.textTransform = "uppercase";
addButton.style.textDecoration = "none";
addButton.href = "https://www.saveclipbro.com/convert?main_search%5BlinkToDownload%5D=" + encodeURIComponent(document.URL) + '&main_search%5Bsubmit%5D=';
addButton.target = "_blank";
buttonDiv.appendChild(addButton);
if (document.getElementById("meta-contents")){
if(document.getElementById('meta-contents').querySelector('#top-row ytd-video-owner-renderer.ytd-video-secondary-info-renderer #sponsor-button ytd-button-renderer paper-button')){
var targetElement = document.querySelectorAll("[id='count']");
for (var i = 0; i < targetElement.length; i++) {
if (targetElement[i].className.indexOf("ytd-video-primary-info-renderer") > -1) {
targetElement[i].appendChild(buttonDiv);
}
}
}
else{
var wrap = document.getElementById('meta-contents').querySelector('#top-row ytd-video-owner-renderer.ytd-video-secondary-info-renderer #sponsor-button');
wrap.appendChild(buttonDiv);
}
}
}
})();