Greasy Fork

Greasy Fork is available in English.

YouTube Unblocker

Adds menu button to automatically forward any currently blocked YouTube video to youtubeunblocker.org and unblocks the video.

当前为 2015-04-07 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        YouTube Unblocker
// @namespace    YTUB
// @version      1.0
// @description  Adds menu button to automatically forward any currently blocked YouTube video to youtubeunblocker.org and unblocks the video.
// @author       drhouse
// @include      https://www.youtube.com/watch?v=*
// @include      http://www.youtubeunblocker.org/
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// @grant        GM_registerMenuCommand
// @grant        GM_notification
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @icon         https://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico
// @locale       en
// ==/UserScript==
$(document).ready(function () {

    GM_registerMenuCommand("YouTube Unblocker", function(){
        if (location != "http://www.youtubeunblocker.org/"){
            var here = top.location.href;
            var title = document.title;
            GM_deleteValue("ytube");
            GM_deleteValue("ytubetitle");
            GM_setValue("ytube", here);
            GM_setValue("ytubetitle", title);
            window.location.href = 'http://www.youtubeunblocker.org/';
        }
    });

    if (location == "http://www.youtubeunblocker.org/"){
        var target = 'body > div.main_bg > div.container > div:nth-child(12) > div.main_form_container > div > form > p';
        var target1 = target + ' > input.form';
        var target2 = target + ' > input.button';
        var storedObject = GM_getValue("ytube"); 
        var storedObjectTitle = GM_getValue("ytubetitle");
        var msg = new SpeechSynthesisUtterance('Now unblocking ' + storedObjectTitle);
        speechSynthesis.getVoices().forEach(function(voice) {
            console.log(voice.name, voice.default ? '(default)' :'');
        });
        window.speechSynthesis.speak(msg);
        $(target1).val(storedObject);
        GM_notification(storedObjectTitle, "Unblocking", null, function() {/* */});
        $(target2).click();
    }
});