-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
503 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 || "", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 || "", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.