YouTube Unblocker

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

ของเมื่อวันที่ 28-11-2015 ดู เวอร์ชันล่าสุด

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        YouTube Unblocker
// @namespace    YTUB
// @version      2.1
// @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/*
// @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 () {

    $("a").removeClass("spf-link").not("#watch-appbar-playlist");

    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);
        msg.lang = 'en-US';
        window.speechSynthesis.speak(msg);
        $(target1).val(storedObject);
        GM_notification(storedObjectTitle, "Unblocking");
        $(target2).click();
    }
});