From 85bb02b30b8fb4bdc543391f1b129434716975b3 Mon Sep 17 00:00:00 2001 From: Swakshan Date: Mon, 27 Jan 2025 23:01:35 +0530 Subject: [PATCH 1/2] extension(aniplay): Fixed Yuki provider --- javascript/anime/src/en/aniplay.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/javascript/anime/src/en/aniplay.js b/javascript/anime/src/en/aniplay.js index fb6b31e9..e08d3d6f 100644 --- a/javascript/anime/src/en/aniplay.js +++ b/javascript/anime/src/en/aniplay.js @@ -6,7 +6,7 @@ const mangayomiSources = [{ "iconUrl": "https://www.google.com/s2/favicons?sz=128&domain=https://aniplaynow.live/", "typeSource": "single", "itemType": 1, - "version": "1.0.2", + "version": "1.0.3", "dateFormat": "", "dateFormatLocale": "", "pkgPath": "anime/src/en/aniplay.js" @@ -427,8 +427,13 @@ class DefaultExtension extends MProvider { var m3u8Url = result.sources[0].url var streams = await this.extractStreams(m3u8Url, "yuki"); - - var subtitles = result.tracks + var subtitles = [] + result.subtitles.forEach(sub => { + subtitles.push({ + "label": sub.lang, + "file": sub.url, + }); + }) streams[0].subtitles = subtitles return streams @@ -487,8 +492,8 @@ class DefaultExtension extends MProvider { "title": "Preferred provider", "summary": "", "valueIndex": 0, - "entries": ["All", "Anya", "Yuki"], - "entryValues": ["all", "anya", "yuki"], + "entries": ["Any", "Anya", "Yuki"], + "entryValues": ["any", "anya", "yuki"], } }, { "key": "aniplay_pref_mark_filler", From 1be2f2f055ec1054ba9e21d223e9e09b8ca62121 Mon Sep 17 00:00:00 2001 From: Swakshan Date: Mon, 27 Jan 2025 23:08:16 +0530 Subject: [PATCH 2/2] extension(aniplay): Added Pahe provider and remove Anya provider --- javascript/anime/src/en/aniplay.js | 37 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/javascript/anime/src/en/aniplay.js b/javascript/anime/src/en/aniplay.js index e08d3d6f..571c9803 100644 --- a/javascript/anime/src/en/aniplay.js +++ b/javascript/anime/src/en/aniplay.js @@ -6,7 +6,7 @@ const mangayomiSources = [{ "iconUrl": "https://www.google.com/s2/favicons?sz=128&domain=https://aniplaynow.live/", "typeSource": "single", "itemType": 1, - "version": "1.0.3", + "version": "1.1.0", "dateFormat": "", "dateFormatLocale": "", "pkgPath": "anime/src/en/aniplay.js" @@ -322,7 +322,7 @@ class DefaultExtension extends MProvider { throw new Error("Error: No data found for the given URL"); } - var user_provider = this.getPreference("aniplay_pref_provider_new"); + var user_provider = this.getPreference("aniplay_pref_provider_2"); var choices = result if (user_provider !== "all") { for (var ch of result) { @@ -386,14 +386,15 @@ class DefaultExtension extends MProvider { } // Extracts the streams url for different resolutions from a hls stream. - async extractStreams(url, providerId) { - const response = await new Client().get(url); + async extractStreams(url, providerId, hdr = {}) { + const response = await new Client().get(url, hdr); const body = response.body; const lines = body.split('\n'); var streams = [{ url: url, originalUrl: url, - quality: "auto", + quality: `Auto - ${providerId}`, + headers: hdr }]; for (let i = 0; i < lines.length; i++) { @@ -410,6 +411,7 @@ class DefaultExtension extends MProvider { url: m3u8Url, originalUrl: m3u8Url, quality: `${resolution} - ${providerId}`, + headers: hdr }); } } @@ -417,9 +419,8 @@ class DefaultExtension extends MProvider { } - async getAnyaStreams(result) { + async getAnyStreams(result) { var m3u8Url = result.sources[0].url - m3u8Url = `https://prox.uqable.easypanel.host/fetch?url=${m3u8Url}&ref=https://anix.sh` return await this.extractStreams(m3u8Url, "anya"); } @@ -439,6 +440,12 @@ class DefaultExtension extends MProvider { return streams } + async getPaheStreams(result) { + var m3u8Url = result.sources[0].url + var hdr = result.headers; + return await this.extractStreams(m3u8Url, "pahe", hdr); + } + // For anime episode video list async getVideoList(url) { var urlSplits = url.split("||") @@ -463,13 +470,15 @@ class DefaultExtension extends MProvider { } var streams = [] - if (providerId == "anya") { - streams = await this.getAnyaStreams(result) - } - else { + if (providerId == "yuki") { streams = await this.getYukiStreams(result) + } else if (providerId == "pahe") { + streams = await this.getPaheStreams(result) + } else { + streams = await this.getAnyStreams(result) //If new provider found getAnyaStreams will extract only the streams } + return await this.sortStreams(streams) } @@ -487,13 +496,13 @@ class DefaultExtension extends MProvider { } }, { - "key": "aniplay_pref_provider_new", + "key": "aniplay_pref_provider_2", "listPreference": { "title": "Preferred provider", "summary": "", "valueIndex": 0, - "entries": ["Any", "Anya", "Yuki"], - "entryValues": ["any", "anya", "yuki"], + "entries": ["Any", "Yuki", "Pahe"], + "entryValues": ["any", "yuki", "pahe"], } }, { "key": "aniplay_pref_mark_filler",