您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds an "import ISRCs" link to MusicBrainz release pages with a Spotify or Deezer URL
// ==UserScript== // @name MusicBrainz: Add Spotify and Deezer ISRC link to release pages // @namespace https://musicbrainz.org/user/chaban // @version 1.2 // @tag ai-created // @description Adds an "import ISRCs" link to MusicBrainz release pages with a Spotify or Deezer URL // @author atj, chaban // @license MIT // @match *://*.musicbrainz.org/release/* // @icon https://musicbrainz.org/static/images/favicons/android-chrome-512x512.png // @grant none // @run-at document-idle // ==/UserScript== const SpotifyLinkRegexp = /^https?:\/\/open\.spotify\.com\/album\//i; const DeezerLinkRegexp = /^https?:\/\/www\.deezer\.com\/album\//i; /** * Adds an "import ISRCs" link next to the given link element. * @param {HTMLElement} linkElement - The link element to add the "import ISRCs" link after. * @param {string} type - The type of service ("spotify" or "deezer"). * @param {string} id - The ID of the album. */ function addImportLink(linkElement, type, id) { const isrcHuntUrl = `https://isrchunt.com/${type}/importisrc?releaseId=${id}`; let curElem = linkElement.nextElementSibling.nextSibling; let elem = document.createTextNode(' ['); curElem = insertAfter(elem, curElem); elem = document.createElement('a'); elem.href = isrcHuntUrl; elem.innerText = 'import ISRCs'; curElem = insertAfter(elem, curElem); elem = document.createTextNode(']'); insertAfter(elem, curElem); } function insertAfter(elem, after) { if (after.parentNode) { after.parentNode.insertBefore(elem, after.nextSibling); } return elem; } function addImportIsrcsLink() { const releaseRels = document.getElementById('release-relationships'); if (!releaseRels) { return; } for (const bdi of releaseRels.getElementsByTagName('bdi')) { let matches = bdi.innerText.match(SpotifyLinkRegexp); if (matches) { const spotifyId = bdi.innerText.split('/').pop(); const spotifyLink = bdi.parentElement; addImportLink(spotifyLink, 'spotify', spotifyId); } matches = bdi.innerText.match(DeezerLinkRegexp); if (matches) { const deezerId = bdi.innerText.split('/').pop(); const deezerLink = bdi.parentElement; addImportLink(deezerLink, 'deezer', deezerId); } } } window.setTimeout(addImportIsrcsLink, 250);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址