Skip to content

Commit

Permalink
Merge pull request #134 from bachig26/main
Browse files Browse the repository at this point in the history
[add] pornxp
  • Loading branch information
OshekharO authored Dec 15, 2023
2 parents 8bade8f + fc5a3a3 commit 4d4c3bf
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 5 deletions.
97 changes: 97 additions & 0 deletions repo/pornxp.com.js
Original file line number Diff line number Diff line change
@@ -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 || "",
};
}
}
10 changes: 5 additions & 5 deletions repo/tamilyogi.js
Original file line number Diff line number Diff line change
@@ -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==

Expand All @@ -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);
Expand All @@ -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({
Expand Down

0 comments on commit 4d4c3bf

Please sign in to comment.