|
1 | 1 | // ==UserScript== |
2 | 2 | // @name AniLINK - Episode Link Extractor |
3 | 3 | // @namespace https://greasyfork.org/en/users/781076-jery-js |
4 | | -// @version 6.23.0 |
| 4 | +// @version 6.24.0 |
5 | 5 | // @description Stream or download your favorite anime series effortlessly with AniLINK! Unlock the power to play any anime series directly in your preferred video player or download entire seasons in a single click using popular download managers like IDM. AniLINK generates direct download links for all episodes, conveniently sorted by quality. Elevate your anime-watching experience now! |
6 | 6 | // @icon https://www.google.com/s2/favicons?domain=animepahe.ru |
7 | 7 | // @author Jery |
@@ -839,8 +839,7 @@ const Websites = [ |
839 | 839 | extractEpisodes: async function* (status) { |
840 | 840 | status.text = 'Fetching episode list...'; |
841 | 841 | const contentId = _$('div.rating[data-id]')?.dataset.id; if (!contentId) return; |
842 | | - const encId = await this._enc(contentId); |
843 | | - const epElms = await fetch(`/ajax/episodes/list?id=${contentId}&_=${encId}`, { headers: { 'X-Requested-With': 'XMLHttpRequest' } }).then(r => r.json().then(d => d.result)).then(t => (new DOMParser()).parseFromString(t, 'text/html')).then(doc => [...doc.querySelectorAll('ul.episodes[data-season] li a')]); |
| 842 | + const epElms = [...document.querySelectorAll('ul.episodes:not([style*="display: none"]) li a')]; |
844 | 843 | const filteredEps = await applyEpisodeRangeFilter(epElms); if (!filteredEps?.length) return; |
845 | 844 | const srcCfg = await (async () => { |
846 | 845 | const servers = await fetch(`/ajax/links/list?eid=${filteredEps[0].getAttribute('eid')}&_=${await this._enc(filteredEps[0].getAttribute('eid'))}`, { headers: { 'X-Requested-With': 'XMLHttpRequest' } }).then(r => r.json().then(d => d.result)).then(t => (new DOMParser()).parseFromString(t, 'text/html')).then(doc => [...doc.querySelectorAll('li.server span')].map(s => s.textContent.trim())); |
@@ -1098,6 +1097,7 @@ async function extractEpisodes() { |
1098 | 1097 | @import url('https://fonts.googleapis.com/icon?family=Material+Icons'); |
1099 | 1098 |
|
1100 | 1099 | #AniLINK_Overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); z-index: 1000; display: flex; align-items: center; justify-content: center; } |
| 1100 | + #AniLINK_RerunBtn { position: fixed; top: 10px; right: 10px; background: transparent; border: 0; font-size: 36px; color: red; } #AniLINK_RerunBtn:hover { cursor: pointer; color: darkred; background-color: rgba(255, 255, 255, 0.1); } |
1101 | 1101 | #AniLINK_LinksContainer { width: 80%; max-height: 85%; background-color: #222; color: #eee; padding: 20px; border-radius: 8px; overflow-y: auto; display: flex; flex-direction: column;} |
1102 | 1102 | .anlink-status-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } /* Header for status bar and stop button */ |
1103 | 1103 | .anlink-status-bar { color: #eee; flex-grow: 1; margin-right: 10px; display: block; } /* Status bar takes space */ |
@@ -1152,6 +1152,17 @@ async function extractEpisodes() { |
1152 | 1152 | ? overlayDiv.remove() |
1153 | 1153 | : overlayDiv.style.display = "none"); |
1154 | 1154 |
|
| 1155 | + // Rerun button |
| 1156 | + const rerunBtn = document.createElement('button'); |
| 1157 | + rerunBtn.id = 'AniLINK_RerunBtn'; |
| 1158 | + rerunBtn.title = 'Reset and Rerun Extraction'; |
| 1159 | + rerunBtn.innerHTML = '<i class="material-icons" style="color:inherit;">delete</i>'; |
| 1160 | + rerunBtn.addEventListener('click', () => { |
| 1161 | + overlayDiv.remove(); |
| 1162 | + extractEpisodes(); |
| 1163 | + }); |
| 1164 | + overlayDiv.appendChild(rerunBtn); |
| 1165 | + |
1155 | 1166 | // Create a container for links |
1156 | 1167 | const linksContainer = document.createElement('div'); |
1157 | 1168 | linksContainer.id = "AniLINK_LinksContainer"; |
|
0 commit comments