[youtube_to_invidious.user.js fix namespace and added statuscheck

This commit is contained in:
Jesús 2019-10-11 17:59:21 -05:00
parent 4d0e283195
commit 24c7c7231a
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -1,8 +1,9 @@
// ==UserScript== // ==UserScript==
// @name YouTube to Invidious // @name YouTube to Invidious
// @author OdinBrood, Jesús E. // @author OdinBrood, Jesús E.
// @namespace Krul & Brood // @namespace InvidiousRedirect
// @description Scan page for Youtube embeds and urls and replace with Invidious. // @description Scan page for Youtube embeds and urls and replace with Invidious.
// @homepageURL https://libregit.org/heckyel/book/src/branch/master/scripts-greasemonkey
// @include * // @include *
// @exclude /^http(s|)://(www[.]|)invidio[.]us/.*$/ // @exclude /^http(s|)://(www[.]|)invidio[.]us/.*$/
// @exclude /^http(s|)://(www[.]|)invidious[.]snopyta[.]org/.*$/ // @exclude /^http(s|)://(www[.]|)invidious[.]snopyta[.]org/.*$/
@ -18,9 +19,13 @@
// ==/UserScript== // ==/UserScript==
/* jshint esversion: 6 */ /* jshint esversion: 6 */
var instance='proxy.invidious.snopyta.org'; //set you favorite Invidious instance! (https://github.com/omarroth/invidious/wiki/Invidious-Instances) // set you favorite Invidious instance! (https://github.com/omarroth/invidious/wiki/Invidious-Instances)
var instance = 'proxy.invidious.snopyta.org';
//change script options, default values recommended // Console Style - Debug
var consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;';
// change script options, default values recommended
var a=1; //set to 0 to force autoplay off, set to 1 to keep embed's value [default 1] var a=1; //set to 0 to force autoplay off, set to 1 to keep embed's value [default 1]
var b=1; //set to 0 to not replace all youtube links to Invidious [default 1] var b=1; //set to 0 to not replace all youtube links to Invidious [default 1]
var c=1; //set to 0 to disable DASH playback (beta feature) [default 1] var c=1; //set to 0 to disable DASH playback (beta feature) [default 1]
@ -40,6 +45,7 @@ if(current){
if(frames.length>0)embed(); if(frames.length>0)embed();
if(thumbs.length>0)thumb(); if(thumbs.length>0)thumb();
if(links.length>0)link(); if(links.length>0)link();
statuscheck();
}else{ }else{
var title=Array.prototype.slice.call(document.getElementsByTagName('h1')); var title=Array.prototype.slice.call(document.getElementsByTagName('h1'));
addbtn(); addbtn();
@ -168,3 +174,8 @@ function ytel(el){
function ythref(el){ function ythref(el){
return(decodeURIComponent(el.href).match(ytdomains)); return(decodeURIComponent(el.href).match(ytdomains));
} }
function statuscheck(){
// Console Feedback
console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS);
}