Skip to content

Commit 8200ec4

Browse files
committed
[AniLINK] Fix attaching header button click listeners
1 parent a7d1aa2 commit 8200ec4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

AniLINK/AniLINK_Episode-Link-Extractor.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name AniLINK - Episode Link Extractor
33
// @namespace https://greasyfork.org/en/users/781076-jery-js
4-
// @version 6.21.2
4+
// @version 6.21.3
55
// @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!
66
// @icon https://www.google.com/s2/favicons?domain=animepahe.ru
77
// @author Jery
@@ -825,7 +825,7 @@ const Extractors = {
825825
const retryAfter = res.headers.get('Retry-After'); // Rate limit Policy: 10 requests per minute
826826
if (retryAfter) {
827827
const hhmmss = new Date(new Date().getTime() + parseInt(retryAfter) * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: true });
828-
showToast(`Rate limited by megacloud.blog, retrying in ${retryAfter} seconds (at ${hhmmss})...`, parseInt(retryAfter) * 1000);
828+
showToast(`Rate limited by megacloud.blog, retrying in ${retryAfter} secs (at ${hhmmss})...`, parseInt(retryAfter) * 1000);
829829
return await new Promise(res => setTimeout(res, 500 + parseInt(retryAfter) * 1000)).then(() => Extractors['megacloud.blog'](embed, referer)); // recursive retry
830830
}
831831
const html = await res.text();
@@ -1119,6 +1119,7 @@ async function extractEpisodes() {
11191119
<button type="button" class="anlink-play-all">Play with MPV</button>
11201120
`;
11211121
statusBarHeader.appendChild(headerButtons);
1122+
attachHeaderButtons();
11221123

11231124
// start interval to update status text
11241125
const statusInterval = setInterval(() => {
@@ -1382,13 +1383,13 @@ async function extractEpisodes() {
13821383
}
13831384

13841385
// Attach header button handlers
1385-
(function attachHeaderButtons() {
1386+
function attachHeaderButtons() {
13861387
const exportBtn = linksContainer.querySelector('.anlink-export-all');
13871388
const playBtn = linksContainer.querySelector('.anlink-play-all');
13881389

13891390
exportBtn.addEventListener('click', () => onExportAll(exportBtn));
13901391
playBtn.addEventListener('click', () => onPlayAll(playBtn));
1391-
})();
1392+
};
13921393

13931394
// Helper to get all selected episodes across all qualities
13941395
function getAllSelectedEpisodes() {

0 commit comments

Comments
 (0)