您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allows you to download MP3 at 320 kbps from a YouTube video.
// ==UserScript== // @name Mimic - Youtube MP3 Downloader // @version 10.09.2017.r002 // @namespace http://ophite.cz // @author mimic // @description Allows you to download MP3 at 320 kbps from a YouTube video. // @match http*://www.youtube.com/* // @match http*://www.onlinevideoconverter.com/* // @grant none // @require http://code.jquery.com/jquery-latest.js // ==/UserScript== (function() { 'use strict'; var InjectJs = (function () { const _convertUrl = 'https://www.onlinevideoconverter.com/video-converter'; var inject = function() { $(document).ready(function() { onPageLoad(); }); }; var onPageLoad = function() { if (document.body && document.domain == 'www.youtube.com') { setTimeout(insertButtonToYoutube, 1500); } if (document.body && document.domain == 'www.onlinevideoconverter.com') { setTimeout(updateFormAndConvert, 500); } if (window.location.href.indexOf('/success?') > 0) { convertDone(); } }; var updateFormAndConvert = function() { const selectedType = '.mp3'; $('.radiovideo1 .audio-format').each(function() { $(this).removeClass('active'); }); $('.radiovideo1 .video-format').each(function() { $(this).removeClass('active'); }); $('.radiovideo1 .audio-format span:contains(' + selectedType + ')').closest('a').addClass('active'); $('#select_main > span').text(selectedType); $('#advancedoptions').show(); $('#audioBitrate li a').each(function() { $(this).removeClass('active'); }); $('#audioBitrate li a').first().addClass('active'); $('#audioBitrate > span').text('320 kbps'); document.getElementById('convert1').click(); }; var insertButtonToYoutube = function() { let convertUrl = _convertUrl + '?url=' + encodeURIComponent(document.URL); $('h1').parent().append('<h2>[<a id="dmp3" target="_blank" href="' + convertUrl + '" style="color: #fa0; text-decoration: none; font-weight: normal;">Download MP3 (320kbps)</a>]</h2>'); $('#dmp3').on('click', function() { window.open(convertUrl); }); }; var convertDone = function() { let downloadUrl = $('#downloadq').attr('href'); $('body').append('<a id="dmp3link" href="' + downloadUrl + '"></a>'); document.getElementById('dmp3link').click(); setTimeout(window.close, 1000); }; return inject; })(); new InjectJs(); })();