Gaston's - Video/Image Downloader

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

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

  1. // ==UserScript==
  2. // @name Gaston's - Video/Image Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 7.8
  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 *://production.assets.clips.twitchcdn.net/*
  11. // @match *://www.instagram.com/*
  12. // @match *://music.youtube.com/*
  13. // @match *://y2mate.nu/*
  14. // @match *://www.twitch.tv/*
  15. // @match *://snapinsta.app/*
  16. // @match *://loader.to/*
  17. // @match *://onlymp3.app/*
  18. // @match *://qdownloader.cc/*
  19. // @match *://tubemp4.is/*
  20. // @match *://snapsave.io/*
  21. // @match *://clips.twitch.tv/*
  22. // @match *://twitch.tv/*
  23. // @match *://onlymp3.to/*
  24. // @match *://fastdl.app/*
  25. // @match *://en.onlymp3.app/*
  26. // @match *://clipr.xyz/*
  27. // @match *://studio.youtube.com/*
  28. // @match *://www.yt2conv.com/*
  29. // @match *://soundcloud.com/*
  30. // @match *://sclouddownloader.net/*
  31. // @match *://www.tiktok.com/*
  32. // @match *://en3.onlinevideoconverter.pro/*
  33. // @match *://savetik.co/*
  34. // @match *://yt5s.biz/*
  35. // @match *://sss.instasaverpro.com/*
  36. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  37.  
  38. // @grant GM_info
  39. // @grant GM_xmlhttpRequest
  40. // @grant GM_getValue
  41. // @grant GM_setValue
  42. // @grant GM_deleteValue
  43. // @grant GM_addValueChangeListener
  44. // @grant GM_removeValueChangeListener
  45. // @name:zh Gaston's - Video/Image Downloader
  46. // @name:en Gaston's - Video/Image Downloader
  47. // @name:ar Gaston's - Video/Image Downloader
  48. // @name:ja Gaston's -Video/Image Downloader
  49. // @name:hi गैस्टन - वीडियो/छवि डाउनलोडर
  50. // @name:de Gaston's - Video/Image Downloader
  51. // @name:pt Gaston's - Downloader de vídeo/imagem
  52. // @name:ru Gaston's - Video/Image Скачатель
  53. // @name:fr Gaston's - téléchargeur vidéo / image
  54. // @name:es Gaston's - Video/Image Descarger
  55. // @name:it Gaston's - Downloader di video/immagine
  56. // @name:vi Gaston's - Trình tải xuống video/hình ảnh
  57. // @name:nl Gaston's - Video/Image Downloader
  58. // @name:th Gaston's - Video/Image Downloader
  59. // @name:tr Gaston's - Video/Resim İndirici
  60. // @name:id Gaston's - Video/Image Downloader
  61. // @name:pl Gaston - pobierca wideo/obrazu
  62. // @name:uk GASTON'S - Відео/зображення завантажувача
  63. // @name:ko Gaston 's- 비디오/이미지 다운로더
  64. // @name:ro Gaston's - descărcător video/imagini
  65. // @name:bg Gaston's - видео/изтегляне на изображения
  66. // @name:cs Gaston's - Video/Image Downloader
  67. // @name:no Gaston's - Video/Image Downloader
  68. // @name:hu Gaston's - Videó/kép letöltő
  69. // @name:el Gaston's - Video/Image Downloader
  70. // @name:fi Gaston's - Video/kuvan lataaja
  71. // @name:da Gastons - Video/Image Downloader
  72. // @name:sv Gaston's - Video/Image Downloader
  73. // @name:he Gaston's - הורדת וידאו/תמונה
  74. // @name:sk Gaston's - Video/Image Downloader
  75. // @description:zh Instagram/Twitch/YouTube/TikTok Video/Audio Downloader (frequently updated)
  76. // @description:en Instagram/Twitch/YouTube/TikTok Video/Audio Downloader (frequently updated)
  77. // @description:ru Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (часто обновляется)
  78. // @description:hi Instagram/Twitch/YouTube/Tiktok वीडियो/ऑडियो डाउनलोडर (अक्सर अपडेट किया गया)
  79. // @description:es Instagram/Twitch/YouTube/Tiktok Video/Audio Descarger (frecuentemente actualizado)
  80. // @description:de Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (häufig aktualisiert)
  81. // @description:fr Instagram / twitch / youtube / tiktok vidéo / téléchargeur audio (fréquemment mis à jour)
  82. // @description:ja Instagram/Twitch/YouTube/Tiktokビデオ/オーディオダウンローダー(頻繁に更新)
  83. // @description:ar Instagram/twitch/youtube/tiktok video/audio downloader (تم تحديثه بشكل متكرر)
  84. // @description:pt Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (atualizado com frequência)
  85. // @description:nl Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (vaak bijgewerkt)
  86. // @description:ro Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (actualizat frecvent)
  87. // @description:it Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (frequentemente aggiornato)
  88. // @description:vi Instagram/twitch/youtube/tiktok video/trình tải xuống âm thanh (thường xuyên được cập nhật)
  89. // @description:uk Instagram/twitch/youtube/tiktok відео/аудіо завантажувач (часто оновлений)
  90. // @description:id Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (sering diperbarui)
  91. // @description:tr Instagram/Twitch/YouTube/Tiktok Video/Ses Downloader (sıklıkla güncellendi)
  92. // @description:th Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (อัปเดตบ่อยครั้ง)
  93. // @description:pl Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (często aktualizowany)
  94. // @description:ko Instagram/Twitch/YouTube/Tiktok 비디오/오디오 다운로더 (자주 업데이트)
  95. // @description:sv Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (ofta uppdaterad)
  96. // @description:no Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (ofte oppdatert)
  97. // @description:sk Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (často aktualizované)
  98. // @description:cs Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (často aktualizováno)
  99. // @description:el Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (συχνά ενημερωμένο)
  100. // @description:da Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (ofte opdateret)
  101. // @description:bg Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (често актуализиран)
  102. // @description:hu Instagram/Twitch/YouTube/Tiktok Video/Audio Downloader (gyakran frissítve)
  103. // @description:fi Instagram/twitch/youtube/tiktok video/äänen lataus (päivitetty usein)
  104. // @description:he אינסטגרם/טוויץ '/YouTube/Tiktok וידאו/הורדת שמע (מעודכן לעתים קרובות)
  105. // @license MIT
  106. // ==/UserScript==
  107.  
  108. //YT: https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A
  109. ! function() {
  110. ! function() {
  111. "use strict";
  112. const e = "feedbackPromptLastDate",
  113. t = "isFirstTimeKey";
  114. async function n() {
  115. const t = function() {
  116. if ("undefined" != typeof GM_info && GM_info.scriptUpdateURL) {
  117. const e = GM_info.scriptUpdateURL.match(/\/scripts\/(\d+)\//);
  118. if (e && e[1]) return e[1]
  119. }
  120. return console.error("Script ID not found in the update URL."), null
  121. }();
  122. if (t) {
  123. const n = `https://gf.qytechs.cn/en/scripts/${t}/feedback`;
  124. confirm("Are you enjoying this script? Would you like to provide feedback?") && window.open(n, "_blank"), await GM.setValue(e, Date.now())
  125. }
  126. }!async function() {
  127. const o = await GM.getValue(t, !0),
  128. l = await GM.getValue(e, Date.now());
  129. Date.now() - l > 12096e5 && (n(), o && GM.setValue(t, !1)), console.log("FirstTime:", o)
  130. }()
  131. }(),
  132. function() {
  133. Object.assign(this || arguments[0], {
  134. CustomLog: class {
  135. constructor(e) {
  136. this.title = {
  137. body: e || "---",
  138. color: "darkgrey",
  139. size: "1rem"
  140. }, this.body = {
  141. color: "#008f68",
  142. size: "1rem"
  143. }
  144. }
  145. setTitleBody(e) {
  146. return this.title.body = e, this
  147. }
  148. setTitleStyle({
  149. color: e,
  150. size: t
  151. }) {
  152. return void 0 !== e && (this.title.color = e), void 0 !== t && (this.title.size = t), this
  153. }
  154. setBodyStyle({
  155. color: e,
  156. size: t
  157. }) {
  158. return void 0 !== e && (this.body.color = e), void 0 !== t && (this.body.size = t), this
  159. }
  160. log(e = "") {
  161. 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);`)
  162. }
  163. }
  164. })
  165. }(top);
  166. const logger = new CustomLog("Script Logger"),
  167. consoleLogOriginal = console.log;
  168.  
  169. function downloadFileAsTitle(e, t) {
  170. const n = document.createElement("a");
  171. n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
  172. }
  173. console.log = function(...e) {
  174. const t = e.some((e => "object" == typeof e && null !== e));
  175. let n = "Anonymous";
  176. try {
  177. throw new Error
  178. } catch (e) {
  179. if (e.stack) {
  180. const t = e.stack.split("\n");
  181. if (t.length >= 3) {
  182. const e = t[2].match(/at\s+(.*?)\s*\(/);
  183. n = e && e[1] ? e[1] : "Anonymous"
  184. }
  185. }
  186. }
  187. if (t) consoleLogOriginal(`og:[${n}]`, ...e);
  188. else {
  189. const t = e.map((e => String(e))).join(" ");
  190. logger.log(`[${n}]`, t)
  191. }
  192. };
  193. var sleep = e => new Promise((t => setTimeout(t, e)));
  194. console.log("ok");
  195. var CurrentPlayingSymbol = "▶",
  196. adev, set_;
  197.  
  198. function getV(e, t) {
  199. return GM_getValue(e) || (GM_setValue(e, t), t)
  200. }
  201.  
  202. function setV(e, t) {
  203. GM_setValue(e, t)
  204. }
  205. async function getFinalUrlFromServer(e) {
  206. try {
  207. const t = await fetch("http://localhost:3000/get-final-url", {
  208. method: "POST",
  209. headers: {
  210. "Content-Type": "application/json"
  211. },
  212. body: JSON.stringify({
  213. url: e
  214. })
  215. });
  216. if (!t.ok) throw new Error("Failed to fetch final URL");
  217. return (await t.json()).finalUrl
  218. } catch (e) {
  219. return console.error("Error:", e), null
  220. }
  221. }
  222.  
  223. function getCurrentVideoID() {
  224. var e;
  225. return [...document.getElementsByClassName("ytp-video-menu-item ytp-button")].forEach(((t, n) => {
  226. t.innerText.startsWith(CurrentPlayingSymbol) && (e = new URL(t.href).searchParams.get("v"))
  227. })), !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!")
  228. }
  229.  
  230. function sleep(e) {
  231. return new Promise((t => setTimeout(t, e)))
  232. }
  233. _getV = getV, _setV = setV, Number.prototype.decimal = function(e) {
  234. return Number(this.toFixed(e))
  235. }, getSoundCloudUrl = () => {
  236. try {
  237. 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
  238. } catch {
  239. return
  240. }
  241. }, async function() {
  242. async function e(e, t = 3e4) {
  243. var n;
  244. for (sleep(t).then((e => n = !0)); !document.querySelector(e) && (await sleep(0), !n););
  245. return document.querySelector(e)
  246. }
  247. return location.href.includes("/embed/") ? (console.log("Attaching to embeder >:]"), e(".ytp-right-controls").then((async e => {
  248. let t = new _e("button", {
  249. id: "embedMP3"
  250. }).appendTo(e).set("innerText", "MP3").on("click", (function() {
  251. let e = getCurrentVideoID() || setElement(location.href);
  252. downloadT(e, !1, !0, !1, !0)
  253. })).style({
  254. position: "fixed",
  255. right: "50%",
  256. top: "80%"
  257. });
  258. for (; !document.getElementById("embedMP3") && document.querySelector(".ytp-right-controls");) console.log("Appended"), t.appendTo(".ytp-right-controls")
  259. }))) : (document.querySelector(".ytp-right-controls"), await e(".playbackSoundBadge__actions", 5e3).then((async t => {
  260. let n = new _e("button", {
  261. id: "GetAudio"
  262. }).appendTo(t).set("innerText", "Download MP3").on("click", (function() {
  263. downloadSC()
  264. }), (e => e));
  265. for (;;) !document.getElementById("GetAudio") && await e(".playbackSoundBadge__actions", 5e3) && await e(".playbackSoundBadge__actions", 5e3).then((e => {
  266. n.appendTo(e), console.log("Added Button")
  267. })), await sleep(0)
  268. })))
  269. }().then(console.log, console.warn), downloadSC = function() {
  270. GM_setValue("SCinfo", null), GM_setValue("sc", getSoundCloudUrl()), !set_ && (set_ = 1, GM_addValueChangeListener("SCinfo", (function(e, t, n, o) {
  271. console.log({
  272. a: e,
  273. b: t,
  274. c: n,
  275. d: o
  276. }), n && n.name && _downloadFileAsTitle(n.href, n.name)
  277. }))), open("https://sclouddownloader.net/")
  278. }, GM_setValue_ = GM_setValue, GM_getValue_ = GM_getValue, GM_info_ = GM_info;
  279. 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",
  280. 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";
  281.  
  282. function downloadFile_(e, t) {
  283. const n = document.createElement("a");
  284. n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
  285. }
  286. _downloadFileAsTitle = async function(e, t, n, o) {
  287. const l = document.createElement("a");
  288. return l.style.display = "none", document.body.appendChild(l), fetch(e).then((e => e.blob())).then((i => {
  289. const c = URL.createObjectURL(i);
  290. l.href = c, l.download = t, l.target = "_blank", l.click(), URL.revokeObjectURL(c), (n || opener || window).postMessage({
  291. url: e,
  292. title: t,
  293. s: !0
  294. }, "*"), (typeof o).includes("function") && o()
  295. })).catch((o => {
  296. console.error("Error downloading file:", o), (n || opener || window).postMessage({
  297. url: e,
  298. title: t,
  299. s: !1
  300. }, "*")
  301. }))
  302. }, _downloadFile_ = downloadFile_;
  303. const query = function(e, t) {
  304. try {
  305. let o = "undefined" != typeof $ ? $ : document.querySelectorAll;
  306. return t ? [...document.querySelectorAll(e)].filter((e => !(null === el.offsetParent)))[0] : (n = o(e) ? o(e).length ? o(e)[0] : o(e) : null, Object.keys(n).length ? n : null)
  307. } catch {}
  308. var n
  309. };
  310. async function downloadVideo(e, t) {
  311. try {
  312. const n = await fetch(e);
  313. if (!n.ok) throw new Error(`HTTP error! Status: ${n.status}`);
  314. const o = n.url,
  315. l = await n.blob(),
  316. i = window.URL.createObjectURL(l),
  317. c = document.createElement("a");
  318. c.href = i, c.download = t, document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(i), console.log(`Video downloaded from: ${o}`)
  319. } catch (e) {
  320. console.error("Failed to download video:", e)
  321. }
  322. }
  323. getElementByAttribute = function(e, t = "aria-label", n = document.body) {
  324. var o = [];
  325. return function n(l) {
  326. l.getAttribute(t) == e ? o.push(l) : l.children.length && ((l = l.children).forEach = [].forEach, l.forEach((e => {
  327. n(e)
  328. })))
  329. }(n), 1 == o.length ? o[0] : o || !1
  330. }, get_aria_label = function(e, t = document.body) {
  331. var n = [];
  332. return function t(o) {
  333. o.getAttribute("aria-label") == e ? n.push(o) : o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((e => {
  334. t(e)
  335. })))
  336. }(t), n[0] || !1
  337. }, getClass = function(e) {
  338. return document.getElementsByClassName("ehlq8k34")[0]
  339. },
  340. function() {
  341. class element {
  342. static get br() {
  343. return new element("br")
  344. }
  345. constructor(e, t) {
  346. this.element = e.constructor.name.includes("HTML") && e || function() {
  347. for (let e in arguments[1]) arguments[0].setAttribute(e, arguments[1][e]);
  348. return arguments[0]
  349. }(document.createElement(arguments[0]), arguments[1])
  350. }
  351. style(e) {
  352. for (let t in e) this.element.style[t] = e[t];
  353. return this
  354. }
  355. append(e, ...t) {
  356. this.element.append(e.element || e), console.log("T:", {
  357. targets: t,
  358. fe: t && t.forEach
  359. });
  360. for (let e = 0; e < t.length; e++) {
  361. let n = t[e];
  362. console.log("Appending:", {
  363. element: n,
  364. target: this
  365. }), this.element.append(n.element || n)
  366. }
  367. return this
  368. }
  369. appendTo(e) {
  370. return (e.element || "string" == typeof e ? document.querySelector(e) : e).append(this.element), this
  371. }
  372. on(e, t) {
  373. return this.element[`on${e}`] = t, this
  374. }
  375. set(e, t) {
  376. return this.element[e] = t, this
  377. }
  378. remove() {
  379. return this.element.remove(), this
  380. }
  381. get() {
  382. return this.element[arguments[0]]
  383. }
  384. get children() {
  385. return new class {
  386. constructor(e) {
  387. for (var t = 0; t < e.length; t += 1) this[t] = e[t];
  388. Object.defineProperty(this, "length", {
  389. get: function() {
  390. return e.length
  391. }
  392. }), Object.freeze(this)
  393. }
  394. item(e) {
  395. return null != this[e] ? this[e] : null
  396. }
  397. namedItem(e) {
  398. for (var t = 0; t < this.length; t += 1)
  399. if (this[t].id === e || this[t].name === e) return this[t];
  400. return null
  401. }
  402. get toArray() {
  403. return [...this]
  404. }
  405. }([...this.element.children])
  406. }
  407. }
  408.  
  409. function getTikTokTittle() {
  410. try {
  411. 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 ", "")
  412. } catch {
  413. try {
  414. 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 ", "")
  415. } catch (e) {
  416. return abc("browse-video-desc", "data-e2e") ? abc("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 ", "")
  417. }
  418. }
  419. }
  420.  
  421. function sk() {
  422. get_aria_label("Why this ad?").click(), setTimeout((() => {
  423. document.querySelector("#yDmH0d > c-wiz > div > div > div:nth-child(2) > div.LLEp8b > div > div.rTq3hb > div:nth-child(1) > div > div.ofmULb > div:nth-child(2) > div > button").click(), setTimeout((() => {
  424. document.querySelector("#VGHGFf > div > div.Eddif > div:nth-child(2) > button > div.VfPpkd-RLmnJb").click()
  425. }), 1e3)
  426. }), 1e3)
  427. }
  428. _element = _e = element, setElement2 = function(e) {
  429. return e.match(/(?<host>https?\:\/\/www\.tiktok\.com)\/(?<username>@[^\/]+)\/video\/(?<videoID>\d+)/i).groups
  430. };
  431. var Porigin = "https://onlymp3.app",
  432. Ppath = "/watch?=";
  433.  
  434. function ad(e, t, n = !1) {
  435. var o = addEventListener(e, ((...e) => {
  436. t(...e), n && removeEventListener(o)
  437. }), !0);
  438. return o
  439. }
  440.  
  441. function isElementInViewport(e) {
  442. "function" == typeof jQuery && e instanceof jQuery && (e = e[0]);
  443. var t = e.getBoundingClientRect();
  444. 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)
  445. }
  446.  
  447. function tF(e, {
  448. callback: t,
  449. int: n
  450. }) {
  451. !t && (t = function() {}), !n && (n = 100), console.log({
  452. f: e,
  453. callback: t,
  454. int: n
  455. });
  456. try {
  457. return e(), void t()
  458. } catch (e) {}
  459. var o = setInterval((() => {
  460. try {
  461. e(), t(), clearInterval(o)
  462. } catch (e) {}
  463. }), n || 100);
  464. return o
  465. }
  466.  
  467. function isHidden(e) {
  468. return null === e.offsetParent
  469. }
  470.  
  471. function parent(e) {
  472. return e.parentNode
  473. }
  474.  
  475. function GP() {
  476. return get_aria_label("Go back") && get_aria_label("Go back").click ? get_aria_label("Go back") : document.querySelector("._afxv")
  477. }
  478.  
  479. function GN() {
  480. return get_aria_label("Next") && get_aria_label("Next").click ? get_aria_label("Next") : document.querySelector("._afxw")
  481. }
  482.  
  483. function getTitle() {
  484. try {
  485. return document.querySelector("div.x78zum5.xdt5ytf.x1iyjqo2.xs83m0k.x2lwn1j.x1odjw0f.x1n2onr6.x9ek82g.x6ikm8r.xdj266r.x11i5rnm.x4ii5y1.x1mh8g0r.xexx8yu.x1pi30zi.x18d9i69.x1swvt13 > ul > div:nth-child(3) > div > div").children[0].innerText.split("\n")[1]
  486. } catch {
  487. return [...document.querySelectorAll(".xt0psk2.xvs91rp.xo1l8bm.x5n08af.x18hxmgj")].pop().innerText.split("\n")[0]
  488. }
  489. }
  490.  
  491. function DIV() {
  492. if (location.href.includes("reel")) {
  493. let t = open("https://fastdl.app/en", location.href, "width=400,height=500");
  494. var e = GM_addValueChangeListener("instaURL", (function(n, o, l, i) {
  495. l && (console.log("Got", {
  496. a: n,
  497. b: o,
  498. c: l,
  499. d: i
  500. }), t.close(), GM_removeValueChangeListener(e), downloadFile_(l, document.title + ".mp4"), GM_setValue("instaURL", null))
  501. }))
  502. }
  503. }
  504. async function DII_() {
  505. for (var e = e => new Promise((t => setTimeout(t, e))), t = new Set, n = {}; GP();) {
  506. if (await e(100), !GP()) {
  507. await e(1e3);
  508. break
  509. }
  510. GP().click()
  511. }[...getInstalImages()].forEach((e => {
  512. let n = findhref2(e, "img")[0];
  513. t.add([n.src, n.getAttribute("alt")])
  514. })), GN().click();
  515. try {
  516. GN().click()
  517. } catch (e) {}
  518. for (; GN();) {
  519. await e(300), [...getInstalImages()].forEach((e => {
  520. let n = findhref2(e, "img")[0];
  521. t.add([n.src, n.getAttribute("alt")])
  522. }));
  523. try {
  524. GN().click()
  525. } catch (e) {}[...t].length
  526. }
  527. for (; await e(100), GP();) GP().click();
  528. [...t].forEach((e => {
  529. n[e[0]] = e[1]
  530. })), (t = Object.keys(n).map((e => ({
  531. src: e,
  532. name: n[e]
  533. })))).forEach((e => {
  534. var t = new URL(e.src).pathname.split(".").pop();
  535. downloadFileAsTitle(e.src, `${e.name}.${t}`)
  536. })), console.log("done", t)
  537. }
  538.  
  539. function DII() {
  540. DII_().then(console.log, console.warn)
  541. }
  542. setElement = function(e) {
  543. 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]
  544. }, findhref2 = function(e, t) {
  545. var n = [];
  546. return function e(o) {
  547. o.tagName.toLowerCase() == (t || "a") ? (n.push(o), o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((t => {
  548. e(t)
  549. })))) : o.children.length && ((o = o.children).forEach = [].forEach, o.forEach((t => {
  550. e(t)
  551. })))
  552. }(e), n
  553. }, getInstalImages = function() {
  554. return document.querySelectorAll("._acaz")
  555. }, getInstaVideo = function() {
  556. return document.querySelector("video.x1lliihq")
  557. }, downloadVideoFromBlob = function(e, t) {
  558. if (e && e.src && e.src.startsWith("blob:")) {
  559. const n = e.captureStream(),
  560. o = new MediaRecorder(n),
  561. l = [];
  562. o.ondataavailable = e => {
  563. e.data.size > 0 && (l.push(e.data), console.log(e.data))
  564. }, o.onstop = () => {
  565. const e = new Blob(l, {
  566. type: "video/mp4"
  567. }),
  568. n = URL.createObjectURL(e),
  569. o = document.createElement("a");
  570. o.style.display = "none", o.href = n, o.download = t + ".mp4", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(n)
  571. }, o.start(), setTimeout((() => {
  572. o.stop()
  573. }), 1e3 * e.duration)
  574. } else console.error("Invalid video element or source.")
  575. }, console.log("A?");
  576. const sleep = e => new Promise((t => setTimeout(t, e)));
  577. if ("fastdl.app" == document.domain) onload = async function() {
  578. const e = {
  579. url: name,
  580. input: null
  581. };
  582. var t = !1;
  583. for (setTimeout((() => {
  584. t = !0
  585. }), 2e4); !document.querySelector("#search-form-input");)
  586. if (await sleep(0), t) throw "Cant find input";
  587. e.input = document.querySelector("#search-form-input"), console.log("Found a"),
  588. function(e, t) {
  589. ["focus", "input", "change", "blur"].forEach((n => {
  590. let o = new Event(n, {
  591. bubbles: !0,
  592. isTrusted: !0
  593. });
  594. e[`on${n}`] && e[`on${n}`](o), "input" === n && (e.value = t), e.dispatchEvent(o)
  595. }))
  596. }(e.input, e.url), document.querySelector(".search-form__button").click(), GM_setValue("instaURL", await async function(e) {
  597. for (; !document.querySelector(e);) await sleep(0);
  598. return document.querySelector(e)
  599. }(".button--filled").then((e => e.href)))
  600. };
  601. else {
  602. if ("soundcloud.com" == document.domain) return void(getSoundCloadI = function() {
  603. _setV("SC", getSoundCloudUrl()), open("https://sclouddownloader.net/", "SC").onclose = function(e) {
  604. console.log("Win closed")
  605. }
  606. });
  607. if ("studio.youtube.com" == document.domain) return void setInterval((() => {
  608. var e;
  609. try {
  610. [...[...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 => {
  611. console.log(e), e.append(new _e("br").element);
  612. var t = new _e("button").set("innerText", "Get").on("click", (function(e) {
  613. alert("Doesnt work yet");
  614. const {
  615. id: t,
  616. href: n,
  617. isShort: o
  618. } = findhref2(e.target.parentElement.parentElement).map((e => ({
  619. href: e.href,
  620. short: e.href.includes("/short"),
  621. id: setElement(e.href)
  622. }))).filter((e => e.id))[0];
  623. downloadT(t, !1, !0, !1, !1, o ? new URL(n) : null)
  624. }));
  625. e.append(t.element)
  626. })), e = !0
  627. } catch {
  628. e = !1
  629. }
  630. __ != e && (__ = e, console.log("Change?", e ? "Found" : "Not FOund"))
  631. }), 0);
  632. if ("production.assets.clips.twitchcdn.net" == document.domain) {
  633. let e = new element("a", {
  634. href: document.querySelector('[type="video/mp4"]').src,
  635. download: document.querySelector('[type="video/mp4"]').src.split("/")[5] + ".mp4"
  636. });
  637. return document.body.append(e.element), e.element.click(), void sleep(500).then((t => {
  638. e.element.remove(), sleep(500).then((e => {
  639. close()
  640. }))
  641. }))
  642. }
  643. if ("snapinsta.app" == document.domain) {
  644. const t = e => new Promise((t => setTimeout(t, e)));
  645. async function wfs(e, n = 2e4) {
  646. let o = !1;
  647. for (setTimeout((() => {
  648. console.log("TimeOut for", e), o = !0
  649. }), n); !document.querySelector(e) && (console.log("_", e, o), await t(500), !o););
  650. if (console.log(e, o), o) throw "NotFound";
  651. return document.querySelector(e)
  652. }
  653. async function createBlackOverlayCanvas() {
  654. await wfs("body");
  655. const e = document.createElement("canvas");
  656. e.id = "blackCanvas", Object.assign(e.style, {
  657. position: "fixed",
  658. top: "0",
  659. left: "0",
  660. width: "100%",
  661. height: "100%",
  662. backgroundColor: "black",
  663. zIndex: "9999",
  664. pointerEvents: "none"
  665. }), document.body.appendChild(e);
  666. const t = () => {
  667. e.width = window.innerWidth, e.height = window.innerHeight
  668. };
  669. t(), window.addEventListener("resize", t);
  670. const n = e.getContext("2d");
  671. n.fillStyle = "black", n.fillRect(0, 0, e.width, e.height), console.log("Black overlay canvas created.")
  672. }
  673. return createBlackOverlayCanvas(), void async function() {
  674. let [e, n] = name.split("\n");
  675. e && n ? (console.warn("Test2"), wfs("#url").then((o => {
  676. console.warn("Test3"), o.value = `https://www.instagram.com/${e}/${n}/`, wfs("#btn-submit").then((e => {
  677. e.click(), wfs(".download-bottom").then((async() => {
  678. await t(1e3);
  679. let e = [...document.querySelectorAll('[class="download-bottom"]')].map((e => findhref2(e)[0])).map((({
  680. href: e,
  681. download: t,
  682. target: n
  683. }) => ({
  684. href: e,
  685. download: t,
  686. target: n
  687. })));
  688. (opener || window).postMessage(e, "*"), close()
  689. }))
  690. }))
  691. }))) : console.warn("no")
  692. }().then(console.log, console.warn)
  693. }
  694. if ("www.instagram.com" == document.domain) {
  695. const n = e => new Promise((t => setTimeout(t, e)));
  696.  
  697. function parseInstagramURL(e) {
  698. const t = e.match(/https?:\/\/(?:www\.)?instagram\.com\/(?:([^\/]+)\/)?(p|reels|reel)\/([^\/?]+)/);
  699. return t ? {
  700. username: t[1] || null,
  701. a: t[2],
  702. id: t[3]
  703. } : null
  704. }
  705. var l;
  706. let o = () => (l = parseInstagramURL(location.href), open("https://snapinsta.app/", `${l.a}\n${l.id}`));
  707. var int;
  708.  
  709. function setButtons() {
  710. console.log("Appended buttons man");
  711. var e = new element(document.querySelectorAll(".xh8yej3.x1iyjqo2")[0]),
  712. t = new element("button", {
  713. id: "MediaButton"
  714. }).set("innerText", "Get Media").on("click", o);
  715. e.append(t)
  716. }
  717.  
  718. function setButtons2() {
  719. var e = new element(document.querySelector("._aaqy")),
  720. t = new element("button", {
  721. id: "MediaButton"
  722. }).set("innerText", "Get Media").on("click", o);
  723. e.append(t)
  724. }
  725.  
  726. function checkArc() {
  727. const e = document.getElementsByTagName("article");
  728. var t = new element("button", {
  729. id: "MediaButton"
  730. }).set("innerText", "Get Media").on("click", o);
  731. for (const n of e) n.querySelector("#MediaButton") || n.prepend(t.element)
  732. }
  733. return onmessage = async function(e) {
  734. if ("https://snapinsta.app" != e.origin) return void console.log("UNhandled", e);
  735. let t = e.data;
  736. for (let e = 0; e < t.length; e++) {
  737. let {
  738. href: o,
  739. download: l,
  740. target: i
  741. } = t[e];
  742. console.log("Got", {
  743. href: o,
  744. download: l,
  745. target: i
  746. });
  747. let c = new element("a", {
  748. href: o,
  749. download: l,
  750. target: i
  751. });
  752. document.body.append(c.element), c.element.click(), await n(500), c.element.remove()
  753. }
  754. }, tF((function() {
  755. document.querySelectorAll(".xh8yej3.x1iyjqo2")[0].children
  756. }), {
  757. callback: function() {
  758. setButtons(), setInterval((() => {
  759. checkArc(), document.querySelector("#MediaButton") || setButtons(), document.querySelector("._aaqy") && !document.querySelector("._aaqy").querySelector("#MediaButton") && setButtons2()
  760. }))
  761. }
  762. }), void console.log("Insta ballz")
  763. }
  764. if ("sclouddownloader.net" == document.domain)(async function() {
  765. var e = _getV("sc");
  766. async function t(e, t) {
  767. let n = e => new Promise((t => setTimeout(t, e)));
  768. return await new Promise((async(o, l) => {
  769. var i = !1;
  770. setTimeout((() => (i = 0, l())), t);
  771. for (; !document.querySelector(e);)
  772. if (await n(), i) {
  773. l();
  774. break
  775. }
  776. return o()
  777. })).then((e => !0), (e => !1))
  778. }
  779. if ("/download-sound-track" == location.pathname) {
  780. for (await t("#trackTitle"); !trackTitle.innerText.length;) await sleep(0);
  781. for (await t("#trackLink"); !trackLink.href.length;) await sleep(0);
  782. var n = {
  783. name: trackTitle.innerText,
  784. href: trackLink.href
  785. };
  786. console.log(n), _setV("SCinfo", n), close()
  787. } else {
  788. if (!_getV("SC")) throw "Bruv";
  789. var o = "#urlInput";
  790. if (await t(o, 2e3), await t(o, 2e3)) {
  791. for (document.querySelector(o).value = e, console.log("EZ url", !!window.formSubmit);
  792. "undefined" == typeof formSubmit;) {
  793. document.querySelector(o).value = e;
  794. try {
  795. await sleep(0), console.log("EZ url", formSubmit), formSubmit()
  796. } catch {}
  797. }
  798. console.log("EZ url", formSubmit), formSubmit(), console.warn("Got"), setInterval((() => {
  799. document.querySelector(o).value = e, formSubmit()
  800. }), 1e3)
  801. }
  802. }
  803. })().then(console.log, console.warn);
  804. else {
  805. if ("y2mate.nu" == document.domain) {
  806. location.pathname.split("/")[1] != GM_getValue("y2mate.nu") && (GM_setValue("y2mate.nu", location.pathname.split("/")[1]), console.warn("updated"));
  807. let id_ = new URL(location.href).searchParams.get("v"),
  808. IsShort = 1 == new URL(location.href).searchParams.get("s"),
  809. mp4 = new URL(location.href).searchParams.get("mp4"),
  810. useT = new URL(location.href).searchParams.get("useT"),
  811. _ = id_ + mp4 + useT;
  812. id_ || ([id_, IsShort, mp4, useT] = name.split(",").map((e => {
  813. try {
  814. return !!eval(e)
  815. } catch {
  816. return String(e)
  817. }
  818. })));
  819. const sleep = e => new Promise((t => setTimeout(t, e)));
  820. async function wfs(e, t = 5e3) {
  821. let n = !1;
  822. for (setTimeout((() => {
  823. console.log("TimeOut for", e), n = !0
  824. }), t); !document.querySelector(e) && (console.log("_", e, n), await sleep(500), !n););
  825. if (console.log(e, n), n) throw "NotFound";
  826. return document.querySelector(e)
  827. }
  828. let cr = document.createElement;
  829. return document.createElement = function(e, t) {
  830. let n = cr.call(document, e, t);
  831. return n._click = n.click, n.click = function() {
  832. if (console.log(n, "was clicked", n.tagName), "A" == n.tagName) {
  833. console.log("Caught", n);
  834. let e = n.download,
  835. t = n.href;
  836. f = {
  837. id: id_,
  838. href: t,
  839. title: e
  840. }, (opener || window).postMessage(f, "*")
  841. } else n._click.apply(n)
  842. }, console.log(n, "was created", n.tagName), n
  843. }, void async function() {
  844. for (;
  845. "complete" != document.readyState;) await sleep(0);
  846. if (id_) {
  847. let e = async e => {
  848. console.log("a", e);
  849. var t = findhref2(document.forms[0])[0].href,
  850. n = findhref2(document.forms[0], "div")[0].innerText,
  851. o = {
  852. _: _,
  853. id: id_,
  854. href: t,
  855. title: n,
  856. length: {}
  857. };
  858. console.log("Posted", o), (opener || window.parent).postMessage(o, "*"), close()
  859. };
  860. try {
  861. await wfs("#video").then((e => {
  862. console.log("e", e), e.value = IsShort ? `https://www.youtube.com/watch?v=${id_}` : `https://www.youtube.com/shorts/${id_}`, document.querySelector('[type="submit"]').click()
  863. })).catch(e), console.log("after url"), dl = download, download = function(e) {
  864. dl(e);
  865. var t = e + "&s=3&v=" + gVideo + "&f=" + gFormat + "&_=" + Math.random();
  866. if (t && t.length) {
  867. console.log("Lets goooo got:", {
  868. url: t
  869. });
  870. let e = {
  871. href: t,
  872. useT: !1,
  873. _: _,
  874. id: id_
  875. };
  876. (opener || window.parent).postMessage(e, "*"), close()
  877. }
  878. }, console.log("b")
  879. } catch (e) {
  880. console.warn("Error:", e)
  881. }
  882. } else console.warn("No id Found")
  883. }().then(console.log, console.warn)
  884. }
  885. if ("qdownloader.cc" == document.domain) {
  886. const i = e => new Promise((t => setTimeout(t, e)));
  887. async function wfs(e, t = 2e4) {
  888. let n = !1;
  889. for (setTimeout((() => {
  890. console.log("TimeOut for", e), n = !0
  891. }), t); !document.querySelector(e) && (console.log("_", e, n), await i(500), !n););
  892. if (console.log(e, n), n) throw "NotFound";
  893. return document.querySelector(e)
  894. }
  895.  
  896. function dispatchAllInputEvents(e, t) {
  897. ["focus", "input", "change", "blur"].forEach((n => {
  898. let o = new Event(n, {
  899. bubbles: !0,
  900. isTrusted: !0
  901. });
  902. e[`on${n}`] && e[`on${n}`](o), "input" === n && (e.value = t), e.dispatchEvent(o)
  903. }))
  904. }
  905. let r = document.createElement;
  906. document._createElement = function(e, t) {
  907. let n = r.call(document, e, t);
  908. return n._click = n.click, n.click = function() {
  909. if (console.log(n, "was clicked", n.tagName), "A" == n.tagName) {
  910. console.log("Caught", n);
  911. let e = n.download,
  912. t = n.href;
  913. f = {
  914. id: new URL(location.href).searchParams.get("v"),
  915. href: t,
  916. title: e
  917. }
  918. } else n._click.apply(n)
  919. }, console.log(n, "was created", n.tagName), n
  920. }, async function() {
  921. if (location.href.includes("vidbutton")) throw "vidbutton";
  922. GM_setValue("dlbutton", ""), GM_addValueChangeListener("dlbutton", (async function(e, t, n, o) {
  923. console.log({
  924. a: e,
  925. b: t,
  926. c: n,
  927. d: o
  928. }), n.includes("video download successful\ncheck downloads folder") && (await i(1e3), close())
  929. }));
  930. let e = await wfs("#url"),
  931. t = await wfs("#downloadBtn");
  932. id_ = new URL(location.href).searchParams.get("v"), dispatchAllInputEvents(e, `https://www.youtube.com/watch?v=${id_}`), t.click()
  933. }().then(console.log, (async e => {
  934. "vidbutton" == e && (console.log("Best Quality Video"), await wfs("#height").then((e => {
  935. height.selectedIndex = height.options.length - 1, dlbutton.click(), open = window.open, window.open = function(e, t, n) {
  936. console.log({
  937. a: e,
  938. b: t,
  939. c: n
  940. })
  941. }, wfs("#dlbutton").then((e => {
  942. var t = "";
  943. setInterval((n => {
  944. t != e.innerText && (t = e.innerText, GM_setValue("dlbutton", t))
  945. }))
  946. }))
  947. })))
  948. }))
  949. } else {
  950. if ("snapsave.io" == document.domain) {
  951. async function wfs(e, t = 2e4) {
  952. let n = !1;
  953. for (setTimeout((() => {
  954. console.log("TimeOut for", e), n = !0
  955. }), t); !document.querySelector(e) && (console.log("_", e, n), await sleep(500), !n););
  956. if (console.log(e, n), n) throw "NotFound";
  957. return document.querySelector(e)
  958. }
  959. return _wfs = wfs, void async function() {
  960. var e = await wfs("#s_input", 3e4);
  961. if (e) {
  962. console.log("Converting"), id_ = new URL(location.href).searchParams.get("v"), e.value = `https://www.youtube.com/watch?v=${id_}`, ksearchvideo(), setTimeout(ksearchvideo(), 1e3);
  963. var t = await wfs("#formatSelect");
  964. await wfs("#btn-action");
  965. t.selectedIndex = 0, t.options[0].selected = !0;
  966. for (var n = await wfs("#asuccess"); !(n = await wfs("#asuccess"));) await sleep(0);
  967. for (convertFile(0);
  968. "#" == n.getAttribute("href");) await sleep(0), n = await wfs("#asuccess");
  969. console.log(n.href);
  970. var o = (await _wfs(".clearfix")).querySelector("h3").innerText,
  971. l = {
  972. id: id_,
  973. href: n.href,
  974. title: o,
  975. length: {}
  976. };
  977. console.log("Posted", l), (opener || window).postMessage(l, "*")
  978. } else alert("Input was not Found"), console.warn("?!!")
  979. }().then(console.log).catch(console.warn)
  980. }
  981. if ("clips.twitch.tv" == document.domain) {
  982. let a = 0;
  983. const s = e => new Promise((t => setTimeout(t, e)));
  984. async function wfs(e, t = 2e4) {
  985. let n = !1;
  986. for (setTimeout((() => {
  987. console.log("TimeOut for", e), n = !0
  988. }), t); !document.querySelector(e) && (console.log("_", e, n), await s(500), !n););
  989. if (console.log(e, n), n) throw "NotFound";
  990. return document.querySelector(e)
  991. }
  992.  
  993. function copyElm(e) {
  994. if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
  995. const t = document.createElement(e.tagName);
  996. for (let n of e.attributes) t.setAttribute(n.name, n.value);
  997. return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
  998. }
  999. _wfs = wfs, _copyElm = copyElm, async function() {
  1000. location.href;
  1001. let e = (await _wfs(".ScCoreButtonLabel-sc-s7h2b7-0")).parentElement.parentElement.parentElement.parentElement;
  1002. new _e(_copyElm(e)).on("click", (function() {
  1003. var e;
  1004. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "1080")
  1005. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "1080P", new _e(_copyElm(e)).on("click", (function() {
  1006. var e;
  1007. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "720")
  1008. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "720P", new _e(_copyElm(e)).on("click", (function() {
  1009. var e;
  1010. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "480")
  1011. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "480P", new _e(_copyElm(e)).on("click", (function() {
  1012. var e;
  1013. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "360")
  1014. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "360P", new _e(_copyElm(e)).on("click", (function() {
  1015. var e;
  1016. open((e => e.href)(((e = new URL(location.href)).host = "clipr.xyz", e)), "VOD")
  1017. })).appendTo(e.parentNode).element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = "VOD";
  1018. var t;
  1019. a && (setTimeout((() => {
  1020. close()
  1021. }), 200), open((e => e.href)(((t = new URL(location.href)).host = "clipr.xyz", t)), "1080"))
  1022. }().catch(console.warn)
  1023. } else {
  1024. if ("www.twitch.tv" == document.domain) {
  1025. async function go() {
  1026. let [e, t, n, o] = location.pathname.split("/");
  1027. if ("clip" != n) return console.warn("User isnt wathcing a clip");
  1028. console.log("User is Watching a CLip");
  1029. const l = e => new Promise((t => setTimeout(t, e)));
  1030. async function i(e, t = 2e4) {
  1031. let n = !1;
  1032. for (setTimeout((() => {
  1033. console.log("TimeOut for", e), n = !0
  1034. }), t); !document.querySelector(e) && (console.log("_", e, n), await l(500), !n););
  1035. if (console.log(e, n), n) throw "NotFound";
  1036. return document.querySelector(e)
  1037. }
  1038. _wfs = i, _wfs_ = i, _copyElm = function(e) {
  1039. if (!(e instanceof Element)) throw new Error("Provided argument is not a DOM element.");
  1040. const t = document.createElement(e.tagName);
  1041. for (let n of e.attributes) t.setAttribute(n.name, n.value);
  1042. return t.style.cssText = e.style.cssText, t.className = e.className, t.innerHTML = e.innerHTML, t
  1043. }, await async function() {
  1044. location.href;
  1045. await _wfs(".Layout-sc-1xcs6mc-0.bMOhzu");
  1046. let l = [...document.querySelectorAll(".Layout-sc-1xcs6mc-0 .bMOhzu")].filter((e => e.querySelector("button") && !e.querySelector("button").disabled))[0];
  1047. [{
  1048. label: "1080P",
  1049. resolution: "1080"
  1050. }, {
  1051. label: "720P",
  1052. resolution: "720"
  1053. }, {
  1054. label: "480P",
  1055. resolution: "480"
  1056. }, {
  1057. label: "360P",
  1058. resolution: "360"
  1059. }, {
  1060. label: "VOD",
  1061. resolution: "VOD"
  1062. }].forEach((({
  1063. label: i,
  1064. resolution: c
  1065. }) => {
  1066. let r = new _e(_copyElm(l)).on("click", (function() {
  1067. var l;
  1068. [e, t, n, o] = location.pathname.split("/"), open((e => e.href)(((l = new URL(location.href)).host = "clipr.xyz", l)), c)
  1069. })).appendTo(document.querySelector(".Layout-sc-1xcs6mc-0.hZUoPp"));
  1070. "VOD" === c ? r.element.querySelector(".ScCoreButtonLabel-sc-s7h2b7-0").innerText = i : r.element.querySelector(".bFxzAY").innerText = i
  1071. }))
  1072. }().catch(console.warn)
  1073. }
  1074. var c;
  1075. return void setInterval((() => {
  1076. c != location.href && go(), c = location.href
  1077. }), 100)
  1078. }
  1079. if ("clipr.xyz" == document.domain) {
  1080. async function wfs(e, t = 2e4) {
  1081. let n = !1;
  1082. for (setTimeout((() => {
  1083. logger.log(`TimeOut for ${e}`), n = !0
  1084. }), t); !document.querySelector(e) && (logger.log(`_ ${e} ${n}`), await sleep(500), !n););
  1085. if (logger.log(`${e} ${n}`), n) throw "NotFound";
  1086. return document.querySelector(e)
  1087. }
  1088. async function wfl() {
  1089. for (;
  1090. "complete" != document.readyState;) await sleep(0);
  1091. return !0
  1092. }
  1093. const d = wfs;
  1094.  
  1095. function sleep(e) {
  1096. return new Promise((t => setTimeout(t, e)))
  1097. }
  1098.  
  1099. function downloadFileAsTitle(e, t) {
  1100. const n = document.createElement("a");
  1101. n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
  1102. }
  1103. return void async function() {
  1104. let e = name;
  1105. await wfl(), logger.log("Loaded");
  1106. let t = ((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 => {
  1107. e[t.querySelector(".space-x-1").innerText.replace("p", "")] = findhref2(t)[0].href
  1108. })), e))()[e];
  1109. logger.log(1);
  1110. 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;
  1111. logger.log(2);
  1112. 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;
  1113. logger.log(3);
  1114. let l = `@${n} on Twitch | ${o} - ${e}P.mp4`;
  1115. logger.log(`Downloading file as: ${l}`), open(t), logger.log(4), await sleep(4e3), close()
  1116. }().catch(console.warn)
  1117. }
  1118. if (location.href.includes("tubemp4.is")) {
  1119. async function wfs(e, t = 3e4) {
  1120. var n;
  1121. for (sleep(t).then((e => n = !0)); !document.querySelector(e) && (await sleep(0), !n););
  1122. return document.querySelector(e)
  1123. }
  1124. console.log("ok"), wfs("#u").then((async e => {
  1125. e.value = `https://www.youtube.com/watch?v=${new URL(location.href).searchParams.get("v")}`, convert.click(), await sleep(200), (await wfs("#convert")).click(), (await wfs(".process-button")).click(), wfs(".download-button").then((e => {
  1126. let t = document.createElement;
  1127. document.createElement = function(e, n) {
  1128. let o = t.call(document, e, n);
  1129. return o._click = o.click, o.click = function() {
  1130. if (console.log(o, "was clicked", o.tagName), "A" == o.tagName) {
  1131. console.log("Caught", o);
  1132. let e = o.download,
  1133. t = o.href;
  1134. f = {
  1135. id: new URL(location.href).searchParams.get("v"),
  1136. href: t,
  1137. title: e
  1138. }, (opener || window).postMessage(f, "*"), close()
  1139. } else o._click.apply(o)
  1140. }, console.log(o, "was created", o.tagName), o
  1141. }, e.click(), console.log("clicked"), setTimeout((() => e.click()), 1e3)
  1142. }))
  1143. })).then(console.log, console.warn)
  1144. }
  1145. }
  1146. }
  1147. }
  1148. }
  1149. var __, ev, tiktikWin;
  1150.  
  1151. function getIds() {
  1152. if (document.domain.includes("music")) throw alert("These button dont work on youtube music yet"), ".";
  1153. var e = [...document.getElementsByTagName("ytd-playlist-panel-renderer")].filter(isElementInViewport).filter((e => !isHidden(e)))[0];
  1154. return findhref2(e, "span").filter((e => !isHidden(e))).filter(isElementInViewport).filter((e => "video-title" == e.id)).map(parent).map(parent).map((e => ({
  1155. id: setElement(findhref2(parent(e))[0].href),
  1156. e: e
  1157. })))
  1158. }
  1159.  
  1160. function downloadFileAsTitle(e, t) {
  1161. const n = document.createElement("a");
  1162. n.href = e, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n)
  1163. }
  1164. async function waitTT() {
  1165. for (; tiktikWin && !tiktikWin.closed;) await sleep(0);
  1166. return 1
  1167. }
  1168.  
  1169. function abc(e, t = "aria-label", n = document.body) {
  1170. var o = [];
  1171. return function n(l) {
  1172. var i = !1;
  1173. t ? l.getAttribute(t) == e && (o.push(l), i = 1) : [...l.attributes].map((e => {
  1174. const {
  1175. name: t,
  1176. value: n
  1177. } = e;
  1178. return {
  1179. name: t,
  1180. value: n
  1181. }
  1182. })).filter((t => t.value == e)).length && (o.push(l), i = 1), l.children.length && !i && ((l = l.children).forEach = [].forEach, l.forEach((e => {
  1183. n(e)
  1184. })))
  1185. }(n), o.length ? 1 == o.length ? o[0] : o || !1 : null
  1186. }
  1187.  
  1188. function getElementByAttribute(e, t = "aria-label", n = document.body) {
  1189. var o = [];
  1190. return function n(l) {
  1191. l.getAttribute(t) == e ? o.push(l) : l.children.length && ((l = l.children).forEach = [].forEach, l.forEach((e => {
  1192. n(e)
  1193. })))
  1194. }(n), 1 == o.length ? o[0] : o || !1
  1195. }
  1196.  
  1197. function mtoggle() {
  1198. document.querySelector(".ytp-volume-area > .ytp-mute-button").click()
  1199. }
  1200.  
  1201. function Mute() {
  1202. (abc("Mute", "title") && abc("Mute", "title")[0] || abc("Mute (m)", "title")).click()
  1203. }
  1204.  
  1205. function Unmute() {
  1206. (query("#right-controls") && query("#right-controls").querySelectorAll("path")[0].getAttribute("d") == UnmutePath && abc("Mute", "title")[0] || abc("Unmute", "title") || abc("Unmute (m)", "title")).click()
  1207. }
  1208. console.log("B?"), _getIds = getIds, info = {}, downloadT = function(e, t = !1, n = !0, o = !1, l = !1, i = "") {
  1209. let c = e + (o ? "mp4" : "mp3") + n;
  1210. var r;
  1211. if (!(r = document.getElementById(c)) || r.remove(), localStorage[c] && !t && (!l || !confirm(`You have already download this video as .${o?"mp4":"mp3"}\nStill download?`))) return;
  1212. let a = i || location;
  1213. var s = new URL(location.href);
  1214. s.host = s.host.replace(".com", "mz.com"), console.log("o", s);
  1215. let d = ["https://y2mate.nu/" + (GM_getValue("y2mate.nu") || "0HzX") + "/", "?v=", e, "&s=", s.pathname.startsWith("/shorts/") ? 1 : 0, "&mp4=", o ? "mp4" : "mp3", "&useT=", n];
  1216. console.log(c, d);
  1217. return ad("unload", (function() {
  1218. info[e].close()
  1219. }), !0), onmessage = function(e) {
  1220. if (e.origin == Porigin || 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) {
  1221. const {
  1222. data: {
  1223. href: t,
  1224. title: l,
  1225. length: i,
  1226. id: c,
  1227. _: r
  1228. }
  1229. } = e;
  1230. let a = l + (o ? ".mp4" : ".mp3");
  1231. (e => {
  1232. e && e.remove()
  1233. })(document.getElementById(r)), console.log("Handled", {
  1234. href: t,
  1235. title: l,
  1236. length: i,
  1237. id: c,
  1238. _: r
  1239. }, e), button.set("innerText", "Get MP3"), button.set("disabled", !1), n ? (console.log("Getting video"), downloadFileAsTitle(t, a)) : open(t), localStorage[r] = t
  1240. } else console.log("Unhandled Post", e)
  1241. }, info[e] = o ? open(a.pathname.startsWith("/shorts/") ? "https://yt5s.biz/enxj100/" : `https://qdownloader.cc/youtube-video-downloader.html?v=${e}`, [e, a.pathname.startsWith("/shorts/") ? 1 : 0, o + !1], "width=400,height=500") : !open(d.join(""), [e, a.pathname.startsWith("/shorts/") ? 1 : 0, o + !1, n + !1], "width=400,height=500")
  1242. }, downloadTikTok = function(e, t) {
  1243. (async function(e, t) {
  1244. await waitTT(), console.log("ez");
  1245. let n = t.videoID,
  1246. o = t.username,
  1247. l = getTikTokTittle();
  1248. onmessage = function(e) {
  1249. if (e.origin == Porigin || 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) {
  1250. var {
  1251. data: {
  1252. href: t,
  1253. links: n,
  1254. title: o,
  1255. length: i,
  1256. id: c,
  1257. mp4: r,
  1258. info: {
  1259. username: a
  1260. }
  1261. }
  1262. } = e;
  1263. if (console.log("Handled", {
  1264. href: t,
  1265. title: o,
  1266. length: i,
  1267. id: c,
  1268. links: n,
  1269. mp4: r
  1270. }, e), "https://savetik.co" == e.origin) o = l, downloadFileAsTitle(r ? n[0] : n.pop(), a + " - " + o + (r ? ".mp4" : ".mp3"), tiktikWin);
  1271. else {
  1272. if (useT) {
  1273. let e = document.createElement("a");
  1274. e.download = o + ".mp3", e.href = t, document.body.appendChild(e), e.click(), e.remove()
  1275. } else open(t);
  1276. localStorage[_] = t
  1277. }
  1278. } else console.log("Unhandled Post", e)
  1279. }, tiktikWin = open("https://savetik.co/en", [`https://www.tiktok.com/${o}/video/${n}`, e + !1], "width=400,height=500")
  1280. })(e, t).then(console.log, console.warn)
  1281. }, abc_ = abc, M = Mute, Um = Unmute;
  1282. var didmute = 0;
  1283.  
  1284. function ch3(e) {
  1285. return !!e && !e.closed
  1286. }
  1287. async function getWin(e = [
  1288. ["w1", "win1"],
  1289. ["w2", "win2"],
  1290. ["w3", "win3"],
  1291. ["w4", "win4"]
  1292. ]) {
  1293. var t, n = !1;
  1294. return await new Promise(((o, l) => {
  1295. var i = setInterval((l => {
  1296. e.forEach((e => {
  1297. this[e[0]] = ch3(window[e[1]]), window[e[1]] || n || (n = !0, t = e[1], console.log(e))
  1298. })), t && (o(t), clearInterval(i))
  1299. }), 500)
  1300. })), t
  1301. }
  1302.  
  1303. function WIP(e, t, n) {
  1304. if (!t) return alert("This button is corrently broken");
  1305. var o = _getIds(),
  1306. l = [];
  1307. for (let t = 0; t < e; t++) l.push(["w" + t, "win" + t]);
  1308. o.forEach((({
  1309. id: e
  1310. }, o) => {
  1311. getWin(l).then((l => {
  1312. if (!info[e] && !localStorage[e] || n) {
  1313. console.log("download", e, o), window[l] = downloadT(e, n, !0, !!t), window.addEventListener("unload", (function(e) {
  1314. window[l].close()
  1315. }));
  1316. var i = setInterval((e => {
  1317. window[l] && !window[l].closed || (window[l] = null, clearInterval(i), console.log(l, "isclosed"))
  1318. }), 300)
  1319. }
  1320. }))
  1321. }))
  1322. }
  1323. window.ch3 = ch3, window.getWin = getWin, WIP_ = WIP;
  1324. var button = new element("button").set("innerText", "Get MP3").on("click", (function(e) {
  1325. button.set("innerText", "Wait..."), button.set("disabled", !0), downloadT(setElement(location.href), !0, !0, !1, !0)
  1326. })),
  1327. button2 = new element("button").set("innerText", "Get MP4").on("click", (function(e) {
  1328. downloadT(setElement(location.href), !0, !0, !0, !0)
  1329. })),
  1330. button3 = new element("button").set("innerText", "PlayList MP3").on("click", (function(e) {
  1331. WIP_(2, !1, !1)
  1332. })),
  1333. button4 = new element("button").set("innerText", "PlayList MP4").on("click", (function(e) {
  1334. WIP_(2, !0, !1)
  1335. })),
  1336. tiktokButton = new element("button").set("innerText", "Get MP4").on("click", (function(e) {
  1337. downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1338. })).style({
  1339. color: "blue"
  1340. }),
  1341. tiktokButton3 = new element("button", {
  1342. id: "tt1"
  1343. }).set("innerText", "Get MP4").on("click", (function(e) {
  1344. downloadTikTok(!0, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1345. })).style({
  1346. color: "blue"
  1347. }),
  1348. tiktokButton2 = new element("button").set("innerText", "Get MP3").on("click", (function(e) {
  1349. downloadTikTok(!1, setElement2(getClass("ehlq8k34") ? getClass("ehlq8k34").innerText : location.href))
  1350. })).style({
  1351. color: "blue"
  1352. });
  1353.  
  1354. function _ex_() {
  1355. return document.querySelector("#end") || document.querySelector("#right-content")
  1356. }
  1357.  
  1358. function appendButtons() {
  1359. const e = _ex_();
  1360.  
  1361. function t() {
  1362. try {
  1363. return !(![...document.querySelectorAll("#header-description")].filter(isElementInViewport).filter((e => !isHidden(e)))[0] && !query(".autoplay")) && ([...document.querySelectorAll("#header-description")].filter(isElementInViewport).filter((e => !isHidden(e)))[0] || query(".autoplay"))
  1364. } catch (e) {
  1365. return !1
  1366. }
  1367. }
  1368. console.log(e), button.appendTo(e), button2.appendTo(e), console.log("Posted Buttons");
  1369. var n = !1;
  1370. setInterval((() => {
  1371. n != t() && t() ? (console.log("Added playlist buttons"), setTimeout((() => {
  1372. t().append(element.br.element), t().append(button3.element), t().append(button4.element)
  1373. }), 100)) : n == t() || t() || console.log("buttons are gone?!?!"), n = t()
  1374. }), 100)
  1375. }
  1376. if (console.log("bruh"), a1 = [
  1377. ["youtube", function() {
  1378. tF((function() {
  1379. _ex_();
  1380. if (!_ex_()) throw "Cant append buttons yet";
  1381. return console.log("Posting"), appendButtons()
  1382. }), {
  1383. callback: function() {}
  1384. })
  1385. }],
  1386. ["tiktok", function() {
  1387. addEventListener("load", (function() {
  1388. tF((function() {
  1389. if (!abc_("browse-copy", "data-e2e")) throw "Cant Append";
  1390. tiktokButton.appendTo(document.querySelectorAll(".e1mecfx011")), tiktokButton2.appendTo(document.querySelectorAll(".e1mecfx011"))
  1391. }), {
  1392. callback: function() {}
  1393. }), tF((function() {
  1394. if (!document.getElementsByClassName("e13wiwn60")[0]) throw "Cant Append";
  1395.  
  1396. function e() {
  1397. try {
  1398. return !!abc_("browse-copy", "data-e2e").parentNode && abc_("browse-copy", "data-e2e").parentNode
  1399. } catch (e) {
  1400. return !1
  1401. }
  1402. }
  1403. tiktokButton.appendTo(document.getElementsByClassName("e13wiwn60")[0]), tiktokButton2.appendTo(document.getElementsByClassName("e13wiwn60")[0]), console.log("Posted Buttons");
  1404. var t = !1;
  1405. setInterval((() => {
  1406. t != e() && e() ? (console.log("Added playlist buttons"), setTimeout((() => {
  1407. e().append(element.br.element), e().append(tiktokButton.element), e().append(tiktokButton2.element)
  1408. }), 100)) : t == e() || e() || console.log("buttons are gone?!?!"), t = e()
  1409. }), 100)
  1410. }), {
  1411. callback: function() {}
  1412. })
  1413. }))
  1414. }]
  1415. ].filter((e => location.host.includes(e[0])))[0], a1 && a1[1] && a1[1](), console.log(a1), delete a1, __ex_ = _ex_, location.href.includes("onlymp3.app") || location.href.includes("onlymp3.to")) {
  1416. console.log("onlymp3.app");
  1417. let u = function() {};
  1418.  
  1419. function b_() {
  1420. var [e, t] = name.split(",");
  1421. txtUrl.value = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`, getListFormats()
  1422. }
  1423.  
  1424. function a_() {
  1425. var e = videoTitle.innerText.split("\n"),
  1426. t = e.map((e => e.match(/[:\d]+/gi))).filter((e => !!e)).pop().pop(),
  1427. n = e[0].split("Title: ")[1],
  1428. o = findhref2(videoTitle.parentNode)[0].href,
  1429. l = {
  1430. id: setElement(location.href),
  1431. href: o,
  1432. title: n,
  1433. length: t
  1434. };
  1435. (opener || window).postMessage(l, "*"), console.log("Poasted")
  1436. }
  1437. return setInterval((() => {
  1438. document.getElementById("error-text").innerText.length > 5 && location.reload()
  1439. }), 2e4), console.log("Getting MP3"), void tF((function(e = function() {}) {
  1440. b_(), tF((function(e = function() {}) {
  1441. a_()
  1442. }), {
  1443. callback: close
  1444. })
  1445. }), {
  1446. callback: function() {}
  1447. })
  1448. }
  1449. if (location.href.includes("www.yt2conv.com")) {
  1450. console.log("Getting MP4");
  1451. let [m, h] = name.split(",");
  1452. tF((function(e = function() {}) {
  1453. document.getElementById("search_txt").value = `https://www.youtube.com/${"1"==h?"shorts/":"watch?v="}${m}`, document.getElementById("btn-submit").click(), console.log(m, h)
  1454. }), {
  1455. callback: function() {}
  1456. }), tF((function(e = function() {}) {
  1457. if (console.log(result.children.length), !result.children.length) throw document.getElementById("btn-submit").click(), "no there"
  1458. }), {
  1459. int: 1e3,
  1460. callback: function() {}
  1461. }), tF((function() {
  1462. document.getElementById("btn-download").click()
  1463. }), {
  1464. callback: function() {}
  1465. }), tF((function() {
  1466. var e = $(".media-heading")[0].innerText,
  1467. t = downloadbtn.href,
  1468. n = {
  1469. id: m,
  1470. href: t,
  1471. title: e,
  1472. length: {}
  1473. };
  1474. console.log("Posted"), (opener || window).postMessage(n, "*")
  1475. }), {
  1476. callback: close
  1477. })
  1478. } else if (location.href.includes("yt5s.biz")) {
  1479. async function wfs(e) {
  1480. for (; !document.querySelector(e);) await sleep(0);
  1481. return !0
  1482. }(async function() {
  1483. let [e, t] = name.split(",");
  1484. if (!e.length || !t.length) return console.warn("No info Preset");
  1485. var n = `https://www.youtube.com/${"1"==t?"shorts/":"watch?v="}${e}`;
  1486. await wfs("#txt-url"), console.log("Input Loaded"), document.querySelector("#txt-url").value = n, await wfs("#btn-submit"), console.log("GEtting res"), await sleep(100), document.querySelector("#btn-submit").click(), await wfs("#video_title"), console.log("Got Res");
  1487. var o = document.querySelector("#video_title").innerText,
  1488. l = [0];
  1489. return [...document.querySelector("#result").querySelector("table").querySelectorAll("tr")].forEach((e => {
  1490. var t = e.innerText.match(/(?<res>\d+)(p|P)/i) || {};
  1491. t.groups && (t = Number(t.groups.res), l[0] < t && (l[0] = t, l[1] = findhref2(e)[0].href, l[2] = e))
  1492. })), {
  1493. id: e,
  1494. title: o,
  1495. href: l[1],
  1496. mp4: !0,
  1497. res: l[0]
  1498. }
  1499. })().then((function(e) {
  1500. (opener || window).postMessage(e, "*"), location.href = e.href
  1501. }), console.warn)
  1502. } else if (location.href.includes("sss.instasaverpro.com"))(async function() {
  1503. for (await async function(e) {
  1504. for (; !document.querySelector(e);) await sleep(0);
  1505. return !0
  1506. }("#A_downloadUrl"); !document.querySelector("#A_downloadUrl").href.length;) await sleep(0);
  1507. console.log("Done");
  1508. var e = document.querySelector("#myModalLabel").innerText,
  1509. t = {
  1510. href: document.querySelector("#A_downloadUrl").href,
  1511. title: e
  1512. };
  1513. (opener || window).postMessage(t, "*")
  1514. })().then(close, console.warn);
  1515. else if (location.href.includes("en3.onlinevideoconverter.pro")) {
  1516. let [p, w] = name.split(",");
  1517. if (!p.length || !w.length) return console.Warn("NO info Preset");
  1518. var YTurl = `https://www.youtube.com/${"1"==w?"shorts/":"watch?v="}${p}`;
  1519. let g = function() {};
  1520. tF((function(e = function() {}) {
  1521. document.getElementById("texturl").value = `https://www.youtube.com/${"1"==w?"shorts/":"watch?v="}${p}`, document.getElementById("convert1").click(), console.log("Searched")
  1522. }), {
  1523. callback: g
  1524. }), tF((function() {
  1525. if ("none" == stepProcess.style.display) throw document.getElementById("convert1").click(), "this";
  1526. console.log("Searching")
  1527. }), {
  1528. callback: g
  1529. }), tF((function() {
  1530. if (0 == document.getElementById("form-app-root").children.length) throw "";
  1531. console.log("loaded");
  1532. var {
  1533. title: e,
  1534. href: t
  1535. } = $("#download-720-MP4") && $("#download-720-MP4")[0] ? $("#download-720-MP4")[0] : $("#download-720-MP4"), n = {
  1536. id: p,
  1537. href: t,
  1538. title: e,
  1539. length: {}
  1540. };
  1541. console.log("Posted"), (opener || window).postMessage(n, "*")
  1542. }), {
  1543. callback: close
  1544. })
  1545. } else if (location.href.includes("savetik.co")) {
  1546. var [id, mp4] = name.split(",");
  1547.  
  1548. function Fin() {
  1549. console.log("Found");
  1550. let e = {
  1551. title: document.getElementsByClassName("clearfix")[0].innerText,
  1552. links: findhref2(document.getElementsByClassName("tik-video")[0]).map((e => e.href)),
  1553. mp4: 1 == mp4,
  1554. info: setElement2(id)
  1555. };
  1556. onmessage = function(e) {
  1557. if ("https://www.tiktok.com" == e.origin) {
  1558. var {
  1559. data: {
  1560. s: t,
  1561. url: n,
  1562. title: o
  1563. }
  1564. } = e;
  1565. console.log("Handled", {
  1566. s: t,
  1567. url: n,
  1568. title: o
  1569. }, e), t ? setTimeout(close, 100) : downloadFileAsTitle(n, o, null, close)
  1570. } else console.log("Unhandled Post", e)
  1571. }, (opener || window).postMessage(e, "*")
  1572. }
  1573. addEventListener("load", (function() {
  1574. tF((function() {
  1575. s_input.value = id, ksearchvideo(), setTimeout(ksearchvideo, 1e3)
  1576. }), {
  1577. callback() {}
  1578. })
  1579. })), tF((function() {
  1580. document.getElementsByClassName("clearfix")[0].innerText, Fin()
  1581. }), {
  1582. callback() {}
  1583. })
  1584. } else document.domain.includes("music") ? (console.log("Added MiniPlayer Toggle with I"), addEventListener("keypress", (function({
  1585. isTrusted: e,
  1586. ctrlKey: t,
  1587. shiftKey: n,
  1588. code: o,
  1589. target: l,
  1590. target: {
  1591. tagName: i
  1592. }
  1593. }) {
  1594. ["INPUT", "TEXTAREA"].includes(i) || t || n || !e || "KeyI" != o || (abc_("Close player page") || abc_("Open player page")[1]).click()
  1595. }))) : document.domain.includes("loader.to") && location.href.includes("/api/") && console.warn("using loader.to api");
  1596. const policy = window.trustedTypes && trustedTypes.createPolicy("trustedHTMLPolicy", {
  1597. createHTML: e => e,
  1598. createScriptURL: e => e
  1599. }),
  1600. styleContent = "\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",
  1601. styleElement = document.createElement("style");
  1602.  
  1603. function toggleIframeCollapse(e) {
  1604. const t = iframeElement.element;
  1605. e ? t.classList.add("collapse-frame") : t.classList.remove("collapse-frame")
  1606. }
  1607. styleElement.type = "text/css", styleElement.appendChild(document.createTextNode(policy ? policy.createHTML(styleContent) : styleContent));
  1608. var url = `https://www.youtube.com/watch?v=${setElement(location.href)}&adUrl=https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A?sub_confirm=1`,
  1609. src = policy ? policy.createScriptURL("https://loader.to/api/card2/?url=" + url) : "https://loader.to/api/card2/?url=" + url;
  1610. const iframeElement = new _element("iframe", {
  1611. id: "cardApiIframe",
  1612. scrolling: "no",
  1613. width: "100%",
  1614. height: "100%",
  1615. allowtransparency: "true",
  1616. style: "border: none",
  1617. src: src
  1618. }),
  1619. iframeResizerScript = new _element("script", {
  1620. src: policy ? policy.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"
  1621. });
  1622. iframeResizerScript.element.addEventListener("load", (() => {
  1623. "function" == typeof iFrameResize ? iFrameResize({
  1624. log: !1
  1625. }, "#cardApiIframe") : console.error("iFrameResize function not available")
  1626. }));
  1627. const containerDiv = new _element("div").append(iframeElement, iframeResizerScript),
  1628. target = document.querySelector("#secondary.ytd-watch-flexy");
  1629. var yedID = setElement(location.href);
  1630. iframeElement.element.addEventListener("load", (() => {
  1631. console.log("Iframe is fully loaded"), toggleIframeCollapse(!1)
  1632. })), toggleIframeCollapse(!0);
  1633. var adPlayTimeInSeconds = 4,
  1634. currentPB = 0,
  1635. setPlayerBack = 1,
  1636. setPlayerBackAd = 0,
  1637. isReloading = 0,
  1638. ts = 0,
  1639. cliked = 0,
  1640. check = (e, t) => e > t ? t : e;
  1641. setInterval((e => {
  1642. const t = document.querySelector("video"),
  1643. n = document.querySelector("#video-companion-root") || document.querySelector("#secondary-inner") || document.querySelector("#secondary.ytd-watch-flexy");
  1644. url = `https://www.youtube.com/watch?v=${setElement(location.href)}&adUrl=https://www.youtube.com/channel/UCOA8lE9-0XnEIdHqjfQUz1A?sub_confirm=1`, src = policy ? policy.createScriptURL("https://loader.to/api/card2/?url=" + url) : "https://loader.to/api/card2/?url=" + url, n && (!n.querySelector("#cardApiIframe") && (toggleIframeCollapse(!0), n.parentNode.prepend(styleElement), n.prepend(containerDiv.element), console.log("Added That Thing")), setElement(location.href) != yedID && (toggleIframeCollapse(!0), iframeElement.set("src", src), console.log("Fixed That Thing"), yedID = setElement(location.href)));
  1645. const o = query("yt-button-view-model#dismiss-button");
  1646. o && !isHidden(o) && o.click();
  1647. const l = document.getElementsByClassName("ytp-ad-button-icon")[0];
  1648. try {
  1649. if (l && !didmute) console.log("Muted ad"), console.log("Started at", tr), didmute = 1, t.playbackRate = check(t.duration / adPlayTimeInSeconds, 16), t.muted = 1;
  1650. else if (!l && didmute) {
  1651. console.log("Unmuted video");
  1652. try {
  1653. t.muted = 0
  1654. } catch (e) {
  1655. console.warn("Failed unmuting")
  1656. }
  1657. didmute = 0
  1658. }
  1659. } catch {}!didmute && document.querySelector("video") && (tr = document.querySelector("video") && document.querySelector("video").currentTime.toFixed());
  1660. 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];
  1661. i || document.querySelectorAll(".ytp-ad-button-icon")[0] ? (setPlayerBackAd && t.playbackRate == t.duration / 5 || (setPlayerBackAd = 1, console.log("Skipping ad :>")), !cliked && (setTimeout((() => {
  1662. i && i.click(), cliked = !1
  1663. }), 5e3), cliked = !0), setPlayerBack = 0) : !setPlayerBack && t ? (setPlayerBackAd = 0, setPlayerBack = 1, t.playbackRate = currentPB > 2 ? 1 : currentPB, console.log("Fixed playBack")) : t && (setPlayerBackAd = 0, (currentPB = t.playbackRate) > 2 && (t.playbackRate = 1));
  1664. const c = document.getElementsByClassName("ytp-ad-overlay-close-button")[2];
  1665. c && (c.click(), console.log("Closed ad card"));
  1666. let r = [...document.querySelectorAll(".yt-spec-button-shape-next")].filter((e => e.innerText.includes("Ads")))[0];
  1667. r && (r.click(), !isReloading && location.href.includes("watch") && (isReloading = 1, location.reload()))
  1668. }), 10)
  1669. }()
  1670. }();

QingJ © 2025

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