From 8b64bd367b4d5f213b9b05e00c552af1c1cb221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADng=20Y=C3=AC?= Date: Sat, 30 Sep 2023 21:49:53 +0700 Subject: [PATCH 1/3] Added "Preferred quality" option --- repo/gogo.anime.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/repo/gogo.anime.js b/repo/gogo.anime.js index e5aee7a..e32dc0c 100644 --- a/repo/gogo.anime.js +++ b/repo/gogo.anime.js @@ -24,9 +24,16 @@ export default class extends Extension { title: "GoGo API", key: "gogoApi", type: "input", - description: "GoGo Api Url", + description: "API URL", defaultValue: "https://api.consumet.org/anime/gogoanime", }); + this.registerSetting({ + title: "Preferred quality", + key: "prefQuality", + type: "input", + description: "Choose between 360p/480p/720p/1080p", + defaultValue: "480p", + }); } async latest(page) { @@ -66,10 +73,20 @@ export default class extends Extension { } async watch(url) { + const quality = await this.getSetting("prefQuality"); const res = await this.req(`/watch/${url}?server=gogocdn`); - return { - type: "hls", - url: res.sources.pop().url, - }; + const prefQuality = res.sources.find(source => source.quality === quality); + + if (prefQuality) { + return { + type: "hls", + url: prefQuality.url, + }; + } else { + return { + type: "hls", + url: res.sources.pop().url, + }; + } } } From 3fc7868b7d5f6fcae111da36edab3239fce9aa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADng=20Y=C3=AC?= Date: Sat, 30 Sep 2023 22:18:15 +0700 Subject: [PATCH 2/3] Update gogo.anime.js version number (#54) --- repo/gogo.anime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/gogo.anime.js b/repo/gogo.anime.js index e32dc0c..3dbbee9 100644 --- a/repo/gogo.anime.js +++ b/repo/gogo.anime.js @@ -1,6 +1,6 @@ // ==MiruExtension== // @name GoGoAnime -// @version v0.0.1 +// @version v0.0.2 // @author OshekharO // @lang en // @license MIT From c4d623d494114474b81dc75853692b1f89e9bfad Mon Sep 17 00:00:00 2001 From: Automated Publisher Date: Sat, 30 Sep 2023 15:18:42 +0000 Subject: [PATCH 3/3] Automated publish: Sat Sep 30 15:18:42 UTC 2023 3fc7868b7d5f6fcae111da36edab3239fce9aa11 --- README.md | 2 +- index.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c47529..4a62b53 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Miru extensions repository | [Miru App Download](https://github.com/miru-project | Comrademao | comrademao | v0.0.3 | OshekharO | en | fikushon | [Source Code](https://github.com/miru-project/repo/blob/main/repo/comrademao.js) | | 7喜影院 | dev.0n0.miru.7xi | v0.0.5 | MiaoMint | zh-cn | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/dev.0n0.miru.7xi.js) | | Flixhq | flixhq.to | v0.0.1 | OshekharO | all | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/flixhq.to.js) | -| GoGoAnime | gogo.anime | v0.0.1 | OshekharO | en | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/gogo.anime.js) | +| GoGoAnime | gogo.anime | v0.0.2 | OshekharO | en | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/gogo.anime.js) | | Invidious | invidious.io | v0.0.1 | OshekharO | all | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/invidious.io.js) | | IsekaiScan | isekaiscan.to | v0.0.2 | bethro | en | manga | [Source Code](https://github.com/miru-project/repo/blob/main/repo/isekaiscan.to.js) | | Kissasian | kissasian.fm | v0.0.1 | OshekharO | en | bangumi | [Source Code](https://github.com/miru-project/repo/blob/main/repo/kissasian.fm.js) | diff --git a/index.json b/index.json index b3ca2ab..586aea5 100644 --- a/index.json +++ b/index.json @@ -143,7 +143,7 @@ "package": "gogo.anime", "type": "bangumi", "url": "gogo.anime.js", - "version": "v0.0.1", + "version": "v0.0.2", "webSite": "https://api.consumet.org/anime/gogoanime" }, {