Gaston's - Video/Image Downloader

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

2025-02-01 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

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