-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from ijs77/patch-3
Create bestialitysextaboo.net.js
- Loading branch information
Showing
1 changed file
with
136 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,136 @@ | ||
// ==MiruExtension== | ||
// @name BestialitySexTaboo | ||
// @version v0.0.1 | ||
// @author javxsub.com | ||
// @lang en | ||
// @license MIT | ||
// @icon https://bestialitysextaboo.net/favicon.ico | ||
// @package bestialitysextaboo.net | ||
// @type bangumi | ||
// @webSite https://bestialitysextaboo.net | ||
// @nsfw true | ||
// ==/MiruExtension== | ||
|
||
export default class extends Extension { | ||
|
||
async req(url) { | ||
const res = await this.request("", { | ||
"Miru-Url": url, | ||
"Referer": "https://bestialitysextaboo.net", | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" | ||
}); | ||
return url; | ||
} | ||
|
||
|
||
async latest(page) { | ||
// Latest updates | ||
if (page == 1) { | ||
var rpage = ""; | ||
} else { | ||
var rpage = page+"/"; | ||
} | ||
|
||
const url = `/videos/${rpage}`; | ||
const res = await this.request(url); | ||
const videoList = await this.querySelectorAll(res, "li.video"); | ||
const videos = []; | ||
|
||
for (const element of videoList) { | ||
const html = await element.content; | ||
const title = await this.getAttributeText(html, "span.title > a", "title"); | ||
const url = await this.getAttributeText(html, "a", "href"); | ||
const cover = await this.getAttributeText(html, "img", "src"); | ||
const updt = await this.querySelector(html, "span.duration").text; | ||
|
||
if (title && url && cover) { | ||
videos.push({ | ||
title: title, | ||
url: url, | ||
cover: cover, | ||
update: updt.trim().replace("HD", "[HD]"), | ||
}); | ||
} | ||
} | ||
|
||
return videos; | ||
} | ||
|
||
async search(kw, page) { | ||
// Search | ||
const url = `/search/video/?s=${kw}&page=${page}`; | ||
const res = await this.request(url); | ||
const videoList = await this.querySelectorAll(res, "li.video"); | ||
const videos = []; | ||
|
||
for (const element of videoList) { | ||
const html = await element.content; | ||
const title = await this.getAttributeText(html, "span.title > a", "title"); | ||
const url = await this.getAttributeText(html, "a", "href"); | ||
const cover = await this.getAttributeText(html, "img", "src"); | ||
const updt = await this.querySelector(html, "span.duration").text; | ||
|
||
if (title && url && cover) { | ||
videos.push({ | ||
title: title, | ||
url: url, | ||
cover: cover, | ||
update: updt.trim().replace("HD", "[HD]"), | ||
}); | ||
} | ||
} | ||
|
||
return videos; | ||
} | ||
|
||
|
||
async detail(url) { | ||
// Details | ||
const strippedpath = url.replace(/^(https?:\/\/)?([^\/]+)(\/.*)?/, '$3'); | ||
const res = await this.request(strippedpath); | ||
const title = await this.querySelector(res, 'h1').text; | ||
const cover = await this.querySelector(res, 'meta[property="og:image"]').getAttributeText("content"); | ||
const desc = await this.querySelector(res, 'div.content-info:nth-child(5) > span').text; | ||
const user = await this.querySelector(res, 'div.content-info > a > strong').text; | ||
//const video = await this.querySelector(res, 'source[type="video\/mp4"]').getAttributeText("src"); | ||
const videos = await this.querySelector(res, 'video[id="player-fluid"]').innerHTML; | ||
|
||
const jsonRegex = /https[^"]*/gm | ||
const result = videos.match(jsonRegex); | ||
const nomer = result.length-1; | ||
|
||
|
||
// | ||
//for (const element of result) { | ||
// const xurl = element; | ||
// const name = xurl.substring(video.length-9, video.length-4).replace("_", ""); | ||
//} | ||
// | ||
|
||
return { | ||
title: title.trim(), | ||
cover: cover.match(/.*\//)+"player.jpg", | ||
desc, | ||
episodes: [ | ||
{ | ||
title: user.trim(), | ||
urls: [{ | ||
name: result[0].substring(result[0].length-9, result[0].length-4).replace("_", ""), | ||
url: result[0], | ||
}, | ||
{ | ||
name: result[nomer].substring(result[nomer].length-9, result[nomer].length-4).replace("_", ""), | ||
url: result[nomer], | ||
}] | ||
}, | ||
], | ||
}; | ||
} | ||
|
||
async watch(url) { | ||
return { | ||
type: "mp4", | ||
url: url || "", | ||
}; | ||
} | ||
} |