Greasy Fork

Greasy Fork is available in English.

youtube2mp3

Convert to mp3 from Youtube clip

当前为 2014-09-13 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name          youtube2mp3
// @namespace     youtube2mp3
// @version       0.84
// @description   Convert to mp3 from Youtube clip
// @match         http*://www.youtube.com/*
// @match         http://www.video2mp3.net/*
// @require       http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require	  http://greasyfork.icu/scripts/1930-simulate-click/code/Simulate_click.js?version=5025
// @require	  http://greasyfork.icu/scripts/386-waituntilexists/code/waitUntilExists.js?version=5026
// @copyright     2014+, Magnus Fohlström.
// ==/UserScript==

//youtube2mp3 auto closes when download starts
$('#social-like, #social-share, #vine-plug').waitUntilExists(function(){ 
    setInterval(function(){ 
        self.close(); 
    }, 1000 );  });  

//AutoClick on convert this youtube link and auto click when file is ready to download.
$('#do-download-video').waitUntilExists(function(){   
    $(this).simulate('click'); });

function youtube2mp3() {
    
    if( $('#youtube2mp3').size() == 0 ) 
    {        
        var youtube2mp3path_hq ='http://www.video2mp3.net/?url='+encodeURIComponent(document.URL)+"&hq=1";
        
        $(  '<a id="youtube2mp3" class="yt-uix-button yt-uix-button-default" href="" target="_blank" data-link="'+youtube2mp3path_hq+'" style="margin-left: 8px; height: 26px; border-radius: 10px; padding: 0 22px;">' +
          	'<span class="yt-uix-button-content" style="line-height: 25px; font-variant: small-caps; font-size: 12px; color: rgb(139, 106, 23);">MP3 HQ Download</span></a>'  )
          .insertAfter( "#watch7-subscription-container" );       
    }
    
    $('#youtube2mp3').on('mousedown',function(e) {     
        var url = $(this).attr('data-link');
        if ( e.which != 3 ){
            if( e.which == 1 || e.which == 2 ){ 
                window.open( url , '_blank' );
                e.preventDefault();
                return false;
            }
        }
    }); 
}

$(document).ready(function(){ 
    
    var youtube2mp3timerId = setInterval(function() {
        youtube2mp3();
    }, 2500);
    
});