Size
3.3 KB
Version
1.1.1
Created
Jan 17, 2026
Updated
18 days ago
1// ==UserScript==
2// @name SeaDex nzbs.moe Link Button
3// @description Adds a button to view anime on nzbs.moe using the AniList ID
4// @version 1.1.1
5// @match https://*.releases.moe/*
6// @icon https://releases.moe/favicon.png
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 console.log('nzbs.moe button extension loaded');
12
13 function addButton() {
14 // Check if button already exists
15 if (document.querySelector('.nzbs-moe-button')) {
16 console.log('nzbs.moe button already exists');
17 return;
18 }
19
20 // Find the AniList link
21 const anilistLink = document.querySelector('a[href*="anilist.co/anime/"]');
22
23 if (!anilistLink) {
24 console.log('AniList link not found');
25 return;
26 }
27
28 // Extract the AniList ID from the URL
29 const anilistUrl = anilistLink.href;
30 const anilistIdMatch = anilistUrl.match(/\/anime\/(\d+)/);
31
32 if (!anilistIdMatch) {
33 console.log('Could not extract AniList ID');
34 return;
35 }
36
37 const anilistId = anilistIdMatch[1];
38 console.log('Found AniList ID:', anilistId);
39
40 // Create the nzbs.moe URL
41 const nzbsUrl = `https://nzbs.moe/series/al/${anilistId}`;
42
43 // Find the container where we'll add the button
44 const container = anilistLink.closest('.w-full.flex.flex-col');
45
46 if (!container) {
47 console.log('Container not found');
48 return;
49 }
50
51 // Create the button
52 const nzbsButton = document.createElement('a');
53 nzbsButton.href = nzbsUrl;
54 nzbsButton.target = '_blank';
55 nzbsButton.className = 'nzbs-moe-button inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-9 rounded-md text-sm px-4 mt-3 w-full';
56 nzbsButton.textContent = 'View on nzbs.moe';
57 nzbsButton.style.cssText = 'text-decoration: none; display: flex; align-items: center; justify-content: center;';
58
59 // Insert the button after the image container
60 const imageContainer = container.querySelector('.w-full.flex.justify-center.pb-2');
61 if (imageContainer) {
62 imageContainer.insertAdjacentElement('afterend', nzbsButton);
63 console.log('nzbs.moe button added successfully');
64 } else {
65 console.log('Image container not found');
66 }
67 }
68
69 function init() {
70 // Try to add button immediately
71 addButton();
72
73 // Also observe for dynamic content loading
74 const observer = new MutationObserver(function(mutations) {
75 addButton();
76 });
77
78 observer.observe(document.body, {
79 childList: true,
80 subtree: true
81 });
82
83 // Stop observing after 10 seconds
84 setTimeout(() => {
85 observer.disconnect();
86 console.log('Stopped observing for changes');
87 }, 10000);
88 }
89
90 // Wait for the page to load
91 if (document.readyState === 'loading') {
92 document.addEventListener('DOMContentLoaded', init);
93 } else {
94 init();
95 }
96})();