AnimeBytes to nzbs.moe Link

Adds a link to nzbs.moe based on AniList ID

Size

2.9 KB

Version

1.1.2

Created

Jan 17, 2026

Updated

18 days ago

1// ==UserScript==
2// @name		AnimeBytes to nzbs.moe Link
3// @description		Adds a link to nzbs.moe based on AniList ID
4// @version		1.1.2
5// @match		https://*.animebytes.tv/*
6// @icon		https://animebytes.tv/static/favicon-5fc4df4e68.ico
7// ==/UserScript==
8(function() {
9    'use strict';
10    
11    console.log('AnimeBytes to nzbs.moe Link extension loaded');
12    
13    function addNzbsMoeLink() {
14        // Find the h3 element containing the AniList link
15        const h3Element = document.querySelector('h3 a[href*="anilist.co/anime/"]');
16        
17        if (!h3Element) {
18            console.log('No AniList link found on this page');
19            return false;
20        }
21        
22        // Check if the link already exists
23        if (document.querySelector('a[href*="nzbs.moe"]')) {
24            console.log('nzbs.moe link already exists');
25            return true;
26        }
27        
28        // Extract the AniList ID from the URL
29        const anilistUrl = h3Element.href;
30        const anilistIdMatch = anilistUrl.match(/anilist\.co\/anime\/(\d+)/);
31        
32        if (!anilistIdMatch) {
33            console.log('Could not extract AniList ID from URL:', anilistUrl);
34            return false;
35        }
36        
37        const anilistId = anilistIdMatch[1];
38        console.log('Found AniList ID:', anilistId);
39        
40        // Create the nzbs.moe URL
41        const nzbsMoeUrl = `https://nzbs.moe/series/al/${anilistId}`;
42        
43        // Create the new link element
44        const nzbsMoeLink = document.createElement('a');
45        nzbsMoeLink.href = nzbsMoeUrl;
46        nzbsMoeLink.textContent = 'nzbs.moe';
47        nzbsMoeLink.target = '_blank';
48        
49        // Add the link to the h3 element (after AniList link)
50        const h3Parent = h3Element.parentElement;
51        h3Parent.appendChild(document.createTextNode(' | '));
52        h3Parent.appendChild(nzbsMoeLink);
53        
54        console.log('Added nzbs.moe link:', nzbsMoeUrl);
55        return true;
56    }
57    
58    function init() {
59        // Try to add the link immediately
60        if (addNzbsMoeLink()) {
61            return;
62        }
63        
64        // If not found, wait for the content to load using MutationObserver
65        console.log('Waiting for page content to load...');
66        const observer = new MutationObserver((mutations) => {
67            if (addNzbsMoeLink()) {
68                observer.disconnect();
69            }
70        });
71        
72        observer.observe(document.body, {
73            childList: true,
74            subtree: true
75        });
76        
77        // Stop observing after 10 seconds
78        setTimeout(() => {
79            observer.disconnect();
80            console.log('Stopped waiting for content');
81        }, 10000);
82    }
83    
84    // Run when the page is loaded
85    if (document.readyState === 'loading') {
86        document.addEventListener('DOMContentLoaded', init);
87    } else {
88        init();
89    }
90})();
AnimeBytes to nzbs.moe Link | Robomonkey