|
1 | 1 | // ==UserScript== |
2 | 2 | // @name HD-Encode Search+ |
3 | 3 | // @namespace https://hdencode.org/ |
4 | | -// @version 1.0.9 |
| 4 | +// @version 1.1.0 |
5 | 5 | // @description Filtering, advanced sorting, live custom search, custom pagination, category switching, quick links, NFO panel, settings, presets, bulk copy, and sticky UI for HDEncode.org |
6 | 6 | // @author xXSalamanderXx |
7 | 7 | // @homepage https://github.com/xXSalamanderXx/HDEncode-Search-Plus/ |
|
147 | 147 | /* Remove default spin buttons for a cleaner look on numbers */ |
148 | 148 | #${SCRIPT_ID}-bar input[type=number]::-webkit-inner-spin-button, |
149 | 149 | #${SCRIPT_ID}-bar input[type=number]::-webkit-outer-spin-button { |
150 | | - opacity: 0.5; /* Keeping them visible but less intrusive */ |
| 150 | + opacity: 0.5; |
151 | 151 | } |
152 | 152 |
|
153 | 153 | #f-progress-bar { width: 0%; transition: width 0.3s ease-out; } |
|
398 | 398 | const h5 = item.querySelector('h5 a'); |
399 | 399 | if (!h5) return ''; |
400 | 400 | let text = h5.textContent || h5.innerText; |
401 | | - text = text.replace(/\[.*?\]/g, ''); |
402 | | - text = text.replace(/\(\d{4}\)/g, ''); |
| 401 | + |
| 402 | + // Strip bracketed tags, parenthesis years (temporarily) and sizes |
| 403 | + text = text.replace(/\[.*?\]/g, ' '); |
| 404 | + text = text.replace(/\(\d{4}\)/g, (match) => match.replace(/[()]/g, '')); |
403 | 405 | text = text.replace(/[–-]\s*[\d.]+\s*(GB|MB).*$/i, ''); |
404 | | - return text.trim(); |
| 406 | + |
| 407 | + // Cut off exactly at the scene release tags to remove the clutter |
| 408 | + const sceneCutoff = /\b(1080p|720p|2160p|480p|4k|uhd|web-dl|webrip|bluray|bdrip|brrip|hdtv|x264|x265|hevc|ddp\d|aac|ac3|dts|remux)\b.*/i; |
| 409 | + text = text.replace(sceneCutoff, ''); |
| 410 | + |
| 411 | + // Replace all dots and underscores with spaces |
| 412 | + text = text.replace(/[._]/g, ' '); |
| 413 | + |
| 414 | + // Clean up extra spaces and trailing hyphens |
| 415 | + text = text.replace(/\s+/g, ' ').replace(/\s-\s*$/, '').trim(); |
| 416 | + |
| 417 | + // Apply clean Title Case formatting |
| 418 | + text = text.split(' ').map(word => { |
| 419 | + if (word.match(/^s\d{2}e\d{2}$/i)) return word.toUpperCase(); // Preserve formatting for S01E01 |
| 420 | + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); |
| 421 | + }).join(' '); |
| 422 | + |
| 423 | + return text; |
405 | 424 | } |
406 | 425 |
|
407 | 426 | function hasDV(item) { |
|
0 commit comments