Youtube Deleted Video Finder

Automatically copy the video ID if a video is unavailable/private and search it in google

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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 Deleted Video Finder
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically copy the video ID if a video is unavailable/private and search it in google
// @author       WujekTadek
// @match        https://www.youtube.com/*
// @match        https://m.youtube.com/*
// @match        https://music.youtube.com/*
// @grant        none
// @license      GNU GPL
// ==/UserScript==



(function() {
    //alert(document.title); //debug
    if(document.title === "- YouTube"){
        var video_id = window.location.search.split('v=')[1];
        var ampersandPosition = video_id.indexOf('&');
        if(ampersandPosition != -1) {
            video_id = video_id.substring(0, ampersandPosition);
        }
        //alert(video_id);
        window.open("https://www.google.com/search?q="+video_id+"&oq=yaEVYn_ze6g&aqs=chrome..69i57j69i60l2.270j0j7&sourceid=chrome&ie=UTF-8","_self");

    };
})();