Greasy Fork

GogoAnime Direct Download Button

Replaces the download link with a direct download link.

目前为 2020-12-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         GogoAnime Direct Download Button
// @namespace    http://tampermonkey.net/
// @version      2.0
// @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        *://*.animego.to/*
// @grant        GM_xmlhttpRequest
// ==/UserScript==


(function() {
    'use strict';
    window.addEventListener("load", function () {
        const title = document.title
        if (title.includes("Watch")) {
        const link = document.querySelector("li.dowloads").firstChild.href
        var ret = GM_xmlhttpRequest({
            method: "GET",
            url: link,
            onload: function(res) {
                var videoLink = res.response.match("<a\n.*?[\"'](http.*?)['\"]")[1]
                document.querySelector("li.dowloads").firstChild.href = videoLink
                document.querySelector("li.dowloads").firstChild.download = document.querySelector("div.anime_video_body > h1").innerText.replace(" at gogoanime", "") + ".mp4"
                document.querySelector("li.dowloads > a > span").innerText = "Direct Download"
  }
})}
    }, false)
})();