// ==UserScript== // @name GogoAnime++ // @namespace http://tampermonkey.net/ // @version 3.2 // @description Replaces the download link with a direct download link. // @author Arjix // @match *://*.gogoanime.vc/* // @match *://*.gogoanime.tv/* // @match *://*.gogoanime.io/* // @match *://*.gogoanime.in/* // @match *://*.gogoanime.se/* // @match *://*.gogoanime.sh/* // @match *://*.gogoanime.video/* // @match *://*.gogoanime.movie/* // @match *://*.gogoanime.so/* // @match *://*.gogoanimes.co/* // @match *://*.gogoanime.ai/* // @match *://*.animego.to/* // @grant GM_xmlhttpRequest // @grant GM_openInTab // @downloadURL none // ==/UserScript== // https://ourcodeworld.com/articles/read/682/what-does-the-not-allowed-to-navigate-top-frame-to-data-url-javascript-exception-means-in-google-chrome function debugBase64(base64URL){ var win = window.open(); win.document.write(''); } (function() { 'use strict'; window.addEventListener("load", function () { const title = document.title const test = document.querySelector('div#load_recent_release') if (title.includes("Watch") && test == undefined) { const link = document.querySelector("li.dowloads").firstChild.href var ret = GM_xmlhttpRequest({ method: "GET", url: link, onload: function(res) { var videoLinks = Array.from(res.response.matchAll(/ { let quality; if (link[2].includes("720")) { quality = 720 } else if (link[2].includes("480")) { quality = 480 } else if (link[2].includes("360")) { quality = 360 } else if (link[2].includes("HD") || link[2].includes("1080")) { quality = 1080 } let obj = {} obj["src"] = link[1] obj["size"] = quality obj["type"] = "video/mp4" qualities.push(obj) }) qualities.sort((a, b) => (a.size > b.size ? 1 : -1)) qualities = qualities.reverse(); console.log(qualities) var videoLink = videoLinks[0][1] const title = document.querySelector("div.anime_video_body > h1").innerText.replace(" at gogoanime", "") + ".mp4" var downloadButton = document.querySelector("li.dowloads").firstChild downloadButton.href = videoLink downloadButton.target = "_self" downloadButton.download = title document.querySelector("li.dowloads > a > span").innerText = "Direct Download" const css = ` video { --plyr-color-main: #ffc119; } ` const headJs = ` function initialize() { const playerPlr = new Plyr(document.querySelector("video")); playerPlr.source = { type: 'video', title: '${title}', sources: ${JSON.stringify(qualities)} }; }; ` const js = ` ` const header = "data:text/html," const html = `${js}` const linkPopUp = header+encodeURIComponent(html) const watchLink = `
Please, watch on another window with plyr. if you can't watch the video
` document.querySelector("div.anime_video_body > div.anime_video_body_cate > div.anime_video_note_watch").outerHTML = watchLink document.querySelector(".watchWithPlyr").onclick = () => {GM_openInTab(linkPopUp, {active: true})} } })} }, false) })();