Skip to content

Commit c8331ed

Browse files
committed
[AniLINK] add support for UniqueStream
1 parent 5918e6c commit c8331ed

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

AniLINK/AniLINK_Episode-Link-Extractor.user.js

Lines changed: 17 additions & 1 deletion
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.24.0
4+
// @version 6.25.0
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
@@ -47,6 +47,7 @@
4747
// @match https://animekai.cc/watch/*
4848
// @match https://anikai.to/watch/*
4949
// @match https://yflix.to/watch/*
50+
// @match https://anime.uniquestream.net/*/*/*
5051
// @grant GM_registerMenuCommand
5152
// @grant GM_xmlhttpRequest
5253
// @grant GM.xmlHttpRequest
@@ -858,6 +859,21 @@ const Websites = [
858859
},
859860
_enc: async s => await GM_fetch(`https://enc-dec.app/api/enc-movies-flix?text=${s}`).then(r => r.json()).then(d => d.result),
860861
_dec: async s => await GM_fetch(`https://enc-dec.app/api/dec-movies-flix?text=${s}`).then(r => r.json()).then(d => d.result.url),
862+
},
863+
{
864+
name: 'UniqueStream',
865+
url: ['anime.uniquestream.net/series', 'anime.uniquestream.net/watch'],
866+
extractEpisodes: async function* (status) {
867+
if (location.href.includes('/watch/')) { _$('.episode-series-link').click(); await new Promise(resolve => setTimeout(resolve, 2000)); window.scrollBy(0, 1000); await new Promise(resolve => setTimeout(resolve, 2000)); }; // Navigate to episode list if on watch page
868+
for (const epElm of await applyEpisodeRangeFilter([..._$$('a[href*="/watch/"]')].slice(1)))
869+
yield* yieldEpisodesFromPromises([epElm].map(async epElm => { try {
870+
const [, epNum, epTitle] = epElm.querySelector('.episode-title').textContent.match(/(?:S\d+.+)?E-?(\d+|\w+) - (.+)/);
871+
status.text = `Extracting Episodes ${epNum}...`;
872+
const d = await fetch(`https://anime.uniquestream.net/api/v1/episode/${epElm.href.split('/')[4]}/media/dash/ja-JP`).then(r => r.json());
873+
const links = Object.fromEntries([d.dash, d.hls, ...(d.versions?.dash || []), ...(d.versions?.hls || [])].filter(Boolean).map(s => [`${s.playlist.includes('.mpd') ? 'dash' : 'hls'}-${s.locale}`, { stream: s.playlist, type: s.playlist.includes('.mpd') ? 'mpd' : 'm3u8', tracks: (s.hard_subs || []).map(h => ({ file: h.playlist, label: h.locale, kind: 'caption' })) }]));
874+
return !Object.keys(links).length ? null : new Episode(epNum, _$('.series-title').textContent, links, epElm.querySelector('img')?.src || '', epTitle);
875+
} catch (e) { showToast(`error ${e.status}: ${e.message}`); return null; } }));
876+
}
861877
}
862878
];
863879

0 commit comments

Comments
 (0)