Gaston's - Video/Image Downloader

Instagram/Twitch/YouTube/TikTok Video/Audio Downloader (frequently updated)

目前為 2024-11-19 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Gaston's - Video/Image Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 7.1
  5. // @supportURL https://your-support-page.com
  6. // @homepageURL https://gf.qytechs.cn/en/users/689441-gaston2
  7. // @description Instagram/Twitch/YouTube/TikTok Video/Audio Downloader (frequently updated)
  8. // @author gaston1799
  9. // @match *://www.youtube.com/*
  10. // @match *://www.instagram.com/*
  11. // @match *://music.youtube.com/*
  12. // @match *://y2mate.nu/*
  13. // @match *://www.twitch.tv/*
  14. // @match *://loader.to/*
  15. // @match *://onlymp3.app/*
  16. // @match *://qdownloader.cc/*
  17. // @match *://tubemp4.is/*
  18. // @match *://snapsave.io/*
  19. // @match *://clips.twitch.tv/*
  20. // @match *://twitch.tv/*
  21. // @match *://onlymp3.to/*
  22. // @match *://fastdl.app/*
  23. // @match *://en.onlymp3.app/*
  24. // @match *://clipr.xyz/*
  25. // @match *://studio.youtube.com/*
  26. // @match *://www.yt2conv.com/*
  27. // @match *://soundcloud.com/*
  28. // @match *://sclouddownloader.net/*
  29. // @match *://www.tiktok.com/*
  30. // @match *://en3.onlinevideoconverter.pro/*
  31. // @match *://savetik.co/*
  32. // @match *://yt5s.biz/*
  33. // @match *://sss.instasaverpro.com/*
  34. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  35.  
  36. // @grant GM_info
  37. // @grant GM_xmlhttpRequest
  38. // @grant GM_getValue
  39. // @grant GM_setValue
  40. // @grant GM_deleteValue
  41. // @grant GM_addValueChangeListener
  42. // @grant GM_removeValueChangeListener
  43. // @license MIT
  44. // ==/UserScript==
  45.  
  46. //YT: https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A
  47. ! function() {
  48. ! function() {
  49. "use strict";
  50. const e = "feedbackPromptLastDate",
  51. t = "isFirstTimeKey";
  52. async function o() {
  53. const t = function() {
  54. if ("undefined" != typeof GM_info && GM_info.scriptUpdateURL) {
  55. const e = GM_info.scriptUpdateURL.match(/\/scripts\/(\d+)\//);
  56. if (e && e[1]) return e[1]
  57. }
  58. return console.error("Script ID not found in the update URL."), null
  59. }();
  60. if (t) {
  61. const o = `https://gf.qytechs.cn/en/scripts/${t}/feedback`;
  62. confirm("Are you enjoying this script? Would you like to provide feedback?") && window.open(o, "_blank"), await GM.setValue(e, Date.now())
  63. }
  64. }!async function() {
  65. const n = await GM.getValue(t, !1),
  66. l = await GM.getValue(e, 0);
  67. console.log("FirstTime:", n), Date.now() - l > 12096e5 && (o(), GM.setValue(t, !0))
  68. }()
  69. }(),
  70. function() {
  71. Object.assign(this || arguments[0], {
  72. CustomLog: class {
  73. constructor(e) {
  74. this.title = {
  75. body: e || "---",
  76. color: "darkgrey",
  77. size: "1rem"
  78. }, this.body = {
  79. color: "#008f68",
  80. size: "1rem"
  81. }
  82. }
  83. setTitleBody(e) {
  84. return this.title.body = e, this
  85. }
  86. setTitleStyle({
  87. color: e,
  88. size: t
  89. }) {
  90. return void 0 !== e && (this.title.color = e), void 0 !== t && (this.title.size = t), this
  91. }
  92. setBodyStyle({
  93. color: e,
  94. size: t
  95. }) {
  96. return void 0 !== e && (this.body.color = e), void 0 !== t && (this.body.size = t), this
  97. }
  98. log(e = "") {
  99. 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);`)
  100. }
  101. }
  102. })
  103. }(globalThis);
  104. const e = new CustomLog("Script Logger");
  105. var t = e => new Promise((t => setTimeout(t, e)));
  106. console.log("ok");
  107. var o;
  108.  
  109. function n() {
  110. var e;
  111. return [...document.getElementsByClassName("ytp-video-menu-item ytp-button")].forEach(((t, o) => {
  112. t.innerText.startsWith("▶") && (e = new URL(t.href).searchParams.get("v"))
  113. })), !e && document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0] ? (console.log("Opening"), document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0].click(), n()) : e ? (console.log("Closiung"), document.getElementsByClassName("ytp-playlist-menu-button ytp-button")[0].click(), e) : console.warn("Not Found!")
  114. }
  115.  
  116. function t(e) {
  117. return new Promise((t => setTimeout(t, e)))
  118. }
  119. _getV = function(e, t) {
  120. return GM_getValue(e) || (GM_setValue(e, t), t)
  121. }, _setV = function(e, t) {
  122. GM_setValue(e, t)
  123. }, Number.prototype.decimal = function(e) {
  124. return Number(this.toFixed(e))
  125. }, getSoundCloudUrl = () => {
  126. try {
  127. 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
  128. } catch {
  129. return
  130. }
  131. }, async function() {
  132. async function e(e, o = 3e4) {
  133. var n;
  134. for (t(o).then((e => n = !0)); !document.querySelector(e) && (await t(0), !n););
  135. return document.querySelector(e)
  136. }
  137. return location.href.includes("/embed/") ? (console.log("Attaching to embeder >:]"), e(".ytp-right-controls").then((async e => {
  138. let t = new _e("button", {
  139. id: "embedMP3"
  140. }).appendTo(e).set("innerText", "MP3").on("click", (function() {
  141. let e = n() || setElement(location.href);
  142. downloadT(e, !1, !0, !1, !0)
  143. })).style({
  144. position: "fixed",
  145. right: "50%",
  146. top: "80%"
  147. });
  148. for (; !document.getElementById("embedMP3") && document.querySelector(".ytp-right-controls");) console.log("Appended"), t.appendTo(".ytp-right-controls")
  149. }))) : (document.querySelector(".ytp-right-controls"), await e(".playbackSoundBadge__actions", 5e3).then((async o => {
  150. let n = new _e("button", {
  151. id: "GetAudio"
  152. }).appendTo(o).set("innerText", "Download MP3").on("click", (function() {
  153. downloadSC()
  154. }), (e => e));
  155. for (;;) !document.getElementById("GetAudio") && await e(".playbackSoundBadge__actions", 5e3) && await e(".playbackSoundBadge__actions", 5e3).then((e => {
  156. n.appendTo(e), console.log("Added Button")
  157. })), await t(0)
  158. })))
  159. }().then(console.log, console.warn), downloadSC = function() {
  160. GM_setValue("SCinfo", null), GM_setValue("sc", getSoundCloudUrl()), !o && (o = 1, GM_addValueChangeListener("SCinfo", (function(e, t, o, n) {
  161. console.log({
  162. a: e,
  163. b: t,
  164. c: o,
  165. d: n
  166. }), o && o.name && _downloadFileAsTitle(o.href, o.name)
  167. }))), open("https://sclouddownloader.net/")
  168. }, GM_setValue_ = GM_setValue, GM_getValue_ = GM_getValue, GM_info_ = GM_info;
  169.  
  170. function l(e, t) {
  171. const o = document.createElement("a");
  172. o.href = e, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o)
  173. }
  174. _downloadFileAsTitle = async function(e, t, o, n) {
  175. const l = document.createElement("a");
  176. return l.style.display = "none", document.body.appendChild(l), fetch(e).then((e => e.blob())).then((c => {
  177. const i = URL.createObjectURL(c);
  178. l.href = i, l.download = t, l.target = "_blank", l.click(), URL.revokeObjectURL(i), (o || opener || window).postMessage({
  179. url: e,
  180. title: t,
  181. s: !0
  182. }, "*"), (typeof n).includes("function") && n()
  183. })).catch((n => {
  184. console.error("Error downloading file:", n), (o || opener || window).postMessage({
  185. url: e,
  186. title: t,
  187. s: !1
  188. }, "*")
  189. }))
  190. }, _downloadFile_ = l;
  191. const c = function(e, t) {
  192. try {
  193. let n = "undefined" != typeof $ ? $ : document.querySelectorAll;
  194. return t ? [...document.querySelectorAll(e)].filter((e => !(null === el.offsetParent)))[0] : (o = n(e) ? n(e).length ? n(e)[0] : n(e) : null, Object.keys(o).length ? o : null)
  195. } catch {}
  196. var o
  197. };
  198. getElementByAttribute = function(e, t = "aria-label", o = document.body) {
  199. var n = [];
  200. return function o(l) {
  201. l.getAttribute(t) == e ? n.push(l) : l.children.length && ((l = l.children).forEach = [].forEach, l.forEach((e => {
  202. o(e)
  203. })))
  204. }(o), 1 == n.length ? n[0] : n || !1
  205. }, get_aria_label = function(e, t = document.body) {
  206. var o = [];
  207. return function t(n) {
  208. n.getAttribute("aria-label") == e ? o.push(n) : n.children.length && ((n = n.children).forEach = [].forEach, n.forEach((e => {
  209. t(e)
  210. })))
  211. }(t), o[0] || !1
  212. }, getClass = function(e) {
  213. return document.getElementsByClassName("ehlq8k34")[0]
  214. },
  215. function() {
  216. class t {
  217. static get br() {
  218. return new t("br")
  219. }
  220. constructor(e, t) {
  221. this.element = e.constructor.name.includes("HTML") && e || function() {
  222. for (let e in arguments[1]) arguments[0].setAttribute(e, arguments[1][e]);
  223. return arguments[0]
  224. }(document.createElement(arguments[0]), arguments[1])
  225. }
  226. style(e) {
  227. for (let t in e) this.element.style[t] = e[t];
  228. return this
  229. }
  230. append(e, ...t) {
  231. this.element.append(e.element || e), console.log("T:", {
  232. targets: t,
  233. fe: t && t.forEach
  234. });
  235. for (let e = 0; e < t.length; e++) {
  236. let o = t[e];
  237. console.log("Appending:", {
  238. element: o,
  239. target: this
  240. }), this.element.append(o.element || o)
  241. }
  242. return this
  243. }
  244. appendTo(e) {
  245. return (e.element || "string" == typeof e ? document.querySelector(e) : e).append(this.element), this
  246. }
  247. on(e, t) {
  248. return this.element[`on${e}`] = t, this
  249. }
  250. set(e, t) {
  251. return this.element[e] = t, this
  252. }
  253. remove() {
  254. return this.element.remove(), this
  255. }
  256. get() {
  257. return this.element[arguments[0]]
  258. }
  259. get children() {
  260. return new class {
  261. constructor(e) {
  262. for (var t = 0; t < e.length; t += 1) this[t] = e[t];
  263. Object.defineProperty(this, "length", {
  264. get: function() {
  265. return e.length
  266. }
  267. }), Object.freeze(this)
  268. }
  269. item(e) {
  270. return null != this[e] ? this[e] : null
  271. }
  272. namedItem(e) {
  273. for (var t = 0; t < this.length; t += 1)
  274. if (this[t].id === e || this[t].name === e) return this[t];
  275. return null
  276. }
  277. get toArray() {
  278. return [...this]
  279. }
  280. }([...this.element.children])
  281. }
  282. }
  283. _element = _e = t, setElement2 = function(e) {
  284. return e.match(/(?<host>https?\:\/\/www\.tiktok\.com)\/(?<username>@[^\/]+)\/video\/(?<videoID>\d+)/i).groups
  285. };
  286. var o = "https://onlymp3.app";
  287.  
  288. function n(e) {
  289. "function" == typeof jQuery && e instanceof jQuery && (e = e[0]);
  290. var t = e.getBoundingClientRect();
  291. 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)
  292. }
  293.  
  294. function i(e, {
  295. callback: t,
  296. int: o
  297. }) {
  298. !t && (t = function() {}), !o && (o = 100), console.log({
  299. f: e,
  300. callback: t,
  301. int: o
  302. });
  303. try {
  304. return e(), void t()
  305. } catch (e) {}
  306. var n = setInterval((() => {
  307. try {
  308. e(), t(), clearInterval(n)
  309. } catch (e) {}
  310. }), o || 100);
  311. return n
  312. }
  313.  
  314. function r(e) {
  315. return null === e.offsetParent
  316. }
  317.  
  318. function a(e) {
  319. return e.parentNode
  320. }
  321.  
  322. function s() {
  323. return get_aria_label("Go back") && get_aria_label("Go back").click ? get_aria_label("Go back") : document.querySelector("._afxv")
  324. }
  325.  
  326. function u() {
  327. return get_aria_label("Next") && get_aria_label("Next").click ? get_aria_label("Next") : document.querySelector("._afxw")
  328. }
  329.  
  330. function d() {
  331. if (location.href.includes("reel")) {
  332. let t = open("https://fastdl.app/en", location.href, "width=400,height=500");
  333. var e = GM_addValueChangeListener("instaURL", (function(o, n, c, i) {
  334. c && (console.log("Got", {
  335. a: o,
  336. b: n,
  337. c: c,
  338. d: i
  339. }), t.close(), GM_removeValueChangeListener(e), l(c, document.title + ".mp4"), GM_setValue("instaURL", null))
  340. }))
  341. }
  342. }
  343.  
  344. function m() {
  345. (async function() {
  346. for (var e = e => new Promise((t => setTimeout(t, e))), t = new Set, o = {}; s();) {
  347. if (await e(100), !s()) {
  348. await e(1e3);
  349. break
  350. }
  351. s().click()
  352. }[...getInstalImages()].forEach((e => {
  353. let o = findhref2(e, "img")[0];
  354. t.add([o.src, o.getAttribute("alt")])
  355. })), u().click();
  356. try {
  357. u().click()
  358. } catch (e) {}
  359. for (; u();) {
  360. await e(300), [...getInstalImages()].forEach((e => {
  361. let o = findhref2(e, "img")[0];
  362. t.add([o.src, o.getAttribute("alt")])
  363. }));
  364. try {
  365. u().click()
  366. } catch (e) {}
  367. }
  368. for (; await e(100), s();) s().click();
  369. [...t].forEach((e => {
  370. o[e[0]] = e[1]
  371. })), (t = Object.keys(o).map((e => ({
  372. src: e,
  373. name: o[e]
  374. })))).forEach((e => {
  375. var t = new URL(e.src).pathname.split(".").pop();
  376. y(e.src, `${e.name}.${t}`)
  377. })), console.log("done", t)
  378. })().then(console.log, console.warn)
  379. }
  380. setElement = function(e) {
  381. 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]
  382. }, findhref2 = function(e, t) {
  383. var o = [];
  384. return function e(n) {
  385. n.tagName.toLowerCase() == (t || "a") ? (o.push(n), n.children.length && ((n = n.children).forEach = [].forEach, n.forEach((t => {
  386. e(t)
  387. })))) : n.children.length && ((n = n.children).forEach = [].forEach, n.forEach((t => {
  388. e(t)
  389. })))
  390. }(e), o
  391. }, getInstalImages = function() {
  392. return document.querySelectorAll("._acaz")
  393. }, getInstaVideo = function() {
  394. return document.querySelector("video.x1lliihq")
  395. }, downloadVideoFromBlob = function(e, t) {
  396. if (e && e.src && e.src.startsWith("blob:")) {
  397. const o = e.captureStream(),
  398. n = new MediaRecorder(o),
  399. l = [];
  400. n.ondataavailable = e => {
  401. e.data.size > 0 && (l.push(e.data), console.log(e.data))
  402. }, n.onstop = () => {
  403. const e = new Blob(l, {
  404. type: "video/mp4"
  405. }),
  406. o = URL.createObjectURL(e),
  407. n = document.createElement("a");
  408. n.style.display = "none", n.href = o, n.download = t + ".mp4", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(o)
  409. }, n.start(), setTimeout((() => {
  410. n.stop()
  411. }), 1e3 * e.duration)
  412. } else console.error("Invalid video element or source.")
  413. }, console.log("A?");
  414. const h = e => new Promise((t => setTimeout(t, e)));
  415. if ("fastdl.app" == document.domain) onload = async function() {
  416. const e = {
  417. url: name,
  418. input: null
  419. };
  420. var t = !1;
  421. for (setTimeout((() => {
  422. t = !0
  423. }), 2e4); !document.querySelector("#search-form-input");)
  424. if (await h(0), t) throw "Cant find input";
  425. e.input = document.querySelector("#search-form-input"), console.log("Found a"),
  426. function(e, t) {
  427. ["focus", "input", "change", "blur"].forEach((o => {
  428. let n = new Event(o, {
  429. bubbles: !0,
  430. isTrusted: !0
  431. });
  432. e[`on${o}`] && e[`on${o}`](n), "input" === o && (e.value = t), e.dispatchEvent(n)
  433. }))
  434. }(e.input, e.url), document.querySelector(".search-form__button").click(), GM_setValue("instaURL", await async function(e) {
  435. for (; !document.querySelector(e);) await h(0);
  436. return document.querySelector(e)
  437. }(".button--filled").then((e => e.href)))
  438. };
  439. else {
  440. if ("soundcloud.com" == document.domain) return void(getSoundCloadI = function() {
  441. _setV("SC", getSoundCloudUrl()), open("https://sclouddownloader.net/", "SC").onclose = function(e) {
  442. console.log("Win closed")
  443. }
  444. });
  445. if ("studio.youtube.com" == document.domain) return void setInterval((() => {
  446. var e;
  447. try {
  448. [...[...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 => {
  449. console.log(e), e.append(new _e("br").element);
  450. var t = new _e("button").set("innerText", "Get").on("click", (function(e) {
  451. alert("Doesnt work yet");
  452. const {
  453. id: t,
  454. href: o,
  455. isShort: n
  456. } = findhref2(e.target.parentElement.parentElement).map((e => ({
  457. href: e.href,
  458. short: e.href.includes("/short"),
  459. id: setElement(e.href)
  460. }))).filter((e => e.id))[0];
  461. downloadT(t, !1, !0, !1, !1, n ? new URL(o) : null)
  462. }));
  463. e.append(t.element)
  464. })), e = !0
  465. } catch {
  466. e = !1
  467. }
  468. v != e && (v = e, console.log("Change?", e ? "Found" : "Not FOund"))
  469. }), 0);
  470. if ("www.instagram.com" == document.domain) {
  471. function p() {
  472. console.log("Appended buttons man");
  473. var e = new t(document.querySelectorAll(".xh8yej3.x1iyjqo2")[0]),
  474. o = new t("button", {
  475. id: "MediaButton"
  476. }).set("innerText", "Get Images").on("click", m),
  477. n = new t("button", {
  478. id: "MediaButton2"
  479. }).set("innerText", "Get Videos").on("click", d);
  480. e.append(o, n)
  481. }
  482. return i((function() {
  483. document.querySelectorAll(".xh8yej3.x1iyjqo2")[0].children
  484. }), {
  485. callback: function() {
  486. p(), setInterval((() => {
  487. document.querySelector("#MediaButton") || p(), document.querySelector("._aaqy") && !document.querySelector("._aaqy").querySelector("#MediaButton") && function() {
  488. var e = new t(document.querySelector("._aaqy")),
  489. o = new t("button", {
  490. id: "MediaButton"
  491. }).set("innerText", "Get Images").on("click", m),
  492. n = new t("button", {
  493. id: "MediaButton2"
  494. }).set("innerText", "Get Videos").on("click", d);
  495. e.append(o, n)
  496. }()
  497. }))
  498. }
  499. }), void console.log("Insta ballz")
  500. }
  501. if ("sclouddownloader.net" == document.domain)(async function() {
  502. var e = _getV("sc");
  503. async function t(e, t) {
  504. let o = e => new Promise((t => setTimeout(t, e)));
  505. return await new Promise((async(n, l) => {
  506. var c = !1;
  507. setTimeout((() => (c = 0, l())), t);
  508. for (; !document.querySelector(e);)
  509. if (await o(), c) {
  510. l();
  511. break
  512. }
  513. return n()
  514. })).then((e => !0), (e => !1))
  515. }
  516. if ("/download-sound-track" == location.pathname) {
  517. for (await t("#trackTitle"); !trackTitle.innerText.length;) await h(0);
  518. for (await t("#trackLink"); !trackLink.href.length;) await h(0);
  519. var o = {
  520. name: trackTitle.innerText,
  521. href: trackLink.href
  522. };
  523. console.log(o), _setV("SCinfo", o), close()
  524. } else {
  525. if (!_getV("SC")) throw "Bruv";
  526. var n = "#urlInput";
  527. if (await t(n, 2e3), await t(n, 2e3)) {
  528. for (document.querySelector(n).value = e, console.log("EZ url", !!window.formSubmit);
  529. "undefined" == typeof formSubmit;) {
  530. document.querySelector(n).value = e;
  531. try {
  532. await h(0), console.log("EZ url", formSubmit)
  533. } catch {}
  534. }
  535. console.log("EZ url", formSubmit), formSubmit(), console.warn("Got"), setInterval((() => {
  536. document.querySelector(n).value = e, formSubmit()
  537. }), 1e3)
  538. }
  539. }
  540. })().then(console.log, console.warn);
  541. else {
  542. if ("y2mate.nu" == document.domain) {
  543. location.pathname.split("/")[1] != GM_getValue("y2mate.nu") && (GM_setValue("y2mate.nu", location.pathname.split("/")[1]), console.warn("updated"));
  544. let Z = new URL(location.href).searchParams.get("v"),
  545. Y = 1 == new URL(location.href).searchParams.get("s"),
  546. J = new URL(location.href).searchParams.get("mp4"),
  547. ee = new URL(location.href).searchParams.get("useT"),
  548. te = Z + J + ee;
  549. const oe = e => new Promise((t => setTimeout(t, e)));
  550. async function g(e, t = 5e3) {
  551. let o = !1;
  552. for (setTimeout((() => {
  553. console.log("TimeOut for", e), o = !0
  554. }), t); !document.querySelector(e) && (console.log("_", e, o), await oe(500), !o););
  555. if (console.log(e, o), o) throw "NotFound";
  556. return document.querySelector(e)
  557. }
  558. let ne = document.createElement;
  559. return document.createElement = function(e, t) {
  560. let o = ne.call(document, e, t);
  561. return o._click = o.click, o.click = function() {
  562. if (console.log(o, "was clicked", o.tagName), "A" == o.tagName) {
  563. console.log("Caught", o);
  564. let e = o.download,
  565. t = o.href;
  566. f = {
  567. id: Z,
  568. href: t,
  569. title: e
  570. }, (opener || window).postMessage(f, "*")
  571. } else o._click.apply(o)
  572. }, console.log(o, "was created", o.tagName), o
  573. }, void async function() {
  574. for (;
  575. "complete" != document.readyState;) await oe(0);
  576. if (Z) {
  577. let e = async e => {
  578. console.log("a", e);
  579. var t = findhref2(document.forms[0])[0].href,
  580. o = findhref2(document.forms[0], "div")[0].innerText,
  581. n = {
  582. _: te,
  583. id: Z,
  584. href: t,
  585. title: o,
  586. length: {}
  587. };
  588. console.log("Posted", n), (opener || window.parent).postMessage(n, "*"), close()
  589. };
  590. try {
  591. await g("#video").then((e => {
  592. console.log("e", e), e.value = Y ? `https://www.youtube.com/watch?v=${Z}` : `https://www.youtube.com/shorts/${Z}`, document.querySelector('[type="submit"]').click()
  593. })).catch(e), console.log("after url"), dl = download, download = function(e) {
  594. dl(e);
  595. var t = e + "&s=3&v=" + gVideo + "&f=" + gFormat + "&_=" + Math.random();
  596. if (t && t.length) {
  597. console.log("Lets goooo got:", {
  598. url: t
  599. });
  600. let e = {
  601. href: t,
  602. useT: !1,
  603. _: te,
  604. id: Z
  605. };
  606. (opener || window.parent).postMessage(e, "*"), close()
  607. }
  608. }, console.log("b")
  609. } catch (e) {
  610. console.warn("Error:", e)
  611. }
  612. } else console.warn("No id Found")
  613. }().then(console.log, console.warn)
  614. }
  615. if ("qdownloader.cc" == document.domain) {
  616. const le = e => new Promise((t => setTimeout(t, e)));
  617. async function g(e, t = 2e4) {
  618. let o = !1;
  619. for (setTimeout((() => {
  620. console.log("TimeOut for", e), o = !0
  621. }), t); !document.querySelector(e) && (console.log("_", e, o), await le(500), !o););
  622. if (console.log(e, o), o) throw "NotFound";
  623. return document.querySelector(e)
  624. }
  625. let ce = document.createElement;
  626. document._createElement = function(e, t) {
  627. let o = ce.call(document, e, t);
  628. return o._click = o.click, o.click = function() {
  629. if (console.log(o, "was clicked", o.tagName), "A" == o.tagName) {
  630. console.log("Caught", o);
  631. let e = o.download,
  632. t = o.href;
  633. f = {
  634. id: new URL(location.href).searchParams.get("v"),
  635. href: t,
  636. title: e
  637. }
  638. } else o._click.apply(o)
  639. }, console.log(o, "was created", o.tagName), o
  640. }, async function() {
  641. if (location.href.includes("vidbutton")) throw "vidbutton";
  642. GM_setValue("dlbutton", ""), GM_addValueChangeListener("dlbutton", (async function(e, t, o, n) {
  643. console.log({
  644. a: e,
  645. b: t,
  646. c: o,
  647. d: n
  648. }), o.includes("video download successful\ncheck downloads folder") && (await le(1e3), close())
  649. }));
  650. let e = await g("#url"),
  651. t = await g("#downloadBtn");
  652. id_ = new URL(location.href).searchParams.get("v"),
  653. function(e, t) {
  654. ["focus", "input", "change", "blur"].forEach((o => {
  655. let n = new Event(o, {
  656. bubbles: !0,
  657. isTrusted: !0
  658. });
  659. e[`on${o}`] && e[`on${o}`](n), "input" === o && (e.value = t), e.dispatchEvent(n)
  660. }))
  661. }(e, `https://www.youtube.com/watch?v=${id_}`), t.click()
  662. }().then(console.log, (async e => {
  663. "vidbutton" == e && (console.log("Best Quality Video"), await g("#height").then((e => {
  664. height.selectedIndex = height.options.length - 1, dlbutton.click(), open = window.open, window.open = function(e, t, o) {
  665. console.log({
  666. a: e,
  667. b: t,
  668. c: o
  669. })
  670. }, g("#dlbutton").then((e => {
  671. var t = "";
  672. setInterval((o => {
  673. t != e.innerText && (t = e.innerText, GM_setValue("dlbutton", t))
  674. }))
  675. }))
  676. })))
  677. }))
  678. } else {
  679. if ("snapsave.io" == document.domain) {
  680. async function g(e, t = 2e4) {
  681. let o = !1;
  682. for (setTimeout((() => {
  683. console.log("TimeOut for", e), o = !0
  684. }), t); !document.querySelector(e) && (console.log("_", e, o), await h(500), !o););
  685. if (console.log(e, o), o) throw "NotFound";
  686. return document.querySelector(e)
  687. }
  688. return _wfs = g, void async function() {
  689. var e = await g("#s_input");
  690. if (e) {
  691. console.log("Converting"), id_ = new URL(location.href).searchParams.get("v"), e.value = `https://www.youtube.com/watch?v=${id_}`, ksearchvideo(), setTimeout(ksearchvideo(), 1e3);
  692. var t = await g("#formatSelect");
  693. await g("#btn-action");
  694. t.selectedIndex = 0, t.options[0].selected = !0;
  695. for (var o = await g("#asuccess"); !(o = await g("#asuccess"));) await h(0);
  696. for (convertFile(0);
  697. "#" == o.getAttribute("href");) await h(0), o = await g("#asuccess");
  698. console.log(o.href);
  699. var n = (await _wfs(".clearfix")).querySelector("h3").innerText,
  700. l = {
  701. id: id_,
  702. href: o.href,
  703. title: n,
  704. length: {}
  705. };
  706. console.log("Posted", l), (opener || window).postMessage(l, "*")
  707. } else alert("Input was not Found"), console.warn("?!!")
  708. }().then(console.log).catch(console.warn)
  709. }
  710. if ("clips.twitch.tv" == document.domain) {
  711. let ie = 1;
  712. const re = e => new Promise((t => setTimeout(t, e)));
  713. async function g(e, t = 2e4) {
  714. let o = !1;
  715. for (setTimeout((() => {
  716. console.log("TimeOut for", e), o = !0
  717. }), t); !document.querySelector(e) && (console.log("_", e, o), await re(500), !o););
  718. if (console.log(e, o), o) throw "NotFound";
  719. return document.querySelector(e)
  720. }
  721. _wfs = g, _copyElm = function(e) {
  722. if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
  723. const t = document.createElement(e.tagName);
  724. for (let o of e.attributes) t.setAttribute(o.name, o.value);
  725. return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
  726. }, async function() {
  727. location.href;
  728. let e = (await _wfs(".ScCoreButtonLabel-sc-s7h2b7-0")).parentElement.parentElement.parentElement.parentElement;
  729. new _e(_copyElm(e)).on("click", (function() {
  730. var e;
  731. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "1080")
  732. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "1080P", new _e(_copyElm(e)).on("click", (function() {
  733. var e;
  734. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "720")
  735. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "720P", new _e(_copyElm(e)).on("click", (function() {
  736. var e;
  737. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "480")
  738. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "480P", new _e(_copyElm(e)).on("click", (function() {
  739. var e;
  740. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "360")
  741. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "360P", new _e(_copyElm(e)).on("click", (function() {
  742. var e;
  743. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "VOD")
  744. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "VOD";
  745. var t;
  746. ie && (setTimeout((() => {
  747. close()
  748. }), 200), open((e => e.href)(((t = new URL(location.href)).host = "clipr.xyz", t)), "1080"))
  749. }().catch(console.warn)
  750. } else {
  751. if ("www.twitch.tv" == document.domain) {
  752. var w;
  753. return void setInterval((() => {
  754. w != location.href && async function() {
  755. let [e, t, o, n] = location.pathname.split("/");
  756. if ("clip" != o) return console.warn("User isnt wathcing a clip");
  757. console.log("User is Watching a CLip");
  758. const l = e => new Promise((t => setTimeout(t, e)));
  759. async function c(e, t = 2e4) {
  760. let o = !1;
  761. for (setTimeout((() => {
  762. console.log("TimeOut for", e), o = !0
  763. }), t); !document.querySelector(e) && (console.log("_", e, o), await l(500), !o););
  764. if (console.log(e, o), o) throw "NotFound";
  765. return document.querySelector(e)
  766. }
  767. _wfs = c, _wfs_ = c, _copyElm = function(e) {
  768. if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
  769. const t = document.createElement(e.tagName);
  770. for (let o of e.attributes) t.setAttribute(o.name, o.value);
  771. return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
  772. }, await async function() {
  773. location.href, await _wfs(".Layout-sc-1xcs6mc-0.bMOhzu");
  774. let l = [...document.querySelectorAll(".Layout-sc-1xcs6mc-0 .bMOhzu")].filter((e => e.querySelector("button") && !e.querySelector("button").disabled))[0];
  775. [{
  776. label: "1080P",
  777. resolution: "1080"
  778. }, {
  779. label: "720P",
  780. resolution: "720"
  781. }, {
  782. label: "480P",
  783. resolution: "480"
  784. }, {
  785. label: "360P",
  786. resolution: "360"
  787. }, {
  788. label: "VOD",
  789. resolution: "VOD"
  790. }].forEach((({
  791. label: c,
  792. resolution: i
  793. }) => {
  794. let r = new _e(_copyElm(l)).on("click", (function() {
  795. var l;
  796. [e, t, o, n] = location.pathname.split("/"), open((e => e.href)(((l = new URL(location.href)).host = "clipr.xyz", l)), i)
  797. })).appendTo(document.querySelector(".Layout-sc-1xcs6mc-0.hZUoPp"));
  798. "VOD" === i ? r.element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = c : r.element.querySelector(".bFxzAY").innerText = c
  799. }))
  800. }().catch(console.warn)
  801. }(), w = location.href
  802. }), 100)
  803. }
  804. if ("clipr.xyz" == document.domain) {
  805. async function g(t, o = 2e4) {
  806. let n = !1;
  807. for (setTimeout((() => {
  808. e.log(`TimeOut for ${t}`), n = !0
  809. }), o); !document.querySelector(t) && (e.log(`_ ${t} ${n}`), await h(500), !n););
  810. if (e.log(`${t} ${n}`), n) throw "NotFound";
  811. return document.querySelector(t)
  812. }
  813.  
  814. function h(e) {
  815. return new Promise((t => setTimeout(t, e)))
  816. }
  817.  
  818. function y(e, t) {
  819. const o = document.createElement("a");
  820. o.href = e, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o)
  821. }
  822. return void async function() {
  823. let t = name;
  824. await async function() {
  825. for (;
  826. "complete" != document.readyState;) await h(0);
  827. return !0
  828. }(), e.log("Loaded");
  829. let o = ((e = {}) => ([...document.querySelectorAll(".flex.items-center.space-x-4")].filter((e => findhref2(e)[0])).filter((e => findhref2(e)[0].href.includes("clips.twitchcdn.net"))).forEach((t => {
  830. e[t.querySelector(".space-x-1").innerText.replace("p", "")] = findhref2(t)[0].href
  831. })), e))()[t];
  832. e.log(1);
  833. 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;
  834. e.log(2);
  835. let l = 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;
  836. e.log(3);
  837. let c = `@${n} on Twitch | ${l} - ${t}P.mp4`;
  838. e.log(`Downloading file as: ${c}`), open(o), e.log(4), await h(4e3), close()
  839. }().catch(console.warn)
  840. }
  841. if (location.href.includes("tubemp4.is")) {
  842. async function g(e, t = 3e4) {
  843. var o;
  844. for (h(t).then((e => o = !0)); !document.querySelector(e) && (await h(0), !o););
  845. return document.querySelector(e)
  846. }
  847. console.log("ok"), g("#u").then((async e => {
  848. e.value = `https://www.youtube.com/watch?v=${new URL(location.href).searchParams.get("v")}`, convert.click(), await h(200), (await g("#convert")).click(), (await g(".process-button")).click(), g(".download-button").then((e => {
  849. let t = document.createElement;
  850. document.createElement = function(e, o) {
  851. let n = t.call(document, e, o);
  852. return n._click = n.click, n.click = function() {
  853. if (console.log(n, "was clicked", n.tagName), "A" == n.tagName) {
  854. console.log("Caught", n);
  855. let e = n.download,
  856. t = n.href;
  857. f = {
  858. id: new URL(location.href).searchParams.get("v"),
  859. href: t,
  860. title: e
  861. }, (opener || window).postMessage(f, "*"), close()
  862. } else n._click.apply(n)
  863. }, console.log(n, "was created", n.tagName), n
  864. }, e.click(), console.log("clicked"), setTimeout((() => e.click()), 1e3)
  865. }))
  866. })).then(console.log, console.warn)
  867. }
  868. }
  869. }
  870. }
  871. }
  872. var v, b;
  873.  
  874. function y(e, t) {
  875. const o = document.createElement("a");
  876. o.href = e, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o)
  877. }
  878.  
  879. function k(e, t = "aria-label", o = document.body) {
  880. var n = [];
  881. return function o(l) {
  882. var c = !1;
  883. t ? l.getAttribute(t) == e && (n.push(l), c = 1) : [...l.attributes].map((e => {
  884. const {
  885. name: t,
  886. value: o
  887. } = e;
  888. return {
  889. name: t,
  890. value: o
  891. }
  892. })).filter((t => t.value == e)).length && (n.push(l), c = 1), l.children.length && !c && ((l = l.children).forEach = [].forEach, l.forEach((e => {
  893. o(e)
  894. })))
  895. }(o), n.length ? 1 == n.length ? n[0] : n || !1 : null
  896. }
  897. console.log("B?"), _getIds = function() {
  898. if (document.domain.includes("music")) throw alert("These button dont work on youtube music yet"), ".";
  899. var e = [...document.getElementsByTagName("ytd-playlist-panel-renderer")].filter(n).filter((e => !r(e)))[0];
  900. return findhref2(e, "span").filter((e => !r(e))).filter(n).filter((e => "video-title" == e.id)).map(a).map(a).map((e => ({
  901. id: setElement(findhref2(a(e))[0].href),
  902. e: e
  903. })))
  904. }, info = {}, downloadT = function(e, t = !1, n = !0, l = !1, c = !1, i = "") {
  905. let r = e + (l ? "mp4" : "mp3") + n;
  906. var a;
  907. if (!(a = document.getElementById(r)) || a.remove(), localStorage[r] && !t && (!c || !confirm(`You have already download this video as .${l?"mp4":"mp3"}\nStill download?`))) return;
  908. let s = i || location;
  909. var u = new URL(location.href);
  910. u.host = u.host.replace(".com", "mz.com"), console.log("o", u);
  911. let d = ["https://y2mate.nu/" + (GM_getValue("y2mate.nu") || "0HzX") + "/", "?v=", e, "&s=", u.pathname.startsWith("/shorts/") ? 1 : 0, "&mp4=", l ? "mp4" : "mp3", "&useT=", n];
  912. console.log(r, d);
  913. return function(e, t, o = !1) {
  914. var n = addEventListener(e, ((...e) => {
  915. t(...e), o && removeEventListener(n)
  916. }), !0)
  917. }("unload", (function() {
  918. info[e].close()
  919. }), !0), onmessage = function(e) {
  920. 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 || "https://tubemp4.is" == e.origin) {
  921. const {
  922. data: {
  923. href: t,
  924. title: o,
  925. length: c,
  926. id: i,
  927. _: r
  928. }
  929. } = e;
  930. let a = o + (l ? ".mp4" : ".mp3");
  931. (e => {
  932. e && e.remove()
  933. })(document.getElementById(r)), console.log("Handled", {
  934. href: t,
  935. title: o,
  936. length: c,
  937. id: i,
  938. _: r
  939. }, e), E.set("innerText", "Get MP3"), E.set("disabled", !1), n ? (console.log("Getting video"), y(t, a)) : open(t), localStorage[r] = t
  940. } else console.log("Unhandled Post", e)
  941. }, info[e] = l ? open(s.pathname.startsWith("/shorts/") ? "https://yt5s.biz/enxj100/" : `https://qdownloader.cc/youtube-video-downloader.html?v=${e}`, [e, s.pathname.startsWith("/shorts/") ? 1 : 0, l + !1], "width=400,height=500") : !open(d.join(""), [e, s.pathname.startsWith("/shorts/") ? 1 : 0, l + !1], "width=400,height=500")
  942. }, downloadTikTok = function(e, t) {
  943. (async function(e, t) {
  944. await async function() {
  945. for (; b && !b.closed;) await h(0);
  946. return 1
  947. }(), console.log("ez");
  948. let n = t.videoID,
  949. l = t.username,
  950. c = function() {
  951. try {
  952. 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 ", "")
  953. } catch {
  954. try {
  955. 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 ", "")
  956. } catch (e) {
  957. return k("browse-video-desc", "data-e2e") ? k("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 ", "")
  958. }
  959. }
  960. }();
  961. onmessage = function(e) {
  962. 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) {
  963. var {
  964. data: {
  965. href: t,
  966. links: n,
  967. title: l,
  968. length: i,
  969. id: r,
  970. mp4: a,
  971. info: {
  972. username: s
  973. }
  974. }
  975. } = e;
  976. if (console.log("Handled", {
  977. href: t,
  978. title: l,
  979. length: i,
  980. id: r,
  981. links: n,
  982. mp4: a
  983. }, e), "https://savetik.co" == e.origin) l = c, y(a ? n[0] : n.pop(), s + " - " + l + (a ? ".mp4" : ".mp3"), b);
  984. else {
  985. if (useT) {
  986. let e = document.createElement("a");
  987. e.download = l + ".mp3", e.href = t, document.body.appendChild(e), e.click(), e.remove()
  988. } else open(t);
  989. localStorage[_] = t
  990. }
  991. } else console.log("Unhandled Post", e)
  992. }, b = open("https://savetik.co/en", [`https://www.tiktok.com/${l}/video/${n}`, e + !1], "width=400,height=500")
  993. })(e, t).then(console.log, console.warn)
  994. }, abc_ = k, M = function() {
  995. (k("Mute", "title") && k("Mute", "title")[0] || k("Mute (m)", "title")).click()
  996. }, Um = function() {
  997. (c("#right-controls") && "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" == c("#right-controls").querySelectorAll("path")[0].getAttribute("d") && k("Mute", "title")[0] || k("Unmute", "title") || k("Unmute (m)", "title")).click()
  998. };
  999. var T = 0;
  1000.  
  1001. function S(e) {
  1002. return !!e && !e.closed
  1003. }
  1004. async function x(e = [
  1005. ["w1", "win1"],
  1006. ["w2", "win2"],
  1007. ["w3", "win3"],
  1008. ["w4", "win4"]
  1009. ]) {
  1010. var t, o = !1;
  1011. return await new Promise(((n, l) => {
  1012. var c = setInterval((l => {
  1013. e.forEach((e => {
  1014. this[e[0]] = S(window[e[1]]), window[e[1]] || o || (o = !0, t = e[1], console.log(e))
  1015. })), t && (n(t), clearInterval(c))
  1016. }), 500)
  1017. })), t
  1018. }
  1019. window.ch3 = S, window.getWin = x, WIP_ = function(e, t, o) {
  1020. if (!t) return alert("This button is corrently broken");
  1021. var n = _getIds(),
  1022. l = [];
  1023. for (let t = 0; t < e; t++) l.push(["w" + t, "win" + t]);
  1024. n.forEach((({
  1025. id: e
  1026. }, n) => {
  1027. x(l).then((l => {
  1028. if (!info[e] && !localStorage[e] || o) {
  1029. console.log("download", e, n), window[l] = downloadT(e, o, !0, !!t), window.addEventListener("unload", (function(e) {
  1030. window[l].close()
  1031. }));
  1032. var c = setInterval((e => {
  1033. window[l] && !window[l].closed || (window[l] = null, clearInterval(c), console.log(l, "isclosed"))
  1034. }), 300)
  1035. }
  1036. }))
  1037. }))
  1038. };
  1039. var E = new t("button").set("innerText", "Get MP3").on("click", (function(e) {
  1040. E.set("innerText", "Wait..."), E.set("disabled", !0), downloadT(setElement(location.href), !0, !0, !1, !0)
  1041. })),
  1042. q = new t("button").set("innerText", "Get MP4").on("click", (function(e) {
  1043. downloadT(setElement(location.href), !0, !0, !0, !0)
  1044. })),
  1045. C = new t("button").set("innerText", "PlayList MP3").on("click", (function(e) {
  1046. WIP_(2, !1, !1)
  1047. })),
  1048. L = new t("button").set("innerText", "PlayList MP4").on("click", (function(e) {
  1049. WIP_(2, !0, !1)
  1050. })),
  1051. P = new t("button").set("innerText", "Get MP4").on("click", (function(e) {
  1052. downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1053. })).style({
  1054. color: "blue"
  1055. }),
  1056. A = (new t("button", {
  1057. id: "tt1"
  1058. }).set("innerText", "Get MP4").on("click", (function(e) {
  1059. downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1060. })).style({
  1061. color: "blue"
  1062. }), new t("button").set("innerText", "Get MP3").on("click", (function(e) {
  1063. downloadTikTok(!1, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1064. })).style({
  1065. color: "blue"
  1066. }));
  1067.  
  1068. function I() {
  1069. return document.querySelector("#end") || document.querySelector("#right-content")
  1070. }
  1071. if (console.log("bruh"), a1 = [
  1072. ["youtube", function() {
  1073. i((function() {
  1074. I();
  1075. if (!I()) throw "Cant append buttons yet";
  1076. return console.log("Posting"),
  1077. function() {
  1078. const e = I();
  1079.  
  1080. function o() {
  1081. try {
  1082. return !(![...document.querySelectorAll("#header-description")].filter(n).filter((e => !r(e)))[0] && !c(".autoplay")) && ([...document.querySelectorAll("#header-description")].filter(n).filter((e => !r(e)))[0] || c(".autoplay"))
  1083. } catch (e) {
  1084. return !1
  1085. }
  1086. }
  1087. console.log(e), E.appendTo(e), q.appendTo(e), console.log("Posted Buttons");
  1088. var l = !1;
  1089. setInterval((() => {
  1090. l != o() && o() ? (console.log("Added playlist buttons"), setTimeout((() => {
  1091. o().append(t.br.element), o().append(C.element), o().append(L.element)
  1092. }), 100)) : l == o() || o() || console.log("buttons are gone?!?!"), l = o()
  1093. }), 100)
  1094. }()
  1095. }), {
  1096. callback: function() {}
  1097. })
  1098. }],
  1099. ["tiktok", function() {
  1100. addEventListener("load", (function() {
  1101. i((function() {
  1102. if (!abc_("browse-copy", "data-e2e")) throw "Cant Append";
  1103. P.appendTo(document.querySelectorAll(".e1mecfx011")), A.appendTo(document.querySelectorAll(".e1mecfx011"))
  1104. }), {
  1105. callback: function() {}
  1106. }), i((function() {
  1107. if (!document.getElementsByClassName("e13wiwn60")[0]) throw "Cant Append";
  1108.  
  1109. function e() {
  1110. try {
  1111. return !!abc_("browse-copy", "data-e2e").parentNode && abc_("browse-copy", "data-e2e").parentNode
  1112. } catch (e) {
  1113. return !1
  1114. }
  1115. }
  1116. P.appendTo(document.getElementsByClassName("e13wiwn60")[0]), A.appendTo(document.getElementsByClassName("e13wiwn60")[0]), console.log("Posted Buttons");
  1117. var o = !1;
  1118. setInterval((() => {
  1119. o != e() && e() ? (console.log("Added playlist buttons"), setTimeout((() => {
  1120. e().append(t.br.element), e().append(P.element), e().append(A.element)
  1121. }), 100)) : o == e() || e() || console.log("buttons are gone?!?!"), o = e()
  1122. }), 100)
  1123. }), {
  1124. callback: function() {}
  1125. })
  1126. }))
  1127. }]
  1128. ].filter((e => location.host.includes(e[0])))[0], a1 && a1[1] && a1[1](), console.log(a1), delete a1, __ex_ = I, location.href.includes("onlymp3.app") || location.href.includes("onlymp3.to")) {
  1129. console.log("onlymp3.app");
  1130. return setInterval((() => {
  1131. document.getElementById("error-text").innerText.length > 5 && location.reload()
  1132. }), 2e4), console.log("Getting MP3"), void i((function(e = function() {}) {
  1133. ! function() {
  1134. var [e, t] = name.split(",");
  1135. txtUrl.value = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`, getListFormats()
  1136. }(), i((function(e = function() {}) {
  1137. ! function() {
  1138. var e = videoTitle.innerText.split("\n"),
  1139. t = e.map((e => e.match(/[:\d]+/gi))).filter((e => !!e)).pop().pop(),
  1140. o = e[0].split("Title: ")[1],
  1141. n = findhref2(videoTitle.parentNode)[0].href,
  1142. l = {
  1143. id: setElement(location.href),
  1144. href: n,
  1145. title: o,
  1146. length: t
  1147. };
  1148. (opener || window).postMessage(l, "*"), console.log("Poasted")
  1149. }()
  1150. }), {
  1151. callback: close
  1152. })
  1153. }), {
  1154. callback: function() {}
  1155. })
  1156. }
  1157. if (location.href.includes("www.yt2conv.com")) {
  1158. console.log("Getting MP4");
  1159. let [ae, se] = name.split(",");
  1160. i((function(e = function() {}) {
  1161. document.getElementById("search_txt").value = `https://www.youtube.com/${"1"==se?"shorts/":"watch?v="}${ae}`, document.getElementById("btn-submit").click(), console.log(ae, se)
  1162. }), {
  1163. callback: function() {}
  1164. }), i((function(e = function() {}) {
  1165. if (console.log(result.children.length), !result.children.length) throw document.getElementById("btn-submit").click(), "no there"
  1166. }), {
  1167. int: 1e3,
  1168. callback: function() {}
  1169. }), i((function() {
  1170. document.getElementById("btn-download").click()
  1171. }), {
  1172. callback: function() {}
  1173. }), i((function() {
  1174. var e = $(".media-heading")[0].innerText,
  1175. t = downloadbtn.href,
  1176. o = {
  1177. id: ae,
  1178. href: t,
  1179. title: e,
  1180. length: {}
  1181. };
  1182. console.log("Posted"), (opener || window).postMessage(o, "*")
  1183. }), {
  1184. callback: close
  1185. })
  1186. } else if (location.href.includes("yt5s.biz")) {
  1187. async function g(e) {
  1188. for (; !document.querySelector(e);) await h(0);
  1189. return !0
  1190. }(async function() {
  1191. let [e, t] = name.split(",");
  1192. if (!e.length || !t.length) return console.warn("No info Preset");
  1193. var o = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`;
  1194. await g("#txt-url"), console.log("Input Loaded"), document.querySelector("#txt-url").value = o, await g("#btn-submit"), console.log("GEtting res"), await h(100), document.querySelector("#btn-submit").click(), await g("#video_title"), console.log("Got Res");
  1195. var n = document.querySelector("#video_title").innerText,
  1196. l = [0];
  1197. return [...document.querySelector("#result").querySelector("table").querySelectorAll("tr")].forEach((e => {
  1198. var t = e.innerText.match(/(?<res>\d+)(p|P)/i) || {};
  1199. t.groups && (t = Number(t.groups.res), l[0] < t && (l[0] = t, l[1] = findhref2(e)[0].href, l[2] = e))
  1200. })), {
  1201. id: e,
  1202. title: n,
  1203. href: l[1],
  1204. mp4: !0,
  1205. res: l[0]
  1206. }
  1207. })().then((function(e) {
  1208. (opener || window).postMessage(e, "*"), location.href = e.href
  1209. }), console.warn)
  1210. } else if (location.href.includes("sss.instasaverpro.com"))(async function() {
  1211. for (await async function(e) {
  1212. for (; !document.querySelector(e);) await h(0);
  1213. return !0
  1214. }("#A_downloadUrl"); !document.querySelector("#A_downloadUrl").href.length;) await h(0);
  1215. console.log("Done");
  1216. var e = document.querySelector("#myModalLabel").innerText,
  1217. t = {
  1218. href: document.querySelector("#A_downloadUrl").href,
  1219. title: e
  1220. };
  1221. (opener || window).postMessage(t, "*")
  1222. })().then(close, console.warn);
  1223. else if (location.href.includes("en3.onlinevideoconverter.pro")) {
  1224. let [ue, de] = name.split(",");
  1225. if (!ue.length || !de.length) return console.Warn("NO info Preset");
  1226. let me = function() {};
  1227. i((function(e = function() {}) {
  1228. document.getElementById("texturl").value = `https://www.youtube.com/${"1"==de?"shorts/":"watch?v="}${ue}`, document.getElementById("convert1").click(), console.log("Searched")
  1229. }), {
  1230. callback: me
  1231. }), i((function() {
  1232. if ("none" == stepProcess.style.display) throw document.getElementById("convert1").click(), "this";
  1233. console.log("Searching")
  1234. }), {
  1235. callback: me
  1236. }), i((function() {
  1237. if (0 == document.getElementById("form-app-root").children.length) throw "";
  1238. console.log("loaded");
  1239. var {
  1240. title: e,
  1241. href: t
  1242. } = $("#download-720-MP4") && $("#download-720-MP4")[0] ? $("#download-720-MP4")[0] : $("#download-720-MP4"), o = {
  1243. id: ue,
  1244. href: t,
  1245. title: e,
  1246. length: {}
  1247. };
  1248. console.log("Posted"), (opener || window).postMessage(o, "*")
  1249. }), {
  1250. callback: close
  1251. })
  1252. } else if (location.href.includes("savetik.co")) {
  1253. var [U, N] = name.split(",");
  1254. addEventListener("load", (function() {
  1255. i((function() {
  1256. s_input.value = U, ksearchvideo(), setTimeout(ksearchvideo, 1e3)
  1257. }), {
  1258. callback() {}
  1259. })
  1260. })), i((function() {
  1261. document.getElementsByClassName("clearfix")[0].innerText,
  1262. function() {
  1263. console.log("Found");
  1264. let e = {
  1265. title: document.getElementsByClassName("clearfix")[0].innerText,
  1266. links: findhref2(document.getElementsByClassName("tik-video")[0]).map((e => e.href)),
  1267. mp4: 1 == N,
  1268. info: setElement2(U)
  1269. };
  1270. onmessage = function(e) {
  1271. if ("https://www.tiktok.com" == e.origin) {
  1272. var {
  1273. data: {
  1274. s: t,
  1275. url: o,
  1276. title: n
  1277. }
  1278. } = e;
  1279. console.log("Handled", {
  1280. s: t,
  1281. url: o,
  1282. title: n
  1283. }, e), t ? setTimeout(close, 100) : y(o, n, null, close)
  1284. } else console.log("Unhandled Post", e)
  1285. }, (opener || window).postMessage(e, "*")
  1286. }()
  1287. }), {
  1288. callback() {}
  1289. })
  1290. } else document.domain.includes("music") ? (console.log("Added MiniPlayer Toggle with I"), addEventListener("keypress", (function({
  1291. isTrusted: e,
  1292. ctrlKey: t,
  1293. shiftKey: o,
  1294. code: n,
  1295. target: l,
  1296. target: {
  1297. tagName: c
  1298. }
  1299. }) {
  1300. ["INPUT", "TEXTAREA"].includes(c) || t || o || !e || "KeyI" != n || (abc_("Close player page") || abc_("Open player page")[1]).click()
  1301. }))) : document.domain.includes("loader.to") && location.href.includes("/api/") && console.warn("using loader.to api");
  1302. const B = window.trustedTypes && trustedTypes.createPolicy("trustedHTMLPolicy", {
  1303. createHTML: e => e,
  1304. createScriptURL: e => e
  1305. }),
  1306. R = "\n /* Default iframe styles */\n #cardApiIframe {\n width: 100%;\n height: 100%;\n transition: all 2.5s ease-in-out;\n }\n\n /* Collapse animation when the class is toggled */\n .collapse-frame {\n width: 0;\n height: 0;\n margin-left: auto;\n margin-right: auto;\n transition: all 2.5s ease-in-out;\n }\n",
  1307. z = document.createElement("style");
  1308.  
  1309. function G(e) {
  1310. const t = j.element;
  1311. e ? t.classList.add("collapse-frame") : t.classList.remove("collapse-frame")
  1312. }
  1313. z.type = "text/css", z.appendChild(document.createTextNode(B ? B.createHTML(R) : R));
  1314. var V = `https://www.youtube.com/watch?v=${setElement(location.href)}&adUrl=https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A?sub_confirm=1`,
  1315. D = B ? B.createScriptURL("https://loader.to/api/card2/?url=" + V) : "https://loader.to/api/card2/?url=" + V;
  1316. const j = new _element("iframe", {
  1317. id: "cardApiIframe",
  1318. scrolling: "no",
  1319. width: "100%",
  1320. height: "100%",
  1321. allowtransparency: "true",
  1322. style: "border: none",
  1323. src: D
  1324. }),
  1325. O = new _element("script", {
  1326. src: B ? B.createScriptURL("https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.min.js") : "https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.min.js"
  1327. });
  1328. O.element.addEventListener("load", (() => {
  1329. "function" == typeof iFrameResize ? iFrameResize({
  1330. log: !1
  1331. }, "#cardApiIframe") : console.error("iFrameResize function not available")
  1332. }));
  1333. const F = new _element("div").append(j, O);
  1334. document.querySelector("#secondary.ytd-watch-flexy");
  1335. var W = setElement(location.href);
  1336. j.element.addEventListener("load", (() => {
  1337. console.log("Iframe is fully loaded"), G(!1)
  1338. })), G(!0);
  1339. var H = 0,
  1340. Q = 1,
  1341. K = 0,
  1342. X = 0;
  1343. setInterval((e => {
  1344. const t = document.querySelector("video"),
  1345. o = document.querySelector("#video-companion-root") || document.querySelector("#secondary-inner") || document.querySelector("#secondary.ytd-watch-flexy");
  1346. V = `https://www.youtube.com/watch?v=${setElement(location.href)}&adUrl=https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A?sub_confirm=1`, D = B ? B.createScriptURL("https://loader.to/api/card2/?url=" + V) : "https://loader.to/api/card2/?url=" + V, o && (!o.querySelector("#cardApiIframe") && (G(!0), o.parentNode.prepend(z), o.prepend(F.element), console.log("Added That Thing")), setElement(location.href) != W && (G(!0), j.set("src", D), console.log("Fixed That Thing"), W = setElement(location.href)));
  1347. const n = c("yt-button-view-model#dismiss-button");
  1348. n && !r(n) && n.click();
  1349. const l = document.getElementsByClassName("ytp-ad-button-icon")[0];
  1350. try {
  1351. if (l && !T) console.log("Muted ad"), console.log("Started at", tr), T = 1, t.playbackRate = t.duration / 7, t.muted = 1;
  1352. else if (!l && T) {
  1353. console.log("Unmuted video");
  1354. try {
  1355. t.muted = 0
  1356. } catch (e) {
  1357. console.warn("Failed unmuting")
  1358. }
  1359. T = 0
  1360. }
  1361. } catch {}!T && document.querySelector("video") && (tr = document.querySelector("video") && document.querySelector("video").currentTime.toFixed());
  1362. const i = [...document.querySelectorAll("#song-video"), ...document.querySelectorAll("#ytd-player")].map((e => [...e.querySelectorAll("button")].filter((e => e.className.includes("skip")))[0])).filter((e => !!e))[0];
  1363. i || document.querySelectorAll(".ytp-ad-button-icon")[0] ? (K && t.playbackRate == t.duration / 7 || (K = 1, console.log("Skipping ad :>")), i && i.click(), Q = 0) : !Q && t ? (K = 0, Q = 1, t.playbackRate = H > 2 ? 1 : H, console.log("Fixed playBack")) : t && (K = 0, (H = t.playbackRate) > 2 && (t.playbackRate = 1));
  1364. const a = document.getElementsByClassName("ytp-ad-overlay-close-button")[2];
  1365. a && (a.click(), console.log("Closed ad card"));
  1366. let s = [...document.querySelectorAll(".yt-spec-button-shape-next")].filter((e => e.innerText.includes("Ads")))[0];
  1367. s && (s.click(), !X && location.href.includes("watch") && (X = 1, location.reload()))
  1368. }), 10)
  1369. }()
  1370. }();

QingJ © 2025

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