Greasy Fork

来自缓存

Gaston's - Video/Image Downloader

Instagram/Twitch/Youtube/tiktok Video/Audio Downloader alwayts updated

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

// ==UserScript==
// @name Gaston's - Video/Image Downloader
// @namespace http://tampermonkey.net/
// @version 4.5
// @description Instagram/Twitch/Youtube/tiktok Video/Audio Downloader alwayts updated
// @author gaston1799
// @match *://www.youtube.com/*
// @match *://www.instagram.com/*
// @match *://music.youtube.com/*
// @match *://y2mate.nu/*
// @match *://www.twitch.tv/*
// @match *://onlymp3.app/*
// @match *://snapsave.io/*
// @match *://clips.twitch.tv/*
// @match *://onlymp3.to/*
// @match *://fastdl.app/*
// @match *://en.onlymp3.app/*
// @match *://clipr.xyz/*
// @match *://studio.youtube.com/*
// @match *://www.yt2conv.com/*
// @match *://soundcloud.com/*
// @match *://sclouddownloader.net/*
// @match *://www.tiktok.com/*
// @match *://en3.onlinevideoconverter.pro/*
// @match *://savetik.co/*
// @match *://yt5s.biz/*
// @match *://sss.instasaverpro.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==

// @grant GM_info
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_addValueChangeListener
// @grant GM_removeValueChangeListener
// @license MIT
// ==/UserScript==

//YT: https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A
var sleep = e => new Promise((t => setTimeout(t, e)));
console.log("ok");
var adev, set_, CurrentPlayingSymbol = "▶";

function getV(e, t) {
    return GM_getValue(e) || (GM_setValue(e, t), t)
}

function setV(e, t) {
    GM_setValue(e, t)
}
async function getFinalUrlFromServer(e) {
    try {
        const t = await fetch("http://localhost:3000/get-final-url", {
            method: "POST",
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify({
                url: e
            })
        });
        if (!t.ok) throw new Error("Failed to fetch final URL");
        return (await t.json()).finalUrl
    } catch (e) {
        return console.error("Error:", e), null
    }
}

function getCurrentVideoID() {
    var e;
    return [...document.getElementsByClassName("ytp-video-menu-item ytp-button")].forEach(((t, n) => {
        t.innerText.startsWith(CurrentPlayingSymbol) && (e = new URL(t.href).searchParams.get("v"))
    })), !e && document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0] ? (console.log("Opening"), document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0].click(), getCurrentVideoID()) : e ? (console.log("Closiung"), document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0].click(), e) : console.warn("Not Found!")
}

function sleep(e) {
    return new Promise((t => setTimeout(t, e)))
}
_getV = getV, _setV = setV, Number.prototype.decimal = function(e) {
    return Number(this.toFixed(e))
}, getSoundCloudUrl = () => {
    try {
        return findhref2(document.querySelector("#app > div.playControls.g-z-index-control-bar.m-visible > section > div > div.playControls__elements > div.playControls__soundBadge.sc-ml-3x > div"))[0].href
    } catch {
        return
    }
}, async function() {
    async function e(e, t = 3e4) {
        var n;
        for (sleep(t).then((e => n = !0)); !document.querySelector(e) && (await sleep(0), !n););
        return document.querySelector(e)
    }
    return location.href.includes("/embed/") ? (console.log("Attaching to embeder >:]"), e(".ytp-right-controls").then((async e => {
        let t = new _e("button", {
            id: "embedMP3"
        }).appendTo(e).set("innerText", "MP3").on("click", (function() {
            let e = getCurrentVideoID() || setElement(location.href);
            downloadT(e, !1, !0, !1, !0)
        })).style({
            position: "fixed",
            right: "50%",
            top: "80%"
        });
        for (; !document.getElementById("embedMP3") && document.querySelector(".ytp-right-controls");) console.log("Appended"), t.appendTo(".ytp-right-controls")
    }))) : (document.querySelector(".ytp-right-controls"), await e(".playbackSoundBadge__actions", 5e3).then((async t => {
        let n = new _e("button", {
            id: "GetAudio"
        }).appendTo(t).set("innerText", "Download MP3").on("click", (function() {
            downloadSC()
        }), (e => e));
        for (;;) !document.getElementById("GetAudio") && await e(".playbackSoundBadge__actions", 5e3) && await e(".playbackSoundBadge__actions", 5e3).then((e => {
            n.appendTo(e), console.log("Added Button")
        })), await sleep(0)
    })))
}().then(console.log, console.warn), downloadSC = function() {
    GM_setValue("SCinfo", null), GM_setValue("sc", getSoundCloudUrl()), !set_ && (set_ = 1, GM_addValueChangeListener("SCinfo", (function(e, t, n, o) {
        n && n.name && downloadFileAsTitle(n.href, n.name)
    }))), open("https://sclouddownloader.net/")
}, GM_setValue_ = GM_setValue, GM_getValue_ = GM_getValue, GM_info_ = GM_info;
var UnmutePath = "M3.15,3.85l4.17,4.17L6.16,9H3v6h3.16L12,19.93v-7.22l2.45,2.45c-0.15,0.07-0.3,0.13-0.45,0.18v1.04 c0.43-0.1,0.83-0.27,1.2-0.48l1.81,1.81c-0.88,0.62-1.9,1.04-3.01,1.2v1.01c1.39-0.17,2.66-0.71,3.73-1.49l2.42,2.42l0.71-0.71 l-17-17L3.15,3.85z M11,11.71v6.07L6.52,14H4v-4h2.52l1.5-1.27L11,11.71z M10.33,6.79L9.62,6.08L12,4.07v4.39l-1-1V6.22L10.33,6.79 z M14,8.66V7.62c2,0.46,3.5,2.24,3.5,4.38c0,0.58-0.13,1.13-0.33,1.64l-0.79-0.79c0.07-0.27,0.12-0.55,0.12-0.85 C16.5,10.42,15.44,9.1,14,8.66z M14,5.08V4.07c3.95,0.49,7,3.85,7,7.93c0,1.56-0.46,3.01-1.23,4.24l-0.73-0.73 C19.65,14.48,20,13.28,20,12C20,8.48,17.39,5.57,14,5.08z",
    mutePath = "M17.5,12c0,2.14-1.5,3.92-3.5,4.38v-1.04c1.44-0.43,2.5-1.76,2.5-3.34c0-1.58-1.06-2.9-2.5-3.34V7.62 C16,8.08,17.5,9.86,17.5,12z M12,4.07v15.86L6.16,15H3V9h3.16L12,4.07z M11,6.22L6.52,10H4v4h2.52L11,17.78V6.22z M21,12 c0,4.08-3.05,7.44-7,7.93v-1.01c3.39-0.49,6-3.4,6-6.92s-2.61-6.43-6-6.92V4.07C17.95,4.56,21,7.92,21,12z";

