Greasy Fork

Greasy Fork is available in English.

YouTube Downloader

Download Audio and Video from Youtube

当前为 2017-11-27 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         YouTube Downloader
// @namespace    http://tampermonkey.net/
// @copyright    Wígny Almeida | wigny.github.io
// @version      2.1
// @description  Download Audio and Video from Youtube
// @author       Wígny Almeida
// @match        https://www.youtube.com/*
// @include      http*://*.youtube.com/*
// @include      http*://youtube.com/*
// @include      http*://*.youtu.be/*
// @include      http*://youtu.be/*
// @require      https://code.jquery.com/jquery-3.2.1.min.js
// @icon         https://www.youtube.com/yts/img/favicon-vfl8qSV2F.ico




// ==/UserScript==

(function() {
    'use strict';
    // Your code here..
    $(document).ready(function(){
        $('head').append('<link rel="stylesheet" type="text/css" media="all" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">');

        //Acesse https://wigny.github.io

        //Add clickable icon
        function add_btn_url_atual(){
            var parent = document.querySelector('#top-row');
            var url = window.location.href;
            var html = '<div class="btn_mp3"><a style="background-color: #ff0000; border: solid 2px #ff0000; border-radius: 2px; color: white; padding: 0px 15px; font-size: 14px; cursor:pointer; height:33px;margin-right: 4px;margin-top: 7px;line-height: 33px;font-weight: 500; display:inline-block; text-decoration: none;" title="By Wígny Almeida" class="link_mp3" target="_blank" href="http://savetomp3.com/#search='+url+'">DOWNLOAD <span style="color:#ffcccc;">MP3</span></a></div>'+
                       '<div class="btn_mp4"><a style="background-color: #ff0000; border: solid 2px #ff0000; border-radius: 2px; color: white; padding: 0px 15px; font-size: 14px; cursor:pointer; height:33px;margin-right: 4px;margin-top: 7px;line-height: 33px;font-weight: 500; display:inline-block; text-decoration: none;" title="By Wígny Almeida" class="link_mp4" target="_blank" href="https://pt.savefrom.net/#url='+url+'">DOWNLOAD <span style="color:#ffcccc;">MP4</span></a></div>';
            parent.insertAdjacentHTML('beforeend', html);
        }
        setTimeout(function(){
            add_btn_url_atual();
        },1000);

        //By Wígny Almeida

        //Altera o href conforme cliques
        $(document).on('click',function(){
            console.log('clicou');
            $('.link_mp3').attr('href','http://savetomp3.com/#search='+window.location.href+'');
            $('.link_mp4').attr('href','https://savefrom.net/#url='+window.location.href+'');
        }).trigger();
    });
})();