From b5d05304e2e92aba4a7ec2364195ab9129a505d1 Mon Sep 17 00:00:00 2001 From: Saksham Shekher <95137948+OshekharO@users.noreply.github.com> Date: Fri, 22 Sep 2023 07:59:17 -0700 Subject: [PATCH 1/5] Create Flixhq (#44) * Create Flixhq * Update flixhq.to.js Fixes spaces in description --- repo/flixhq.to.js | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 repo/flixhq.to.js diff --git a/repo/flixhq.to.js b/repo/flixhq.to.js new file mode 100644 index 0000000..e990053 --- /dev/null +++ b/repo/flixhq.to.js @@ -0,0 +1,98 @@ +// ==MiruExtension== +// @name Flixhq +// @version v0.0.1 +// @author OshekharO +// @lang all +// @license MIT +// @icon https://flixhq.ws/images/logo.png +// @package flixhq.to +// @type bangumi +// @webSite https://anipuff-consumet.vercel.app/movies/flixhq +// ==/MiruExtension== + +export default class extends Extension { + async req(url) { + return this.request(url, { + headers: { + "Miru-Url": await this.getSetting("flixhq"), + }, + }); + } + + async load() { + this.registerSetting({ + title: "FLIXHQ API", + key: "flixhq", + type: "input", + description: "Flixhq Api Url", + defaultValue: "https://anipuff-consumet.vercel.app/movies/flixhq", + }); + } + + async latest() { + const res = await this.req(`/A`); + const novelPromises = res.results.map(async (item) => { + const imgResponse = await fetch("https://api.waifu.pics/sfw/waifu"); + const imgData = await imgResponse.json(); + + return { + title: item.title, + url: item.id, + cover: imgData.url, + }; + }); + + return Promise.all(novelPromises); + } + + async detail(url) { + const res = await this.req(`/info?id=${url}`); + const imgResponse = await fetch("https://api.waifu.pics/sfw/waifu"); + const imgData = await imgResponse.json(); + + return { + title: res.title, + cover: imgData.url, + desc: res.description.trim(), + episodes: [ + { + title: "Directory", + urls: res.episodes.map((item) => ({ + name: `${item.title}`, + url: `${item.id}|${url}`, + })), + }, + ], + }; + } + + async search(kw) { + const res = await this.req(`/${kw}`); + const novelPromises = res.results.map(async (item) => { + const imgResponse = await fetch("https://api.waifu.pics/sfw/waifu"); + const imgData = await imgResponse.json(); + + return { + title: item.title, + url: item.id, + cover: imgData.url, + }; + }); + + return Promise.all(novelPromises); + } + + async watch(url) { + const [ep, md] = url.split("|"); + const res = await this.req(`/watch?episodeId=${ep}&mediaId=${md}&server=vidcloud`); + return { + type: "hls", + url: res.sources[0].url, + subtitles: res.subtitles.map((item) => ({ + title: item.lang, + url: item.url, + language: item.lang, + })), + }; + } +} From e1c3f22987b8b8a4788841af0a85c89db9d71e75 Mon Sep 17 00:00:00 2001 From: Automated Publisher Date: Fri, 22 Sep 2023 14:59:42 +0000 Subject: [PATCH 2/5] Automated publish: Fri Sep 22 14:59:42 UTC 2023 b5d05304e2e92aba4a7ec2364195ab9129a505d1 --- README.md | 1 + index.json | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 87aff77..e788740 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Miru extensions repository | [Miru App Download](https://github.com/miru-project | Comick | comick.app | v0.0.2 | OshekharO | all | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/comick.app.js) | | Comrademao | comrademao | v0.0.3 | OshekharO | en | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/comrademao.js) | | 7喜影院 | dev.0n0.miru.7xi | v0.0.5 | MiaoMint | zh-cn | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/dev.0n0.miru.7xi.js) | +| Flixhq | flixhq.to | v0.0.1 | OshekharO | all | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/flixhq.to.js) | | GoGoAnime | gogo.anime | v0.0.1 | OshekharO | en | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/gogo.anime.js) | | HentaiDexy | hentaidexy.net | v0.0.1 | OshekharO | en | true | [Source Code](https://github.com/miru-project/repo/blob/main/repo/hentaidexy.net.js) | | IsekaiScan | isekaiscan.to | v0.0.2 | bethro | en | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/isekaiscan.to.js) | diff --git a/index.json b/index.json index 99752d8..cad4f13 100644 --- a/index.json +++ b/index.json @@ -122,6 +122,18 @@ "version": "v0.0.5", "webSite": "https://www.7xi.tv/" }, + { + "author": "OshekharO", + "icon": "https://flixhq.ws/images/logo.png", + "lang": "all", + "license": "MIT", + "name": "Flixhq", + "package": "flixhq.to", + "type": "bangumi", + "url": "flixhq.to.js", + "version": "v0.0.1", + "webSite": "https://anipuff-consumet.vercel.app/movies/flixhq" + }, { "author": "OshekharO", "icon": "https://play-lh.googleusercontent.com/MaGEiAEhNHAJXcXKzqTNgxqRmhuKB1rCUgb15UrN_mWUNRnLpO5T1qja64oRasO7mn0", From 9b5ce530d4724b73ce121297af38d269cc58ec1c Mon Sep 17 00:00:00 2001 From: MiaoMint <44718819+MiaoMint@users.noreply.github.com> Date: Fri, 22 Sep 2023 23:04:22 +0800 Subject: [PATCH 3/5] Create me.mikanan.js (#45) * Create me.mikanan.js * fix: language errer --- repo/me.mikanan.js | 192 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 repo/me.mikanan.js diff --git a/repo/me.mikanan.js b/repo/me.mikanan.js new file mode 100644 index 0000000..c517044 --- /dev/null +++ b/repo/me.mikanan.js @@ -0,0 +1,192 @@ +// ==MiruExtension== +// @name Mikanani +// @version v0.0.1 +// @author MiaoMint +// @lang zh-cn +// @license MIT +// @icon https://mikanani.me/images/mikan-pic.png +// @package me.mikanani +// @type bangumi +// @webSite https://mikanani.me +// @description 蜜柑计划:新一代的动漫下载站 +// ==/MiruExtension== + +export default class extends Extension { + date = {}; + + async load() { + await this.registerSetting({ + title: "Source site", + key: "source", + type: "radio", + description: "Source site", + defaultValue: "https://mikanani.me", + options: { + "https://mikanani.me": "https://mikanani.me", + "https://mikanani.tv": "https://mikanani.tv", + }, + }); + } + + async req(url) { + return this.request(url, { + headers: { + "Miru-Url": await this.getSetting("source"), + }, + }); + } + + async getFullUrl(url) { + return `${await this.getSetting("source")}${url}`; + } + + async getDate() { + if (Object.keys(this.date).length != 0) { + return; + } + const res = await this.req("/"); + const dates = await this.querySelectorAll(res, ".dropdown-submenu"); + for (const item of dates) { + const html = item.content; + const year = await this.querySelector(html, ".default-cursor").text; + const seasons = await this.querySelectorAll(html, ".dropdown-menu li"); + const season = []; + for (const item of seasons) { + season.push( + await this.getAttributeText(item.content, "a", "data-season") + ); + } + this.date[year] = season; + } + } + + async createFilter(filter) { + await this.getDate(); + const currentYear = new Date().getFullYear(); + const season = { + title: "季度", + max: 1, + min: 1, + default: "春", + options: this.date[currentYear].reduce((obj, item) => { + obj[item] = item; + return obj; + }, {}), + }; + + if (filter && filter.year) { + season.options = this.date[filter.year[0]].reduce((obj, item) => { + obj[item] = item; + return obj; + }, {}); + } + + return { + year: { + title: "年份", + max: 1, + min: 1, + default: currentYear.toString(), + options: Object.keys(this.date).reduce((obj, item) => { + obj[item] = item; + return obj; + }, {}), + }, + season, + }; + } + + async latest(page) { + await this.getDate(); + const currentYear = new Date().getFullYear(); + const season = this.date[new Date().getFullYear()][0]; + const res = await this.req( + `/Home/BangumiCoverFlowByDayOfWeek?year=${currentYear}&seasonStr=${season}` + ); + const bangumi = []; + const lis = await this.querySelectorAll(res, ".sk-bangumi li"); + for (const item of lis) { + const html = item.content; + const cover = await this.getAttributeText(html, "span", "data-src"); + const title = await this.getAttributeText(html, "a", "title"); + const url = await this.getAttributeText(html, "a", "href"); + if (!url) { + continue; + } + bangumi.push({ + cover: await this.getFullUrl(cover), + title, + url, + }); + } + return bangumi; + } + + async detail(url) { + const res = await this.req(`${url}`); + const cover = await this.getFullUrl( + res.match(/background-image: url\('(.*)'\);/)[1] + ); + const title = await this.querySelector(res, ".bangumi-title").text; + const desc = await this.querySelector(res, ".header2-desc").text; + const bangumiId = (() => { + const arr = url.split("/"); + return arr[arr.length - 1]; + })(); + const subtitleGrups = []; + const listUnstyledLis = await this.querySelectorAll(res, ".leftbar-item"); + for (const item of listUnstyledLis) { + const html = item.content; + const name = await this.querySelector(html, "a").text; + const subtitleId = ( + await this.getAttributeText(html, "a", "data-anchor") + ).replace("#", ""); + subtitleGrups.push({ + name, + subtitleId, + }); + } + + const episodeGrups = []; + + for (const item of subtitleGrups) { + const res = await this.req( + `/Home/ExpandEpisodeTable?bangumiId=${bangumiId}&subtitleGroupId=${item.subtitleId}&take=999999` + ); + const trs = await this.querySelectorAll(res, "tbody tr"); + const episodes = []; + for (const item of trs) { + const html = item.content; + const name = await this.querySelector(html, "a").text; + const url = html.match(/\/Download\/.*\.torrent/)[0]; + episodes.push({ + name, + url, + }); + } + episodeGrups.push({ + title: item.name, + urls: episodes, + }); + } + + return { + title, + cover, + desc, + episodes: episodeGrups, + }; + } + + async search(kw, page, filter) { + throw Error("不支持搜索,请使用筛选"); + } + + async watch(url) { + console.log(await this.getFullUrl(url)); + return { + type: "torrent", + url: await this.getFullUrl(url), + }; + } +} From bad4395cffa9eb5019ed0caca33b76c688d05ee8 Mon Sep 17 00:00:00 2001 From: Automated Publisher Date: Fri, 22 Sep 2023 15:04:46 +0000 Subject: [PATCH 4/5] Automated publish: Fri Sep 22 15:04:46 UTC 2023 9b5ce530d4724b73ce121297af38d269cc58ec1c --- README.md | 1 + index.json | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index e788740..1a8ea3d 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Miru extensions repository | [Miru App Download](https://github.com/miru-project | 拷贝漫画 | mangacopy.comic | v0.0.1 | Monster | zh-cn | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/mangacopy.comic.js) | | マンガクロス | mangacross.jp | v0.0.1 | OshekharO | jp | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/mangacross.jp.js) | | MangaDex | mangadex.org | v0.0.1 | bethro | all | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/mangadex.org.js) | +| Mikanani | me.mikanani | v0.0.1 | MiaoMint | zh-cn | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/me.mikanan.js) | | Enime | moe.enime | v0.0.5 | MiaoMint | all | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/moe.enime.js) | | 轻小说文库 | moe.wol.wenku8 | v0.0.1 | NPGamma | zh-cn | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/moe.wol.wenku8.js) | | Mtlnation | mtlnation.com | v0.0.1 | OshekharO | en | false | [Source Code](https://github.com/miru-project/repo/blob/main/repo/mtlnation.com.js) | diff --git a/index.json b/index.json index cad4f13..5111006 100644 --- a/index.json +++ b/index.json @@ -232,6 +232,19 @@ "version": "v0.0.1", "webSite": "https://api.mangadex.org" }, + { + "author": "MiaoMint", + "description": "蜜柑计划:新一代的动漫下载站", + "icon": "https://mikanani.me/images/mikan-pic.png", + "lang": "zh-cn", + "license": "MIT", + "name": "Mikanani", + "package": "me.mikanani", + "type": "bangumi", + "url": "me.mikanan.js", + "version": "v0.0.1", + "webSite": "https://mikanani.me" + }, { "author": "MiaoMint", "description": "https://github.com/Enime-Project/api.enime.moe", From 0d6b3820b4eaa818325836483cbff48eb325c2fb Mon Sep 17 00:00:00 2001 From: MiaoMint <44718819+MiaoMint@users.noreply.github.com> Date: Fri, 22 Sep 2023 23:22:11 +0800 Subject: [PATCH 5/5] fix: `me.mikanan.js` search (#46) * Create me.mikanan.js * fix: language errer * fix: `me.mikanan.js` search --- repo/me.mikanan.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/repo/me.mikanan.js b/repo/me.mikanan.js index c517044..5f40e59 100644 --- a/repo/me.mikanan.js +++ b/repo/me.mikanan.js @@ -96,12 +96,10 @@ export default class extends Extension { }; } - async latest(page) { + async getData(year, season) { await this.getDate(); - const currentYear = new Date().getFullYear(); - const season = this.date[new Date().getFullYear()][0]; const res = await this.req( - `/Home/BangumiCoverFlowByDayOfWeek?year=${currentYear}&seasonStr=${season}` + `/Home/BangumiCoverFlowByDayOfWeek?year=${year}&seasonStr=${season}` ); const bangumi = []; const lis = await this.querySelectorAll(res, ".sk-bangumi li"); @@ -122,6 +120,13 @@ export default class extends Extension { return bangumi; } + async latest(page) { + await this.getDate(); + const currentYear = new Date().getFullYear(); + const season = this.date[new Date().getFullYear()][0]; + return this.getData(currentYear, season); + } + async detail(url) { const res = await this.req(`${url}`); const cover = await this.getFullUrl( @@ -179,7 +184,10 @@ export default class extends Extension { } async search(kw, page, filter) { - throw Error("不支持搜索,请使用筛选"); + if (!filter) { + return await this.latest() + } + return await this.getData(filter.year, filter.season) } async watch(url) {