Przeróbka nowego YouTube

Podnosi pasek akcji na pasek przycisku subskrypcji, stale wyświetla ilość subskrypcji a do daty dodaje pełną nazwą miesiąca.

目前为 2014-08-30 提交的版本。查看 最新版本

// ==UserScript==
// @name           Przeróbka nowego YouTube
// @description    Podnosi pasek akcji na pasek przycisku subskrypcji, stale wyświetla ilość subskrypcji a do daty dodaje pełną nazwą miesiąca.
// @version        5.03.087
// @author         look997
// @license        MIT License
// @resource       metadata https://gist.github.com/look997/84f1d2c522178f70bdff/raw/228c830c801384f2382e68937b06b03c08bbe50c/pnyt.user.js
// @include        *youtube.com/*
// @date           2014-03-03
// @grant		   none
// @namespace https://gf.qytechs.cn/users/4353
// ==/UserScript==


var yt = yt;
var yt = yt || {};
yt.playerConfig = {"player_wide": 1};
document.cookie = "wide=1; domain=.youtube.com";
function $(a) {return document.getElementById(a);}
$("watch7-container").className = "watch-wide";
var $ = function(selector,context){return(context||document).querySelector(selector)};


function glFun () { // GŁÓWNA FUNKCJA
	
	var $ = function(selector,context){return(context||document).querySelector(selector)};
	
 // ciasteczko wide wielkość odtwarzacza
	//if(readCookie("wide") != "1") document.cookie="wide=1; path=/; domain=.youtube.com";
	
	if (readCookie("VISITOR_INFO1_LIVE") != "LlWIQlLwL_Y") {
		document.cookie="VISITOR_INFO1_LIVE=LlWIQlLwL_Y; path=/; domain=.youtube.com";
		window.location.reload();
	}
	
	dodajStyl('dataDodSId',''
		//+"#watch8-action-buttons,"
		+"#watch8-secondary-actions .yt-uix-button-content,"
		+"#watch7-subscription-container .yt-uix-button-content { display: none; }"
		
		 //
		+"#watch8-secondary-actions { position: relative; }"
		+"#watch7-views-info { top: -8px !important; bottom: auto !important; right: 0px !important; }"
		+"#watch7-user-header { padding-bottom: 3px !important; }"
		+"#watch8-action-buttons { display: inline; padding-top: 0px; border-top: none; }"
		+"#watch8-action-buttons:after,"
		+"#watch8-action-buttons:before { content: none !important; }"
		
		 // Stałe wyświetlanie liczby subskrybcji kanału autora filmu
		+".yt-subscription-button-subscriber-count-branded-horizontal, .html5-text-button, .yt-subscription-button-subscriber-count-unbranded { display: inline-block !important; }"
		
	);
	
	//document.querySelector("#watch7-user-header").appendChild(document.querySelector("#watch8-secondary-actions"));
	document.querySelector("#watch7-user-header").appendChild(document.querySelector("#watch8-action-buttons"));
	
	document.querySelector("#watch7-user-header").appendChild(document.querySelector("#watch8-sentiment-actions"));
	
	document.querySelector("#watch7-user-header").appendChild(document.querySelector("#watch7-views-info"));
	
	
	
 // Pełna nazwa miesiąca dodania filmu
	var infoDate = $("#watch-uploader-info strong");
	var datfilm = infoDate.textContent;
	var odatmies = datfilm.substring(datfilm.length-8, datfilm.length-5);
	switch (odatmies){
		case 'sty':	datmies = "stycznia"; break;
		case 'lut':	datmies = "lutego"; break;
		case 'mar':	datmies = "marca"; break;
		case 'kwi':	datmies = "kwietnia"; break;
		case 'maj':	datmies = "maja"; break;
		case 'cze':	datmies = "czerwca"; break;
		case 'lip':	datmies = "lipca"; break;
		case 'sie':	datmies = "sierpnia"; break;
		case 'wrz':	datmies = "września"; break;
		case 'paź':	datmies = "października"; break;
		case 'lis':	datmies = "listopada"; break;
		case 'gru':	datmies = "grudnia"; break;
		default: datmies = datmies+" (Błąd Skryptu PNYT)";
	}
	infoDate.textContent = datfilm.replace(odatmies, datmies);
}


function dodajStyl (idStyle,styles) { // Dodanie stylu
        if(document.getElementById(idStyle)){ document.getElementsByTagName("head")[0].removeChild(document.getElementById(idStyle)); }
        var css = document.createElement('style'); css.type = 'text/css'; css.id = idStyle;
        css.styleSheet ? css.styleSheet.cssText = styles : css.appendChild( document.createTextNode(styles) );
        document.getElementsByTagName("head")[0].appendChild(css);
}


function readCookie (name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

document.addEventListener("DOMContentLoaded", glFun);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址