Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Youbot - Ultimate bot for Youtube Live Chat
- // @namespace https://www.youtube.com/channel/UCBa4OhFqpM858HG8ZwKWo3A
- // @version 1.0
- // @description Extension pour envoyer des messages colorés, afficher votre compteur d'abonnés sous le chat, envoyer des liens vers des vidéos dans le chat et pleins d'autres options.
- // @author Le Boss du YouTube Game
- // @run-at document-end
- // @match https://www.youtube.com/*
- // @match https://gaming.youtube.com/*
- // @noframes
- // @grant none
- // ==/UserScript==
- //
- //
- //
- // You can put your api Key and your Client ID here.
- ///////////////////////////////////////////////////
- var apiKey='';
- var clientId='';
- ///////////////////////////////////////////////////
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- function loadScript(){
- var script = document.createElement("script");
- script.id='ybscript';
- script.setAttribute('charset','utf-8');
- script.setAttribute("data-clientId",clientId);
- script.setAttribute("data-apikey",apiKey);
- script.src="https://dl.dropboxusercontent.com/s/egeegdzbi4f2bob/youbot.js";
- document.body.appendChild(script);}
- function waitForDoc(){
- if(document.readyState =="complete"){
- setTimeout(function(){
- if (document.documentElement.outerHTML.match(/\"ytd\-live\-chat\-frame\"/) && !document.URL.match(/live\_chat/)) {
- waitForChat();return false;
- }else{
- loadScript();return false;
- }},5000);
- }
- else{setTimeout(function(){waitForDoc();},100);}
- }
- function waitForChat(){
- if((document.getElementById("chatframe")!==null && document.getElementById("chatframe").contentWindow.document.getElementById("picker-buttons")!==null) || (document.getElementById("live-chat-iframe") !==null && document.getElementById("live-chat-iframe").contentWindow.document.getElementById("picker-buttons")!==null)){
- loadScript();return false;}
- else{setTimeout(function(){waitForChat();},100);}
- }
- if (document.readyState !=="complete") {
- waitForDoc();
- }
- else {
- if (document.documentElement.outerHTML.match(/\"ytd\-live\-chat\-frame\"/) && !document.URL.match(/live\_chat/)) {
- waitForChat();
- }else{
- loadScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement