Moves the 'EZTV 20 Most Seeded Torrents (last 7 days)' section to the top of the page
Size
3.0 KB
Version
1.2.2
Created
Jan 27, 2026
Updated
8 days ago
1// ==UserScript==
2// @name EZTV Top Seeded Torrents Sorter
3// @description Moves the 'EZTV 20 Most Seeded Torrents (last 7 days)' section to the top of the page
4// @version 1.2.2
5// @match https://*.eztvx.to/*
6// @icon https://eztvx.to/favicon.ico
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 function debounce(func, wait) {
12 let timeout;
13 return function executedFunction(...args) {
14 const later = () => {
15 clearTimeout(timeout);
16 func(...args);
17 };
18 clearTimeout(timeout);
19 timeout = setTimeout(later, wait);
20 };
21 }
22
23 function moveMostSeededSection() {
24 console.log('EZTV Sorter: Looking for Most Seeded Torrents section...');
25
26 // Find the "EZTV 20 Most Seeded Torrents" section by its header
27 const mostSeededHeader = document.querySelector('td.most-seeded-header h1');
28 if (!mostSeededHeader || !mostSeededHeader.textContent.includes('EZTV 20 Most Seeded Torrents')) {
29 console.log('EZTV Sorter: Most Seeded Torrents section not found');
30 return;
31 }
32
33 // Get the table containing the most seeded section
34 const mostSeededTable = mostSeededHeader.closest('table.forum_header_border');
35 if (!mostSeededTable) {
36 console.log('EZTV Sorter: Most Seeded Torrents table not found');
37 return;
38 }
39
40 // Find the first table on the page (which should be the "Latest Added Torrents" section)
41 const firstTable = document.querySelector('table.forum_header_border');
42 if (!firstTable) {
43 console.log('EZTV Sorter: First table not found');
44 return;
45 }
46
47 // Check if the most seeded section is already at the top
48 if (mostSeededTable === firstTable) {
49 console.log('EZTV Sorter: Most Seeded Torrents section is already at the top');
50 return;
51 }
52
53 // Move the most seeded section to the top (before the first table)
54 firstTable.parentNode.insertBefore(mostSeededTable, firstTable);
55
56 // Add proper spacing between sections
57 mostSeededTable.style.marginBottom = '20px';
58 firstTable.style.marginTop = '20px';
59
60 console.log('EZTV Sorter: Successfully moved Most Seeded Torrents section to the top');
61 }
62
63 function init() {
64 console.log('EZTV Sorter: Extension initialized');
65
66 // Wait for page to fully load
67 if (document.readyState === 'loading') {
68 document.addEventListener('DOMContentLoaded', () => {
69 setTimeout(moveMostSeededSection, 1000);
70 });
71 } else {
72 setTimeout(moveMostSeededSection, 1000);
73 }
74
75 // Watch for dynamic content changes
76 const debouncedMove = debounce(moveMostSeededSection, 500);
77 const observer = new MutationObserver(debouncedMove);
78
79 observer.observe(document.body, {
80 childList: true,
81 subtree: true
82 });
83 }
84
85 init();
86})();