Youtube true 720p player

Allows you to watch youtube videos in not distorted (scaled) 720p resolution. Click on the title of the video to redirect you.

目前為 2015-12-05 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Youtube true 720p player
// @description Allows you to watch youtube videos in not distorted (scaled) 720p resolution. Click on the title of the video to redirect you.
// @author Jan harvalík [email protected]
// @version 1.5
// @date 2015-12-05
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @include http://www.youtube.com/*
// @include https://www.youtube.com/*
// @include http://www.youtube.com/user/*
// @include https://www.youtube.com/user/*
// @exclude http://www.youtube.com/embed/*
// @exclude https://www.youtube.com/embed/*
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @run-at document-end
// @license     MIT License
// @namespace https://greasyfork.org/users/12627
// ==/UserScript==
var script = document.createElement('script');
script.src = "https://code.jquery.com/jquery-2.1.4.min.js";
document.getElementsByTagName('head')[0].appendChild(script);


var lastLocation ="";
window.setInterval(function(){
	if(lastLocation != $(location).attr('href')){
		if($('#progress').length === 0){	// progress bar exists => page is being loaded -> do nothing
		 	lastLocation=$(location).attr('href');
		    
		    
		    $( document ).ready(function() { // might be useless
		    	// for youtube.com/ and youtube.com/feed/subscriptions
				$(".yt-lockup-thumbnail a").each(function( index ) {				

					$(this).attr("href",
						$(this).get(0).href.replace('https://www.youtube.com/watch?v=', 'http://www.googledrive.com/host/0B-gs6HL8vtTZeXd3bHhqZmIwWjg/?v=')
					);

					$(this).attr('target','_blank');
					

					// adds text bellow thumbnails
					$(this).parent().after("<h5 style=\"color:red;\">&#9650; Watch in true 720p player</h5>"); // arrow up

				});

				// for youtube.com/watch
				$("#eow-title").before("&#9658;"); // arrow right
				$("#eow-title").parent().css("color", "red");
				$("#eow-title ").css("cursor","pointer");

				var v=$(location).attr("href").split('v=')[1]
				$("#eow-title").on( "click", function() {

					// Pause the video if playing
			        if($('.ytp-play-button').attr("aria-label") == "Pause"){
						$('.ytp-play-button').click();
			        }

					window.open("http://www.googledrive.com/host/0B-gs6HL8vtTZeXd3bHhqZmIwWjg/?v="+v,"_blank");
				});
			});	
		}	
	}
	
    
}, 100);