function downloadFile_(e, t) {
    const n = document.createElement("a");
    n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
}
async function downloadVideo(e, t) {
    try {
        const n = await fetch(e);
        if (!n.ok) throw new Error(`HTTP error! Status: ${n.status}`);
        const o = n.url,
            l = await n.blob(),
            i = window.URL.createObjectURL(l),
            r = document.createElement("a");
        r.href = i, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), window.URL.revokeObjectURL(i), console.log(`Video downloaded from: ${o}`)
    } catch (e) {
        console.error("Failed to download video:", e)
    }
}
_downloadFileAsTitle = async function(e, t, n, o) {
        const l = document.createElement("a");
        return l.style.display = "none", document.body.appendChild(l), fetch(e).then((e => e.blob())).then((i => {
            const r = URL.createObjectURL(i);
            l.href = r, l.download = t, l.target = "_blank", l.click(), URL.revokeObjectURL(r), (n || opener || window).postMessage({
                url: e,
                title: t,
                s: !0
            }, "*"), (typeof o).includes("function") && o()
        })).catch((o => {
            console.error("Error downloading file:", o), (n || opener || window).postMessage({
                url: e,
                title: t,
                s: !1
            }, "*")
        }))
    }, _downloadFile_ = downloadFile_, query = function(e) {
        try {
            let n = "undefined" != typeof $ ? $ : document.querySelectorAll;
            return t = n(e) ? n(e).length ? n(e)[0] : n(e) : null, Object.keys(t).length ? t : null
        } catch {}
        var t
    }, getElementByAttribute = function(e, t = "aria-label", n = document.body) {
        var o = [];
        return function n(l) {
            l.getAttribute(t) == e ? o.push(l) : l.children.length && ((l = l.children).forEach = [].forEach, l.forEach((e => {
                n(e)
            })))
        }(n), 1 == o.length ? o[0] : o || !1
    }, get_aria_label = function(e, t = document.body) {
        var n = [];
        return function t(o) {
            o.getAttribute("aria-label") == e ? n.push(o) : o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((e => {
                t(e)
            })))
        }(t), n[0] || !1
    }, getClass = function(e) {
        return document.getElementsByClassName("ehlq8k34")[0]
    },
    function() {
        class e {
            static get br() {
                return new e("br")
            }
            constructor(e, t) {
                this.element = e.constructor.name.includes("HTML") && e || function() {
                    for (let e in arguments[1]) arguments[0].setAttribute(e, arguments[1][e]);
                    return arguments[0]
                }(document.createElement(arguments[0]), arguments[1])
            }
            style(e) {
                for (let t in e) this.element.style[t] = e[t];
                return this
            }
            append(e, ...t) {
                this.element.append(e.element || e), console.log("T:", {
                    targets: t,
                    fe: t && t.forEach
                });
                for (let e = 0; e < t.length; e++) {
                    let n = t[e];
                    console.log("Appending:", {
                        element: n,
                        target: this
                    }), this.element.append(n.element || n)
                }
                return this
            }
            appendTo(e) {
                return (e.element || "string" == typeof e ? document.querySelector(e) : e).append(this.element), this
            }
            on(e, t) {
                return this.element[`on${e}`] = t, this
            }
            set(e, t) {
                return this.element[e] = t, this
            }
            remove() {
                return this.element.remove(), this
            }
            get() {
                return this.element[arguments[0]]
            }
            get children() {
                return new class {
                    constructor(e) {
                        for (var t = 0; t < e.length; t += 1) this[t] = e[t];
                        Object.defineProperty(this, "length", {
                            get: function() {
                                return e.length
                            }
                        }), Object.freeze(this)
                    }
                    item(e) {
                        return null != this[e] ? this[e] : null
                    }
                    namedItem(e) {
                        for (var t = 0; t < this.length; t += 1)
                            if (this[t].id === e || this[t].name === e) return this[t];
                        return null
                    }
                    get toArray() {
                        return [...this]
                    }
                }([...this.element.children])
            }
        }
        _element = _e = e, setElement2 = function(e) {
            return e.match(/(?<host>https?\:\/\/www\.tiktok\.com)\/(?<username>@[^\/]+)\/video\/(?<videoID>\d+)/i).groups
        };
        var t, n, o = "https://onlymp3.app";

        function l(e) {
            "function" == typeof jQuery && e instanceof jQuery && (e = e[0]);
            var t = e.getBoundingClientRect();
            return t.top >= 0 - (window.innerHeight || document.documentElement.clientHeight) / 2 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) + (window.innerHeight || document.documentElement.clientHeight) / 2 && t.right <= (window.innerWidth || document.documentElement.clientWidth)
        }

        function i(e, {
            callback: t,
            int: n
        }) {
            !t && (t = function() {}), !n && (n = 100), console.log({
                f: e,
                callback: t,
                int: n
            });
            try {
                return e(), void t()
            } catch (e) {}
            var o = setInterval((() => {
                try {
                    e(), t(), clearInterval(o)
                } catch (e) {}
            }), n || 100);
            return o
        }

        function r(e) {
            return null === e.offsetParent
        }

        function c(e) {
            return e.parentNode
        }

        function a() {
            return get_aria_label("Go back") && get_aria_label("Go back").click ? get_aria_label("Go back") : document.querySelector("._afxv")
        }

        function s() {
            return get_aria_label("Next") && get_aria_label("Next").click ? get_aria_label("Next") : document.querySelector("._afxw")
        }

        function d() {
            if (location.href.includes("reel")) {
                let t = open("https://fastdl.app/en", location.href, "width=400,height=500");
                var e = GM_addValueChangeListener("instaURL", (function(n, o, l, i) {
                    l && (console.log("Got", {
                        a: n,
                        b: o,
                        c: l,
                        d: i
                    }), t.close(), GM_removeValueChangeListener(e), downloadFile_(l, document.title + ".mp4"), GM_setValue("instaURL", null))
                }))
            }
        }

        function u() {
            (async function() {
                for (var e = e => new Promise((t => setTimeout(t, e))), t = new Set, n = {}; a();) {
                    if (await e(100), !a()) {
                        await e(1e3);
                        break
                    }
                    a().click()
                }[...getInstalImages()].forEach((e => {
                    let n = findhref2(e, "img")[0];
                    t.add([n.src, n.getAttribute("alt")])
                })), s().click();
                try {
                    s().click()
                } catch (e) {}
                for (; s();) {
                    await e(300), [...getInstalImages()].forEach((e => {
                        let n = findhref2(e, "img")[0];
                        t.add([n.src, n.getAttribute("alt")])
                    }));
                    try {
                        s().click()
                    } catch (e) {}
                }
                for (; await e(100), a();) a().click();
                [...t].forEach((e => {
                    n[e[0]] = e[1]
                })), (t = Object.keys(n).map((e => ({
                    src: e,
                    name: n[e]
                })))).forEach((e => {
                    var t = new URL(e.src).pathname.split(".").pop();
                    w(e.src, `${e.name}.${t}`)
                })), console.log("done", t)
            })().then(console.log, console.warn)
        }
        if (setElement = function(e) {
                return !(!String(e).match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?)|(shorts\/))\??v?=?([^#\&\?]*).*/) || 11 != String(e).match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?)|(shorts\/))\??v?=?([^#\&\?]*).*/)[8].length) && String(e).match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?)|(shorts\/))\??v?=?([^#\&\?]*).*/)[8]
            }, findhref2 = function(e, t) {
                var n = [];
                return function e(o) {
                    o.tagName.toLowerCase() == (t || "a") ? (n.push(o), o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((t => {
                        e(t)
                    })))) : o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((t => {
                        e(t)
                    })))
                }(e), n
            }, getInstalImages = function() {
                return document.querySelectorAll("._acaz")
            }, getInstaVideo = function() {
                return document.querySelector("video.x1lliihq")
            }, downloadVideoFromBlob = function(e, t) {
                if (e && e.src && e.src.startsWith("blob:")) {
                    const n = e.captureStream(),
                        o = new MediaRecorder(n),
                        l = [];
                    o.ondataavailable = e => {
                        e.data.size > 0 && (l.push(e.data), console.log(e.data))
                    }, o.onstop = () => {
                        const e = new Blob(l, {
                                type: "video/mp4"
                            }),
                            n = URL.createObjectURL(e),
                            o = document.createElement("a");
                        o.style.display = "none", o.href = n, o.download = t + ".mp4", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(n)
                    }, o.start(), setTimeout((() => {
                        o.stop()
                    }), 1e3 * e.duration)
                } else console.error("Invalid video element or source.")
            }, console.log("A?"), "fastdl.app" == document.domain) onload = async function() {
            const e = {
                url: name,
                input: null
            };
            var t, n, o = !1;
            for (setTimeout((() => {
                    o = !0
                }), 2e4); !document.querySelector("#search-form-input");)
                if (await p(0), o) throw "Cant find input";
            e.input = document.querySelector("#search-form-input"), console.log("Found a"), t = e.input, n = e.url, ["focus", "input", "change", "blur"].forEach((e => {
                let o = new Event(e, {
                    bubbles: !0,
                    isTrusted: !0
                });
                t[`on${e}`] && t[`on${e}`](o), "input" === e && (t.value = n), t.dispatchEvent(o)
            })), document.querySelector(".search-form__button").click(), GM_setValue("instaURL", await async function(e) {
                for (; !document.querySelector(e);) await p(0);
                return document.querySelector(e)
            }(".button--filled").then((e => e.href)))
        };
        else {
            if ("soundcloud.com" == document.domain) return void(getSoundCloadI = function() {
                _setV("SC", getSoundCloudUrl()), open("https://sclouddownloader.net/", "SC").onclose = function(e) {
                    console.log("Win closed")
                }
            });
            if ("studio.youtube.com" == document.domain) return void setInterval((() => {
                var e;
                try {
                    [...[...document.querySelectorAll("#video-list")].map((e => [e, [...e.classList]])).filter((e => e[1].includes("ytcp-video-section")))[0][0].children[1].children].map((e => [e, [...e.classList], e.tagName])).filter((e => "YTCP-VIDEO-ROW" == e[2])).filter((e => "Public" == e[0].children[0].querySelectorAll(".cell-body.tablecell-visibility.style-scope.ytcp-video-row")[0].innerText)).map((e => e[0].children[0].querySelectorAll(".cell-body.tablecell-visibility.style-scope.ytcp-video-row")[0])).forEach((e => {
                        console.log(e), e.append(new _e("br").element);
                        var t = new _e("button").set("innerText", "Get").on("click", (function(e) {
                            alert("Doesnt work yet");
                            const {
                                id: t,
                                href: n,
                                isShort: o
                            } = findhref2(e.target.parentElement.parentElement).map((e => ({
                                href: e.href,
                                short: e.href.includes("/short"),
                                id: setElement(e.href)
                            }))).filter((e => e.id))[0];
                            downloadT(t, !1, !0, !1, !1, o ? new URL(n) : null)
                        }));
                        e.append(t.element)
                    })), e = !0
                } catch {
                    e = !1
                }
                t != e && (t = e, console.log("Change?", e ? "Found" : "Not FOund"))
            }), 0);
            if ("www.instagram.com" == document.domain) {
                function m() {
                    console.log("Appended buttons man");
                    var t = new e(document.querySelectorAll(".xh8yej3.x1iyjqo2")[0]),
                        n = new e("button", {
                            id: "MediaButton"
                        }).set("innerText", "Get Images").on("click", u),
                        o = new e("button", {
                            id: "MediaButton2"
                        }).set("innerText", "Get Videos").on("click", d);
                    t.append(n, o)
                }
                return i((function() {
                    document.querySelectorAll(".xh8yej3.x1iyjqo2")[0].children
                }), {
                    callback: function() {
                        m(), setInterval((() => {
                            document.querySelector("#MediaButton") || m(), document.querySelector("._aaqy") && !document.querySelector("._aaqy").querySelector("#MediaButton") && function() {
                                var t = new e(document.querySelector("._aaqy")),
                                    n = new e("button", {
                                        id: "MediaButton"
                                    }).set("innerText", "Get Images").on("click", u),
                                    o = new e("button", {
                                        id: "MediaButton2"
                                    }).set("innerText", "Get Videos").on("click", d);
                                t.append(n, o)
                            }()
                        }))
                    }
                }), void console.log("Insta ballz")
            }
            if ("sclouddownloader.net" == document.domain)(async function() {
                var e = _getV("SC");
                async function t(e, t) {
                    let n = e => new Promise((t => setTimeout(t, e)));
                    return await new Promise((async(o, l) => {
                        var i = !1;
                        setTimeout((() => (i = 0, l())), t);
                        for (; !document.querySelector(e);)
                            if (await n(), i) {
                                l();
                                break
                            }
                        return o()
                    })).then((e => !0), (e => !1))
                }
                if ("/download-sound-track" == location.pathname) {
                    for (await t("#trackTitle"); !trackTitle.innerText.length;) await p(0);
                    for (await t("#trackLink"); !trackLink.href.length;) await p(0);
                    _setV("SCinfo", {
                        name: trackTitle.innerText,
                        href: trackLink.href
                    }), close()
                } else {
                    if (!_getV("SC")) throw "Bruv";
                    var n = "#urlInput";
                    if (await t(n, 2e3), await t(n, 2e3)) {
                        for (document.querySelector(n).value = e, console.log("EZ url", !!window.formSubmit);
                            "undefined" == typeof formSubmit;) try {
                            await p(0), console.log("EZ url", formSubmit)
                        } catch {}
                        console.log("EZ url", formSubmit), formSubmit(), console.warn("Got"), setInterval(formSubmit, 1e3)
                    }
                }
            })().then(console.log, console.warn);
            else {
                if ("y2mate.nu" == document.domain) {
                    let I = new URL(location.href).searchParams.get("v"),
                        U = 1 == new URL(location.href).searchParams.get("s"),
                        z = new URL(location.href).searchParams.get("mp4"),
                        A = new URL(location.href).searchParams.get("useT"),
                        V = I + z + A;
                    async function h(e, t = 5e3) {
                        let n = !1;
                        for (setTimeout((() => {
                                console.log("TimeOut for", e), n = !0
                            }), t); !document.querySelector(e) && (console.log("_", e, n), await p(500), !n););
                        if (console.log(e, n), n) throw "NotFound";
                        return document.querySelector(e)
                    }
                    return void async function() {
                        const e = e => new Promise((t => setTimeout(t, e)));
                        for (;
                            "complete" != document.readyState;) await e(0);
                        if (I) {
                            let t = async e => {
                                console.log("a", e);
                                var t = findhref2(document.forms[0])[0].href,
                                    n = findhref2(document.forms[0], "div")[0].innerText,
                                    o = {
                                        _: V,
                                        id: I,
                                        href: t,
                                        title: n,
                                        length: {}
                                    };
                                console.log("Posted", o), (opener || window.parent).postMessage(o, "*"), close()
                            };
                            try {
                                await h("#url").then((e => {
                                    console.log("e", e), e.value = U ? `https://www.youtube.com/watch?v=${I}` : `https://www.youtube.com/shorts/${I}`, e.parentElement.children[1].click()
                                })).catch(t), console.log("after url"), await h("#progress").then((async t => {
                                    for (; document.querySelector(`#${t.id}`);) await e(0);
                                    console.log("a_")
                                })).catch(t), console.log("b")
                            } catch (e) {
                                console.warn("Error:", e)
                            }
                        } else console.warn("No id Found")
                    }().then(console.log, console.warn)
                }
                if ("snapsave.io" == document.domain) {
                    async function h(e, t = 2e4) {
                        let n = !1;
                        for (setTimeout((() => {
                                console.log("TimeOut for", e), n = !0
                            }), t); !document.querySelector(e) && (console.log("_", e, n), await p(500), !n););
                        if (console.log(e, n), n) throw "NotFound";
                        return document.querySelector(e)
                    }
                    return _wfs = h, void async function() {
                        var e = await h("#s_input");
                        if (e) {
                            console.log("Converting"), id_ = new URL(location.href).searchParams.get("v"), e.value = `https://www.youtube.com/watch?v=${id_}`, ksearchvideo();
                            var t = await h("#formatSelect");
                            await h("#btn-action");
                            t.selectedIndex = 0, t.options[0].selected = !0;
                            for (var n = await h("#asuccess"); !(n = await h("#asuccess"));) await p(0);
                            for (convertFile(0);
                                "#" == n.getAttribute("href");) await p(0), n = await h("#asuccess");
                            console.log(n.href);
                            var o = (await _wfs(".clearfix")).querySelector("h3").innerText,
                                l = {
                                    id: id_,
                                    href: n.href,
                                    title: o,
                                    length: {}
                                };
                            console.log("Posted", l), (opener || window).postMessage(l, "*")
                        } else alert("Input was not Found"), console.warn("?!!")
                    }().then(console.log).catch(console.warn)
                }
                if ("clips.twitch.tv" == document.domain) {
                    const R = e => new Promise((t => setTimeout(t, e)));
                    async function h(e, t = 2e4) {
                        let n = !1;
                        for (setTimeout((() => {
                                console.log("TimeOut for", e), n = !0
                            }), t); !document.querySelector(e) && (console.log("_", e, n), await R(500), !n););
                        if (console.log(e, n), n) throw "NotFound";
                        return document.querySelector(e)
                    }

                    function f(e) {
                        if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
                        const t = document.createElement(e.tagName);
                        for (let n of e.attributes) t.setAttribute(n.name, n.value);
                        return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
                    }
                    _wfs = h, _copyElm = f, async function() {
                        location.href;
                        let e = (await _wfs(".ScCoreButtonLabel-sc-s7h2b7-0")).parentElement.parentElement.parentElement.parentElement;
                        new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "1080")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "1080P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "720")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "720P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "480")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "480P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "360")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "360P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "VOD")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "1080P"
                    }().catch(console.warn)
                } else if ("www.twitch.tv" == document.domain) {
                    let [D, G, j, O] = location.pathname.split("/");
                    if ("clip" != j) return console.warn("User isnt wathcing a clip");
                    console.log("User is Watching a CLip");
                    const F = e => new Promise((t => setTimeout(t, e)));
                    async function h(e, t = 2e4) {
                        let n = !1;
                        for (setTimeout((() => {
                                console.log("TimeOut for", e), n = !0
                            }), t); !document.querySelector(e) && (console.log("_", e, n), await F(500), !n););
                        if (console.log(e, n), n) throw "NotFound";
                        return document.querySelector(e)
                    }

                    function f(e) {
                        if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
                        const t = document.createElement(e.tagName);
                        for (let n of e.attributes) t.setAttribute(n.name, n.value);
                        return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
                    }
                    _wfs = h, _wfs_ = h, _copyElm = f, async function() {
                        location.href;
                        await _wfs(".Layout-sc-1xcs6mc-0 .bMOhzu");
                        let e = document.querySelectorAll(".Layout-sc-1xcs6mc-0 .bMOhzu")[1],
                            t = "a";
                        new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e = new URL(location.href), e.host = "clipr.xyz", e.pathname = e.pathname.replace("/" + G + "/clip", ""), e.search = "", e).href, "1080")
                        })).appendTo(e.parentNode).element.querySelector(t).innerText = "1080P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e = new URL(location.href), e.host = "clipr.xyz", e.pathname = e.pathname.replace("/" + G + "/clip", ""), e.search = "", e).href, "720")
                        })).appendTo(e.parentNode).element.querySelector(t).innerText = "720P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e = new URL(location.href), e.host = "clipr.xyz", e.pathname = e.pathname.replace("/" + G + "/clip", ""), e.search = "", e).href, "480")
                        })).appendTo(e.parentNode).element.querySelector(t).innerText = "480P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e = new URL(location.href), e.host = "clipr.xyz", e.pathname = e.pathname.replace("/" + G + "/clip", ""), e.search = "", e).href, "360")
                        })).appendTo(e.parentNode).element.querySelector(t).innerText = "360P", new _e(_copyElm(e)).on("click", (function() {
                            var e;
                            open((e = new URL(location.href), e.host = "clipr.xyz", e.pathname = e.pathname.replace("/" + G + "/clip", ""), e.search = "", e).href, "VOD")
                        })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "VOD"
                    }().catch(console.warn)
                } else if ("clipr.xyz" == document.domain) {
                    ! function() {
                        Object.assign(this || arguments[0], {
                            CustomLog: class {
                                constructor(e) {
                                    this.title = {
                                        body: e || "---",
                                        color: "darkgrey",
                                        size: "1rem"
                                    }, this.body = {
                                        color: "#008f68",
                                        size: "1rem"
                                    }
                                }
                                setTitleBody(e) {
                                    return this.title.body = e, this
                                }
                                setTitleStyle({
                                    color: e,
                                    size: t
                                }) {
                                    return void 0 !== e && (this.title.color = e), void 0 !== t && (this.title.size = t), this
                                }
                                setBodyStyle({
                                    color: e,
                                    size: t
                                }) {
                                    return void 0 !== e && (this.body.color = e), void 0 !== t && (this.body.size = t), this
                                }
                                log(e = "") {
                                    console.log(`%c${this.title.body} | %c${e}`, `color: ${this.title.color}; font-weight: bold; font-size: ${this.title.size};`, `color: ${this.body.color}; font-weight: bold; font-size: ${this.body.size}; text-shadow: 0 0 5px rgba(0,0,0,0.2);`)
                                }
                            }
                        })
                    }(globalThis);
                    const W = new CustomLog("Script Logger");
                    async function h(e, t = 2e4) {
                        let n = !1;
                        for (setTimeout((() => {
                                W.log(`TimeOut for ${e}`), n = !0
                            }), t); !document.querySelector(e) && (W.log(`_ ${e} ${n}`), await p(500), !n););
                        if (W.log(`${e} ${n}`), n) throw "NotFound";
                        return document.querySelector(e)
                    }

                    function p(e) {
                        return new Promise((t => setTimeout(t, e)))
                    }

                    function w(e, t) {
                        const n = document.createElement("a");
                        n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
                    }
                    return void async function() {
                        let e = name;
                        await async function() {
                            for (;
                                "complete" != document.readyState;) await p(0);
                            return !0
                        }(), W.log("Loaded");
                        let t = {
                            1080: document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.overflow-hidden.bg-white.rounded-xl.shadow > div > div > div:nth-child(2) > ul > div > li:nth-child(1) > div:nth-child(3) > a").href,
                            720: document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.overflow-hidden.bg-white.rounded-xl.shadow > div > div > div:nth-child(2) > ul > div > li:nth-child(2) > div:nth-child(3) > a").href,
                            480: document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.overflow-hidden.bg-white.rounded-xl.shadow > div > div > div:nth-child(2) > ul > div > li:nth-child(3) > div:nth-child(3) > a").href,
                            360: document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.overflow-hidden.bg-white.rounded-xl.shadow > div > div > div:nth-child(2) > ul > div > li:nth-child(4) > div:nth-child(3) > a").href,
                            VOD: document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.overflow-hidden.bg-white.rounded-xl.shadow > div > div > div:nth-child(2) > ul > div > li:nth-child(5) > div:nth-child(3) > a").href
                        }[e];
                        W.log(1);
                        let n = document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.mb-6.space-y-3.lg\\:flex.lg\\:items-center.lg\\:justify-between.lg\\:space-y-0 > div.lg\\:flex.lg\\:items-center > p > span:nth-child(1)").innerText;
                        W.log(2);
                        let o = document.querySelector("body > div.relative.overflow-hidden > main > div > div.px-4.mx-auto.max-w-7xl.sm\\:px-6.lg\\:px-8 > div.mb-6.space-y-3.lg\\:flex.lg\\:items-center.lg\\:justify-between.lg\\:space-y-0 > div.lg\\:flex.lg\\:items-center > h2").innerText;
                        W.log(3);
                        let l = `@${n} on Twitch | ${o} - ${e}P.mp4`;
                        W.log(`Downloading file as: ${l}`), open(t), W.log(4), await p(4e3), close()
                    }().catch(console.warn)
                }
            }
        }

        function w(e, t) {
            const n = document.createElement("a");
            n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
        }

        function g(e, t = "aria-label", n = document.body) {
            var o = [];
            return function n(l) {
                var i = !1;
                t ? l.getAttribute(t) == e && (o.push(l), i = 1) : [...l.attributes].map((e => {
                    const {
                        name: t,
                        value: n
                    } = e;
                    return {
                        name: t,
                        value: n
                    }
                })).filter((t => t.value == e)).length && (o.push(l), i = 1), l.children.length && !i && ((l = l.children).forEach = [].forEach, l.forEach((e => {
                    n(e)
                })))
            }(n), o.length ? 1 == o.length ? o[0] : o || !1 : null
        }

        function y() {
            (g("Mute", "title") && g("Mute", "title")[0] || g("Mute (m)", "title")).click()
        }

        function v() {
            (query("#right-controls") && query("#right-controls").querySelectorAll("path")[0].getAttribute("d") == UnmutePath && g("Mute", "title")[0] || g("Unmute", "title") || g("Unmute (m)", "title")).click()
        }
        console.log("B?"), _getIds = function() {
            if (document.domain.includes("music")) throw alert("These button dont work on youtube music yet"), ".";
            var e = [...document.getElementsByTagName("ytd-playlist-panel-renderer")].filter(l).filter((e => !r(e)))[0];
            return findhref2(e, "span").filter((e => !r(e))).filter(l).filter((e => "video-title" == e.id)).map(c).map(c).map((e => ({
                id: setElement(findhref2(c(e))[0].href),
                e: e
            })))
        }, info = {}, downloadT = function(e, t = !1, n = !0, l = !1, i = !1, r = "") {
            let c = e + (l ? "mp4" : "mp3") + n;
            var a;
            if (!(a = document.getElementById(c)) || a.remove(), localStorage[c] && !t && (!i || !confirm(`You have already download this video as .${l?"mp4":"mp3"}\nStill download?`))) return;
            let s = r || location;
            var d = new URL(location.href);
            d.host = d.host.replace(".com", "mz.com"), console.log("o", d);
            let u = ["https://y2mate.nu/Pio1/", "?v=", e, "&s=", d.pathname.startsWith("/shorts/") ? 1 : 0, "&mp4=", l ? "mp4" : "mp3", "&useT=", n];
            console.log(c, u);
            var m;
            return function(e, t, n = !1) {
                var o = addEventListener(e, ((...e) => {
                    t(...e), n && removeEventListener(o)
                }), !0)
            }("unload", (function() {
                info[e].close()
            }), !0), onmessage = function(e) {
                if (e.origin == o || e.origin.match(/https?:\/{2}onlymp3\.to/) || e.origin.match(/https?:\/{2}en\.onlymp3\.to/) || e.origin.match(/https?:\/{2}en(\d)\.onlinevideoconverter\.pro/) || "https://sss.instasaverpro.com" == e.origin || "https://y2mate.nu" == e.origin || "https://snapsave.io" == e.origin) {
                    const {
                        data: {
                            href: t,
                            title: o,
                            length: i,
                            id: r,
                            _: c
                        }
                    } = e;
                    let a = o + (l ? ".mp4" : ".mp3");
                    (e => {
                        e && e.remove()
                    })(document.getElementById(c)), console.log("Handled", {
                        href: t,
                        title: o,
                        length: i,
                        id: r,
                        _: c
                    }, e), n ? (console.log("Getting video"), w(t, a)) : open(t), localStorage[c] = t
                } else console.log("Unhandled Post", e)
            }, info[e] = l ? open(s.pathname.startsWith("/shorts/") ? "https://yt5s.biz/enxj100/" : `https://snapsave.io/en42/youtube-mp4?v=${e}`, [e, s.pathname.startsWith("/shorts/") ? 1 : 0, l + !1], "width=400,height=500") : ((m = new _e("iframe", {
                src: u.join(""),
                id: c,
                useT: n,
                loading: "lazy",
                referrerpolicy: "no-referrer",
                allowfullscreen: !0,
                sandbox: "allow-same-origin allow-scripts allow-popups allow-forms",
                allow: "autoplay; fullscreen; geolocation; microphone; camera"
            }).style({
                border: 0,
                position: "absolute",
                width: 0,
                height: 0,
                "pointer-events": "none",
                opacity: 1
            })).appendTo(document.body), m.closed = !1, !m)
        }, downloadTikTok = function(e, t) {
            (async function(e, t) {
                await async function() {
                    for (; n && !n.closed;) await p(0);
                    return 1
                }(), console.log("ez");
                let l = t.videoID,
                    i = t.username,
                    r = function() {
                        try {
                            return document.querySelector("#app > div.css-14dcx2q-DivBodyContainer.e1irlpdw0 > div:nth-child(4) > div > div.css-1qjw4dg-DivContentContainer.e1mecfx00 > div.css-1stfops-DivCommentContainer.ekjxngi0 > div > div.css-1xlna7p-DivProfileWrapper.ekjxngi4 > div.css-1u3jkat-DivDescriptionContentWrapper.e1mecfx011 > div.css-1nst91u-DivMainContent.e1mecfx01 > div.css-bs495z-DivWrapper.e1mzilcj0 > div > div.css-1d7krfw-DivOverflowContainer.e1mzilcj5 > h1").innerText.replace("Replying to ", "")
                        } catch {
                            try {
                                return document.querySelector("#app > div.css-14dcx2q-DivBodyContainer.e1irlpdw0 > div:nth-child(4) > div > div.css-1qjw4dg-DivContentContainer.e1mecfx00 > div.css-1stfops-DivCommentContainer.ekjxngi0 > div > div.css-1xlna7p-DivProfileWrapper.ekjxngi4 > div.css-1u3jkat-DivDescriptionContentWrapper.e1mecfx011 > div.css-1nst91u-DivMainContent.e1mecfx01 > div.css-bs495z-DivWrapper.e1mzilcj0").innerText.replace("Replying to ", "")
                            } catch (e) {
                                return g("browse-video-desc", "data-e2e") ? g("browse-video-desc", "data-e2e").innerText : document.querySelector("#main-content-video_detail > div > div.css-12kupwv-DivContentContainer.ege8lhx2 > div.css-1senhbu-DivLeftContainer.ege8lhx3 > div.css-1sb4dwc-DivPlayerContainer.eqrezik4 > div.css-3lfoqn-DivDescriptionContentWrapper-StyledDetailContentWrapper.eqrezik15 > div.css-r4nwrj-DivVideoInfoContainer.eqrezik3 > div.css-bs495z-DivWrapper.e1mzilcj0 > div > h1").innerText.replace("Replying to ", "")
                            }
                        }
                    }();
                onmessage = function(e) {
                    if (e.origin == o || e.origin.match(/https?:\/{2}savetik\.csavetik.coo/) || e.origin.match(/https?:\/{2}en\.onlymp3\.to/) || e.origin.match(/https?:\/{2}en(\d)\.onlinevideoconverter\.pro/) || "https://savetik.co" == e.origin) {
                        var {
                            data: {
                                href: t,
                                links: l,
                                title: i,
                                length: c,
                                id: a,
                                mp4: s,
                                info: {
                                    username: d
                                }
                            }
                        } = e;
                        if (console.log("Handled", {
                                href: t,
                                title: i,
                                length: c,
                                id: a,
                                links: l,
                                mp4: s
                            }, e), "https://savetik.co" == e.origin) i = r, w(s ? l[0] : l.pop(), d + " - " + i + (s ? ".mp4" : ".mp3"), n);
                        else {
                            if (useT) {
                                let e = document.createElement("a");
                                e.download = i + ".mp3", e.href = t, document.body.appendChild(e), e.click(), e.remove()
                            } else open(t);
                            localStorage[_] = t
                        }
                    } else console.log("Unhandled Post", e)
                }, n = open("https://savetik.co/en", [`https://www.tiktok.com/${i}/video/${l}`, e + !1], "width=400,height=500")
            })(e, t).then(console.log, console.warn)
        }, abc_ = g, M = y, Um = v;
        var b = 0;

        function x(e) {
            return !!e && !e.closed
        }
        async function k(e = [
            ["w1", "win1"],
            ["w2", "win2"],
            ["w3", "win3"],
            ["w4", "win4"]
        ]) {
            var t, n = !1;
            return await new Promise(((o, l) => {
                var i = setInterval((l => {
                    e.forEach((e => {
                        this[e[0]] = x(window[e[1]]), window[e[1]] || n || (n = !0, t = e[1], console.log(e))
                    })), t && (o(t), clearInterval(i))
                }), 500)
            })), t
        }
        window.ch3 = x, window.getWin = k, WIP_ = function(e, t, n) {
            if (!t) return alert("This button is corrently broken");
            var o = _getIds(),
                l = [];
            for (let t = 0; t < e; t++) l.push(["w" + t, "win" + t]);
            o.forEach((({
                id: e
            }, o) => {
                k(l).then((l => {
                    if (!info[e] && !localStorage[e] || n) {
                        console.log("download", e, o), window[l] = downloadT(e, n, !0, !!t), window.addEventListener("unload", (function(e) {
                            window[l].close()
                        }));
                        var i = setInterval((e => {
                            window[l] && !window[l].closed || (window[l] = null, clearInterval(i), console.log(l, "isclosed"))
                        }), 300)
                    }
                }))
            }))
        };
        var T = new e("button").set("innerText", "Get MP3").on("click", (function(e) {
                downloadT(setElement(location.href), !0, !0, !1, !0)
            })),
            S = new e("button").set("innerText", "Get MP4").on("click", (function(e) {
                downloadT(setElement(location.href), !0, !0, !0, !0)
            })),
            E = new e("button").set("innerText", "PlayList MP3").on("click", (function(e) {
                WIP_(2, !1, !1)
            })),
            q = new e("button").set("innerText", "PlayList MP4").on("click", (function(e) {
                WIP_(2, !0, !1)
            })),
            C = new e("button").set("innerText", "Get MP4").on("click", (function(e) {
                downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
            })).style({
                color: "white"
            }),
            L = (new e("button", {
                id: "tt1"
            }).set("innerText", "Get MP4").on("click", (function(e) {
                downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
            })).style({
                color: "white"
            }), new e("button").set("innerText", "Get MP3").on("click", (function(e) {
                downloadTikTok(!1, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
            })).style({
                color: "white"
            }));

        function P() {
            return document.querySelector("#end") || document.querySelector("#right-content")
        }
        if (console.log("bruh"), a1 = [
                ["youtube", function() {
                    i((function() {
                        P();
                        if (!P()) throw "Cant append buttons yet";
                        return console.log("Posting"),
                            function() {
                                const t = P();

                                function n() {
                                    try {
                                        return !(![...document.querySelectorAll("#header-description")].filter(l).filter((e => !r(e)))[0] && !query(".autoplay")) && ([...document.querySelectorAll("#header-description")].filter(l).filter((e => !r(e)))[0] || query(".autoplay"))
                                    } catch (e) {
                                        return !1
                                    }
                                }
                                console.log(t), T.appendTo(t), S.appendTo(t), console.log("Posted Buttons");
                                var o = !1;
                                setInterval((() => {
                                    o != n() && n() ? (console.log("Added playlist buttons"), setTimeout((() => {
                                        n().append(e.br.element), n().append(E.element), n().append(q.element)
                                    }), 100)) : o == n() || n() || console.log("buttons are gone?!?!"), o = n()
                                }), 100)
                            }()
                    }), {
                        callback: function() {}
                    })
                }],
                ["tiktok", function() {
                    addEventListener("load", (function() {
                        i((function() {
                            if (!abc_("browse-copy", "data-e2e")) throw "Cant Append";
                            C.appendTo(document.querySelectorAll(".e1mecfx011")), L.appendTo(document.querySelectorAll(".e1mecfx011"))
                        }), {
                            callback: function() {}
                        }), i((function() {
                            if (!document.getElementsByClassName("e13wiwn60")[0]) throw "Cant Append";

                            function t() {
                                try {
                                    return !!abc_("browse-copy", "data-e2e").parentNode && abc_("browse-copy", "data-e2e").parentNode
                                } catch (e) {
                                    return !1
                                }
                            }
                            C.appendTo(document.getElementsByClassName("e13wiwn60")[0]), L.appendTo(document.getElementsByClassName("e13wiwn60")[0]), console.log("Posted Buttons");
                            var n = !1;
                            setInterval((() => {
                                n != t() && t() ? (console.log("Added playlist buttons"), setTimeout((() => {
                                    t().append(e.br.element), t().append(C.element), t().append(L.element)
                                }), 100)) : n == t() || t() || console.log("buttons are gone?!?!"), n = t()
                            }), 100)
                        }), {
                            callback: function() {}
                        })
                    }))
                }]
            ].filter((e => location.host.includes(e[0])))[0], a1 && a1[1] && a1[1](), console.log(a1), delete a1, __ex_ = P, location.href.includes("onlymp3.app") || location.href.includes("onlymp3.to")) {
            console.log("onlymp3.app");
            return setInterval((() => {
                document.getElementById("error-text").innerText.length > 5 && location.reload()
            }), 2e4), console.log("Getting MP3"), void i((function(e = function() {}) {
                ! function() {
                    var [e, t] = name.split(",");
                    txtUrl.value = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`, getListFormats()
                }(), i((function(e = function() {}) {
                    ! function() {
                        var e = videoTitle.innerText.split("\n"),
                            t = e.map((e => e.match(/[:\d]+/gi))).filter((e => !!e)).pop().pop(),
                            n = e[0].split("Title: ")[1],
                            o = findhref2(videoTitle.parentNode)[0].href,
                            l = {
                                id: setElement(location.href),
                                href: o,
                                title: n,
                                length: t
                            };
                        (opener || window).postMessage(l, "*"), console.log("Poasted")
                    }()
                }), {
                    callback: close
                })
            }), {
                callback: function() {}
            })
        }
        if (location.href.includes("www.yt2conv.com")) {
            console.log("Getting MP4");
            let [H, K] = name.split(",");
            i((function(e = function() {}) {
                document.getElementById("search_txt").value = `https://www.youtube.com/${"1"==K?"shorts/":"watch?v="}${H}`, document.getElementById("btn-submit").click(), console.log(H, K)
            }), {
                callback: function() {}
            }), i((function(e = function() {}) {
                if (console.log(result.children.length), !result.children.length) throw document.getElementById("btn-submit").click(), "no there"
            }), {
                int: 1e3,
                callback: function() {}
            }), i((function() {
                document.getElementById("btn-download").click()
            }), {
                callback: function() {}
            }), i((function() {
                var e = $(".media-heading")[0].innerText,
                    t = downloadbtn.href,
                    n = {
                        id: H,
                        href: t,
                        title: e,
                        length: {}
                    };
                console.log("Posted"), (opener || window).postMessage(n, "*")
            }), {
                callback: close
            })
        }
        if (location.href.includes("yt5s.biz")) {
            async function h(e) {
                for (; !document.querySelector(e);) await p(0);
                return !0
            }(async function() {
                let [e, t] = name.split(",");
                if (!e.length || !t.length) return console.warn("No info Preset");
                var n = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`;
                await h("#txt-url"), console.log("Input Loaded"), document.querySelector("#txt-url").value = n, await h("#btn-submit"), console.log("GEtting res"), await p(100), document.querySelector("#btn-submit").click(), await h("#video_title"), console.log("Got Res");
                var o = document.querySelector("#video_title").innerText,
                    l = [0];
                return [...document.querySelector("#result").querySelector("table").querySelectorAll("tr")].forEach((e => {
                    var t = e.innerText.match(/(?<res>\d+)(p|P)/i) || {};
                    t.groups && (t = Number(t.groups.res), l[0] < t && (l[0] = t, l[1] = findhref2(e)[0].href, l[2] = e))
                })), {
                    id: e,
                    title: o,
                    href: l[1],
                    mp4: !0,
                    res: l[0]
                }
            })().then((function(e) {
                (opener || window).postMessage(e, "*"), location.href = e.href
            }), console.warn)
        }
        if (location.href.includes("sss.instasaverpro.com") && async function() {
                for (await async function(e) {
                        for (; !document.querySelector(e);) await p(0);
                        return !0
                    }("#A_downloadUrl"); !document.querySelector("#A_downloadUrl").href.length;) await p(0);
                console.log("Done");
                var e = document.querySelector("#myModalLabel").innerText,
                    t = {
                        href: document.querySelector("#A_downloadUrl").href,
                        title: e
                    };
                (opener || window).postMessage(t, "*")
            }().then(close, console.warn), location.href.includes("en3.onlinevideoconverter.pro")) {
            let [Z, Q] = name.split(",");
            if (!Z.length || !Q.length) return console.Warn("NO info Preset");
            let Y = function() {};
            i((function(e = function() {}) {
                document.getElementById("texturl").value = `https://www.youtube.com/${"1"==Q?"shorts/":"watch?v="}${Z}`, document.getElementById("convert1").click(), console.log("Searched")
            }), {
                callback: Y
            }), i((function() {
                if ("none" == stepProcess.style.display) throw document.getElementById("convert1").click(), "this";
                console.log("Searching")
            }), {
                callback: Y
            }), i((function() {
                if (0 == document.getElementById("form-app-root").children.length) throw "";
                console.log("loaded");
                var {
                    title: e,
                    href: t
                } = $("#download-720-MP4") && $("#download-720-MP4")[0] ? $("#download-720-MP4")[0] : $("#download-720-MP4"), n = {
                    id: Z,
                    href: t,
                    title: e,
                    length: {}
                };
                console.log("Posted"), (opener || window).postMessage(n, "*")
            }), {
                callback: close
            })
        }
        if (location.href.includes("savetik.co")) {
            var [B, N] = name.split(",");
            addEventListener("load", (function() {
                i((function() {
                    s_input.value = B, ksearchvideo(), setTimeout(ksearchvideo, 1e3)
                }), {
                    callback() {}
                })
            })), i((function() {
                document.getElementsByClassName("clearfix")[0].innerText,
                    function() {
                        console.log("Found");
                        let e = {
                            title: document.getElementsByClassName("clearfix")[0].innerText,
                            links: findhref2(document.getElementsByClassName("tik-video")[0]).map((e => e.href)),
                            mp4: 1 == N,
                            info: setElement2(B)
                        };
                        onmessage = function(e) {
                            if ("https://www.tiktok.com" == e.origin) {
                                var {
                                    data: {
                                        s: t,
                                        url: n,
                                        title: o
                                    }
                                } = e;
                                console.log("Handled", {
                                    s: t,
                                    url: n,
                                    title: o
                                }, e), t ? setTimeout(close, 100) : w(n, o, null, close)
                            } else console.log("Unhandled Post", e)
                        }, (opener || window).postMessage(e, "*")
                    }()
            }), {
                callback() {}
            })
        }
        document.domain.includes("music") && (console.log("Added MiniPlayer Toggle with I"), addEventListener("keypress", (function({
            isTrusted: e,
            ctrlKey: t,
            shiftKey: n,
            code: o,
            target: l,
            target: {
                tagName: i
            }
        }) {
            ["INPUT", "TEXTAREA"].includes(i) || t || n || !e || "KeyI" != o || (abc_("Close player page") || abc_("Open player page")[1]).click()
        }))), setInterval((e => {
            document.getElementsByClassName("ytp-ad-button-icon")[0] && !b && (console.log("muted ad"), b = 1, y()), !document.getElementsByClassName("ytp-ad-button-icon")[0] && b && (console.log("unmuted video"), function() {
                try {
                    v()
                } catch (e) {
                    console.warn("Failed unmuting")
                }
            }(), b = 0), [...document.querySelectorAll("#song-video"), ...document.querySelectorAll("#ytd-player")].map((e => [...e.querySelectorAll("button")].filter((e => e.className.includes("skip")))[0])).filter((e => !!e))[0] && ([...document.querySelectorAll("#song-video"), ...document.querySelectorAll("#ytd-player")].map((e => [...e.querySelectorAll("button")].filter((e => e.className.includes("skip")))[0])).filter((e => !!e))[0].click(), console.log("Skipped d :>")), document.getElementsByClassName("ytp-ad-overlay-close-button")[2] && (document.getElementsByClassName("ytp-ad-overlay-close-button")[2].click(), console.log("Close ad card"))
        }), 10)
    }();