diff --git a/repo/pornxp.com.js b/repo/pornxp.com.js new file mode 100644 index 0000000..d967931 --- /dev/null +++ b/repo/pornxp.com.js @@ -0,0 +1,97 @@ +// ==MiruExtension== +// @name PornXP +// @version v0.0.1 +// @author bachig26 +// @lang en +// @license MIT +// @package pornxp.com +// @type bangumi +// @icon https://www.pornxp.com/logo2.png +// @webSite https://www.pornxp.com +// @nsfw true +// ==/MiruExtension== + +export default class extends Extension { + async latest(page) { + const res = await this.request("/released/?page={page}"); + const bsxList = await this.querySelectorAll(res, "div.item_cont"); + const novel = []; + for (const element of bsxList) { + const html = await element.content; + const url = await this.getAttributeText(html, "a", "href"); + const title = await this.querySelector(html, "div.item_title").text; + const cover = await this.querySelector(html, "img").getAttributeText("data-src"); + novel.push({ + title, + url: "https://www.pornxp.com" + url, + cover: "https:" + cover, + }); + } + return novel; + } + + async search(kw) { + const kwstring = kw.replace(/ /g, '+'); + const res = await this.request(`/?q=${kwstring}`); + const bsxList = await this.querySelectorAll(res, "div.item_cont"); + const novel = []; + + for (const element of bsxList) { + const html = await element.content; + const url = await this.getAttributeText(html, "a", "href"); + const title = await this.querySelector(html, "div.item_title").text; + const cover = await this.querySelector(html, "img").getAttributeText("data-src"); + novel.push({ + title, + url: "https://www.pornxp.com" + url, + cover: "https:" + cover, + }); + } + return novel; + } + + async detail(url) { + const res = await this.request("", { + headers: { + "Miru-Url": url, + }, + }); + + const title = await this.querySelector(res, "h1").text; + const cover = await this.querySelector(res, "video").getAttributeText("poster"); + const urlPatterns = [/\/\/[^\s'"]+\.(?:mp4|m3u8)/]; + + let episodeUrl = ""; + + for (const pattern of urlPatterns) { + const match = res.match(pattern); + if (match) { + episodeUrl = match[0]; + break; + } + } + + return { + title: title.trim(), + cover: "https:" + cover, + episodes: [ + { + title: "Directory", + urls: [ + { + name: title, + url: "https:" + episodeUrl, + }, + ], + }, + ], + }; + } + + async watch(url) { + return { + type: "hls", + url: url || "", + }; + } +} diff --git a/repo/tamilyogi.js b/repo/tamilyogi.js index 4586cc3..feeec3b 100644 --- a/repo/tamilyogi.js +++ b/repo/tamilyogi.js @@ -1,13 +1,13 @@ // ==MiruExtension== // @name TamilYogi -// @version v0.0.3 +// @version v0.0.4 // @author appdevelpo // @lang hi-ta // @license MIT -// @icon https://tamilyogi.party/wp-content/uploads/2021/06/ty.png +// @icon https://tamilyogi.plus/wp-content/uploads/2021/06/ty.png // @package tamilyogi // @type bangumi -// @webSite https://tamilyogi.party +// @webSite https://tamilyogi.plus // @nsfw false // ==/MiruExtension== @@ -17,7 +17,7 @@ export default class extends Extension { const bsxList = res.match(/"cover[\s\S]+?postmetadata/g); const bangumi = []; bsxList.forEach((element) => { - const url = element.match(/href="https:\/\/tamilyogi.party(.+?)"/)[1]; + const url = element.match(/href="https:\/\/tamilyogi.plus(.+?)"/)[1]; // console.log(url); const title = element.match(/alt="(.+?)"/)[1]; // console.log(title); @@ -37,7 +37,7 @@ export default class extends Extension { const bsxList = res.match(/"cover[\s\S]+?postmetadata/g); const bangumi = []; bsxList.forEach((element) => { - const url = element.match(/href="https:\/\/tamilyogi.party(.+?)"/)[1]; + const url = element.match(/href="https:\/\/tamilyogi.plus(.+?)"/)[1]; const title = element.match(/alt="(.+?)"/)[1]; const cover_match = element.match(/src="(.+?)"/)[1]; bangumi.push({