drhouse / YouTube Unblocker

// ==UserScript==
// @name        YouTube Unblocker
// @namespace    YTUB
// @version      1.2
// @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);
        msg.lang = 'en-US';
        window.speechSynthesis.speak(msg);
        $(target1).val(storedObject);
        GM_notification(storedObjectTitle, "Unblocking");
        $(target2).click();
    }
});