您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces the IMDb post title with its corresponding TorrentGalaxy catalog link
// ==UserScript== // @name IMDb - Link Titles to TorrentGalaxy // @description Replaces the IMDb post title with its corresponding TorrentGalaxy catalog link // @version 1.1 // @namespace io.github.ni554n // @match https://www.imdb.com/title/tt* // @match https://m.imdb.com/title/tt* // @run-at document-idle // @supportURL https://github.com/ni554n/userscripts/issues // @license MIT // @author Nissan Ahmed // @homepageURL https://anissan.com // @contributionURL https://paypal.me/ni554n // ==/UserScript== const titleElement = document.querySelector( `h1[data-testid="hero__pageTitle"]`, ); if (!titleElement) { throw new Error("Failed to get the reference of the title."); } replaceTitle(); // Oftentimes IMDb updates the title dynamically. // This observer will make sure to replace the default title again when that happens. new MutationObserver(replaceTitle).observe(titleElement, { childList: true }); function replaceTitle(_, observer) { // As we are observing the same element that we are going to update, to avoid // infinite loop disconnecting the observer beforehand is required. if (observer) observer.disconnect(); const imdbId = /** @type {HTMLMetaElement | null} */ ( document.querySelector(`meta[property="imdb:pageConst"]`) )?.content; if (!imdbId) throw new Error("Failed to get the IMDb ID from the meta tag."); const title = /** @type {HTMLElement} */ (titleElement).innerText; /** @type {HTMLElement} */ ( titleElement ).innerHTML = `<a href="https://torrentgalaxy.to/torrents.php?search=${imdbId}" title="Open TorrentGalaxy Catalog" target="_blank" style="color: white">${title}</a> ↗`; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址