NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Snappea Youtube Converter Button // @name:es Snappea Descargador de videos de youtube // @namespace https://www.snappea.com // @version 3.2.1 // @date 2021-10-20 // @author Aitron // @copyright 2021, Aitronssesin (https://openuserjs.org/users/Aitronssesin) // @license MIT // @updateURL https://openuserjs.org/meta/Aitronssesin/Snappea_Youtube_Converter_Button.meta.js // @description Snappea Downloader: Download Video and Audio for free // @description:es El mejor descargador de videos de youtube usando snappea // @homepage https://www.snappea.com/tutorials // @icon https://img.utdstc.com/icon/7da/097/7da097c58f7080091b1f6cb1338bda5df5b51f2c4784cae78c797ee25784b82f:200 // @icon64 https://img.utdstc.com/icon/7da/097/7da097c58f7080091b1f6cb1338bda5df5b51f2c4784cae78c797ee25784b82f:200 // @include http://*youtube.com* // @include https://*youtube.com* // @run-at document-end // @grant GM_listValues // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_xmlhttpRequest // @grant GM_info // @grant GM_openInTab // @grant GM_setClipboard // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_notification // @grant GM_download // @grant GM.info // @grant GM.listValues // @grant GM.setValue // @grant GM.getValue // @grant GM.deleteValue // @grant GM.openInTab // @grant GM.setClipboard // @grant GM.xmlHttpRequest // @connect youtube.com // @connect m.youtube.com // @connect www.youtube.com // @connect youtube-nocookie.com // @connect youtu.be // @connect https://www.snappea.com // @connect self // @connect * // ==/UserScript== //1c611e dark green //2f9632 light green var AKoiMain = { oXHttpReq: null, vid: null, oldUrl: null, DocOnLoad: function (o) { try { if (null != o && null != o.body && null != o.location && ((AKoiMain.vid = AKoiMain.getVid(o)), AKoiMain.vid)) { o.querySelector("#info-contents #info").setAttribute("style", "flex-wrap: wrap;"); var t = o.querySelector("#menu-container"), e = o.querySelector("#yt1sconverter"), n = AKoiMain.GetCommandButton(); null == e && (null != t ? t.parentNode.insertBefore(n, t) : (t = o.querySelector("#eow-title")).parentNode.insertBefore(n, t)), (AKoiMain.oldUrl = o.location.href), AKoiMain.checkChangeVid(); } return !0; } catch (o) { console.log("Error in function Snappea.DocOnLoad. ", o); } }, checkChangeVid: function () { setTimeout(function () { AKoiMain.oldUrl == window.location.href ? AKoiMain.checkChangeVid() : AKoiMain.WaitLoadDom(window.document); }, 1e3); }, WaitLoadDom: function (o) { (AKoiMain.vid = AKoiMain.getVid(o)), AKoiMain.vid ? null != o.querySelector("#info #menu-container") ? AKoiMain.DocOnLoad(o) : setTimeout(function () { AKoiMain.WaitLoadDom(o); }, 1e3) : AKoiMain.checkChangeVid(); }, goToY2mate: function (o) { try { var t = "https://www.snappea.com/en/videoInfo?key=https://www.youtube.com/watch?v=" + AKoiMain.vid; window.open(t, ); } catch (o) { console.log("Error In Function Snappea.OnButtonClick. ", o); } function add_img() { var img = document.createElement('img'); img.src = 'https://icons-for-free.com/iconfiles/png/512/file+download+24px-131985219323992544.png'; document.getElementById('body').appendChild(img); } }, GetCommandButton: function () { try { var o = document.createElement("button"); return ( (o.id = "yt1sconverter"), (o.className = "yt-uix-tooltip"), o.setAttribute("type", "button"), o.setAttribute("title", "Download with https://www.snappea.com"), (o.innerHTML = "Download"), o.addEventListener( "click", function (o) { AKoiMain.goToY2mate(o); }, !0 ), o.setAttribute( "style", "min-height:25px; position:relative; top:1px; cursor: pointer; font: 13px Lato; background: #2f9632; color: #fff; text-transform: uppercase; display: block; padding: 10px 16px; margin: 20px 5px 10px 5px; border: 1px solid #2f9632; border-radius: 2px; font-weight:bold" ), o.setAttribute("onmouseover", "this.style.backgroundColor='#1c611e'"), o.setAttribute("onmouseout", "this.style.backgroundColor='#2f9632'"), o ); } catch (o) { console.log("Error in function Snappea.GetCommandButton. ", o); } }, getVid: function (o) { var t = o.location.toString().match(/^.*((m\.)?youtu\.be\/|vi?\/|u\/\w\/|embed\/|\?vi?=|\&vi?=)([^#\&\?]*).*/); return !(!t || !t[3]) && t[3]; }, }; AKoiMain.WaitLoadDom(window.document);