Greasy Fork is available in English.

YouTube Multi Downloader (Lite) v1.0 - Offmp3.app (MP3, MP4, M4A & WebM)

Alternative to: YouTube Multi Downloader. This script helps to add a download button. Presents the fastest ways to transfer and ensure quality. Supported Services: YouTube, SoundCloud, Mixcloud, Facebook, Bandcamp, Twitter, Dailymotion, Vimeo, Instagram and ReverbNation.

04.08.2019 itibariyledir. En son verisyonu görün.

// ==UserScript==
// @name YouTube Multi Downloader (Lite) v1.0 - Offmp3.app (MP3, MP4, M4A & WebM)
// @description Alternative to: YouTube Multi Downloader. This script helps to add a download button. Presents the fastest ways to transfer and ensure quality. Supported Services: YouTube, SoundCloud, Mixcloud, Facebook, Bandcamp, Twitter, Dailymotion, Vimeo, Instagram and ReverbNation.
// @namespace https://greasyfork.org/users/152924
// @homepageURL https://greasyfork.org/scripts/376246
// @supportURL https://greasyfork.org/scripts/376246/feedback
// @author Punisher
// @version 1.0
// @date 2019-08-04
// @icon https://i.imgur.com/xLl6DWY.png
// @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/*
// ==/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);
      
    setElement = function(url) {
       var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
       var match = String(url).match(regExp);
       return (match&&match[7].length==11)? match[7]: false;
    };

} 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);
  
    setElement = function(url) {
       var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
       var match = String(url).match(regExp);
       return (match&&match[7].length==11)? match[7]: false;
    };
}

function AddhtmlDV() {
    if (document.getElementById("watch8-sentiment-actions")) {
        var wrap = document.getElementById('watch8-sentiment-actions');
        var button = "<div id='punisher' style='display: inline-block; margin-left: 10px; vertical-align: middle;'>";
        button += "<a href=\"//offmp3.app/process?url=" + decodeURIComponent(document.URL) + "\" target=\"_blank\"" + "style=\"display: inline-block; font-size: inherit; height: inherit; border: 1px solid rgb(226, 226, 226); border-radius: 3px; padding-left: 28px; cursor: pointer; vertical-align: middle; position: relative; line-height: 22px; text-decoration: none; z-index: 1; color: rgb(226, 226, 226);\">";
        button += "<i style=\"position: absolute; display: inline-block; left: 6px; top: 3px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACLklEQVR42mNgAIKz8fFpR5KSeEHsSZ6e7CD6dExM8KmICCtkMawApHF7f//3PY2Nz09HRBiCxEJDQ5n3V1ff2Tphwo9ziYmZeA3ZGRvLfTYqyvhsUlLprvb2d6fj45NB4gcrKq6dS0oq2ldX9+hEVtZikNjMtDTW////M+J0zamoKJddbW3vzqSkNB0qLT17NjbWF2Qz0DV3jxQVHYGpA7kQrglk4qGgIEmYE4+Fhkrvq6m5D9K0KjSUE2Yj0IDDYIOgYQVyDcTWiAjZA1VVN0CmIpt8pLj4+MHy8svITj6VlTV/T3Pzq3MRESbwcDkeEaEA9OdDmGZkg47l5GzY09T0AugqFZghoHDZ1dHx4XRcXBJY4GhQkPyB2tp7KP5CCvVTiYklu9va3p6JinIEeQkc7dHRFkCDX55KS+uBuADoZ1wGnElISAXZeDE21glmwJnISI3dTU2vgAZMxDAA5GdYAIH8vLu19c2Z6GhdmMGnY2Njd3Z0fDwVH18AFkA2AKQZ7v/Cwj0gcVCowwLyVEpKOyitnIuL80QNRKBCmPNgiehAZeV15Og6np29GhSgwLSihBKNoEAEpTZYlIIUnczKWgp0wd5T0dF+4CgtKTm1v6rqNsx1cM3QhKNyqLLyKigVgkIbHDBAAEwbN0EGgOQOFxUdg4UPemAz7AkMFN7R0/MFlIRh+QBkAyjVgTLTqYyMWQTzwbHc3M2nIiPtYZkL7J309KmnU1IaCGVnAGSMRmieJSPHAAAAAElFTkSuQmCC); background-size: 12px; background-repeat: no-repeat; background-position: center center; width: 16px; height: 16px;\"></i>";
        button += "<span style=\"padding-right: 12px;\">Download</span></a></div>";
        var style = "<style>#punisher button: -moz-focus-inner {padding: 0; margin:0} #punisher a {background-color: #4c4c4c} #punisher a:hover {background-color: #4c4c4c} #punisher a:active {background-color: #4c4c4c}</style>";
        var tmp = wrap.innerHTML;
        wrap.innerHTML = tmp + button + style;
    }
}

function Addytpolymer() {
    var buttonDiv = document.createElement("span");
    buttonDiv.id = "punisher";
    buttonDiv.style.width = "100%";
    buttonDiv.style.marginTop = "5px";
    buttonDiv.style.padding = "12px 0";
    var addButton = document.createElement("a");
    addButton.appendChild(document.createTextNode("DOWNLOAD"));
    addButton.style.width = "100%";
    addButton.style.cursor = "pointer";
    addButton.style.height = "inherit";
    addButton.style.backgroundColor = "#003030";
    addButton.style.color = "#ffffff";
    addButton.style.padding = "10px 22px";
    addButton.style.margin = "0px 0px";
    addButton.style.border = "0";
    addButton.style.borderRadius = "2px";
    addButton.style.fontSize = "1.4rem";
    addButton.style.fontFamily = "inherit";    
    addButton.style.textAlign = "center";
    addButton.style.textDecoration = "none";
    addButton.href = "//offmp3.app/process?url=" + decodeURIComponent(document.URL),
    addButton.target = "_blank";
    buttonDiv.appendChild(addButton);
    
    var targetElement = document.querySelectorAll("[id='subscribe-button']");
    if(targetElement){
      for(var i = 0; i < targetElement.length; i++){
        if(targetElement[i].className.indexOf("ytd-video-secondary-info-renderer") > -1){
            targetElement[i].appendChild(buttonDiv);
        }
      }
    }
}
})();