Skip to content

Commit

Permalink
[Add] few NSFW extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
OshekharO authored Dec 21, 2023
2 parents 4514cbd + 7b84560 commit 0e1ae2d
Show file tree
Hide file tree
Showing 5 changed files with 503 additions and 0 deletions.
100 changes: 100 additions & 0 deletions repo/draftsex.porn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// ==MiruExtension==
// @name Draftsex
// @version v0.0.1
// @author bachig26
// @lang en
// @license MIT
// @package draftsex.porn
// @type bangumi
// @icon https://draftsex.porn/templates/ds/images/draftsex.png
// @webSite https://draftsex.porn
// @nsfw true
// ==/MiruExtension==

export default class extends Extension {
async latest(page) {
const res = await this.request(`/page${page}.html`);
const bsxList = await this.querySelectorAll(res, "div.item.col");
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, "span.item__title-label").text;
const cover = await this.querySelector(html, "img").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async search(kw) {
const kwstring = kw.replace(/ /g, '-');
const res = await this.request(`/search/${kwstring}/`);
const bsxList = await this.querySelectorAll(res, "div.item.col");
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, "span.item__title-label").text;
const cover = await this.querySelector(html, "img").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async detail(url) {
const res = await this.request("", {
headers: {
"Miru-Url": url,
},
});

const title = await this.querySelector(res, "h1.mhead__h").text;
const cover = res.match(/posterImage: "(.+?)"/)[1];
const desc = await this.querySelector(res, "ul.tag-list > span.tag-list__label").text;

const urlPatterns = [/<source title='Best Quality' src="(.+?\.mp4)"/];

let episodeUrl = "";

for (const pattern of urlPatterns) {
const match = res.match(pattern);
if (match) {
episodeUrl = match[1];
break;
}
}

return {
title: title.trim(),
cover,
desc,
episodes: [
{
title: "Directory",
urls: [
{
name: title,
url: episodeUrl,
},
],
},
],
};
}

async watch(url) {
return {
type: "hls",
url: url || "",
};
}
}
100 changes: 100 additions & 0 deletions repo/pornenix.com.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// ==MiruExtension==
// @name PornEnix
// @version v0.0.1
// @author bachig26
// @lang en
// @license MIT
// @package pornenix.com
// @type bangumi
// @icon https://pornenix.com/templates/pornenix/images/logo.png
// @webSite https://pornenix.com
// @nsfw true
// ==/MiruExtension==

export default class extends Extension {
async latest(page) {
const res = await this.request(`/videos/page${page}.html`);
const bsxList = await this.querySelectorAll(res, "div.item.col");
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, "span.item__title-label").text;
const cover = await this.querySelector(html, "img").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async search(kw) {
const kwstring = kw.replace(/ /g, '-');
const res = await this.request(`/search/${kwstring}/`);
const bsxList = await this.querySelectorAll(res, "div.item.col");
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, "span.item__title-label").text;
const cover = await this.querySelector(html, "img").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async detail(url) {
const res = await this.request("", {
headers: {
"Miru-Url": url,
},
});

const title = await this.querySelector(res, "h1.mhead__h").text;
const cover = res.match(/posterImage: "(.+?)"/)[1];
const desc = await this.querySelector(res, "ul.tag-list > span.tag-list__label").text;

const urlPatterns = [/<source title="Best Quality" src="(.+?\.mp4)"/];

let episodeUrl = "";

for (const pattern of urlPatterns) {
const match = res.match(pattern);
if (match) {
episodeUrl = match[1];
break;
}
}

return {
title: title.trim(),
cover,
desc,
episodes: [
{
title: "Directory",
urls: [
{
name: title,
url: episodeUrl,
},
],
},
],
};
}

async watch(url) {
return {
type: "hls",
url: url || "",
};
}
}
103 changes: 103 additions & 0 deletions repo/xhamster.com.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// ==MiruExtension==
// @name xHamster
// @version v0.0.1
// @author bachig26
// @lang en
// @license MIT
// @package xhamster.com
// @type bangumi
// @icon https://static-lvlt.xhcdn.com/xh-desktop/images/favicon/favicon-512x512.png?v=1
// @webSite https://xhamster.com
// @nsfw true
// ==/MiruExtension==

export default class extends Extension {
async latest(page) {
const res = await this.request(`/newest/${page}`);
const bsxList = await this.querySelectorAll(res, "div.thumb-list__item.video-thumb");
const novel = [];
for (const element of bsxList) {
const html = await element.content;
const url = await this.getAttributeText(html, "a.video-thumb__image-container.role-pop", "href");
const title = await this.querySelector(html, "a.root-9d8b4.primary-9d8b4.video-thumb-info__name").text;
const cover = await this.querySelector(html, "img.thumb-image-container__image").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async search(kw) {
const kwstring = kw.replace(/ /g, '+');
const res = await this.request(`/search/${kwstring}`);
const bsxList = await this.querySelectorAll(res, "div.thumb-list__item.video-thumb");
const novel = [];

for (const element of bsxList) {
const html = await element.content;
const url = await this.getAttributeText(html, "a.video-thumb__image-container.role-pop", "href");
const title = await this.querySelector(html, "a.root-9d8b4.primary-9d8b4.video-thumb-info__name").text;
const cover = await this.querySelector(html, "img.thumb-image-container__image").getAttributeText("src");
novel.push({
title,
url,
cover,
});
}
return novel;
}

async detail(url) {
const res = await this.request("", {
headers: {
"Miru-Url": url,
},
});

const title = await this.querySelector(res, "meta[property='og:title']").getAttributeText("content");
const cover = await this.querySelector(res, "meta[property='og:image']").getAttributeText("content");
const urlPatterns = [/<link rel="preload" href="(.+?)"/];

let episodeUrl = "";

for (const pattern of urlPatterns) {
const match = res.match(pattern);
if (match) {
episodeUrl = match[1];
break;
}
}

return {
title: title.trim(),
cover,
episodes: [
{
title: "Directory",
urls: [
{
name: title,
url: episodeUrl,
},
],
},
],
};
}

async watch(url) {
return {
type: "hls",
url: url || "",
headers: {
"referer": "https://xhamster.com/",
"origin": "https://xhamster.com",
"Miru-Url": url,
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.142.86 Safari/537.36",
}
};
}
}
Loading

0 comments on commit 0e1ae2d

Please sign in to comment.