Greasy Fork

MagnetDL Search - YIFY Movies

Adds a button on YTS movie pages to search the movie title on MagnetDL.

当前为 2024-04-13 提交的版本,查看 最新版本

// ==UserScript==
// @name         MagnetDL Search - YIFY Movies
// @namespace    https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
// @version      1
// @description  Adds a button on YTS movie pages to search the movie title on MagnetDL.
// @author       hacker09
// @include      https://yts.mx/movies/*
// @icon         https://yts.mx/assets/images/website/apple-touch-icon-180x180.png
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  document.querySelector(".button-green-download2-big.hidden-xs.hidden-sm").insertAdjacentHTML('afterend', `<a onclick="location.href='https://www.magnetdl.com/k/${document.querySelector(".hidden-xs > h1").innerText.replace(/\s+/g, '-').toLowerCase()}'" class="torrent-modal-download button-green-download2-big hidden-xs hidden-sm" href="javascript:void(0);"><span class="icon-in"></span>Search on MagnetDL</a>`); //Adds a button on YTS movie pages to search the movie title MagnetDL.
  setTimeout(() => { document.querySelector("#movie-poster").outerHTML = document.querySelector("#movie-poster").outerHTML; }, 200); //Remove event listeners
})();