Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create flimypujab.com.js #61

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions repo/flimypujab.com.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// ==MiruExtension==
// @name FlimyPujab
// @version v0.0.1
// @author appdevelpo
// @lang hi
// @license MIT
// @icon https://111.90.151.26/wp-content/uploads/2020/06/cropped-Logo-2-60x60.png
// @package flimypujab.com
// @type bangumi
// @webSite https://111.90.151.26
// @nsfw false
// ==/MiruExtension==

export default class extends Extension {
async search(kw, page) {
const res = await this.request(`/page/${page}/?s=${kw}`,{
headers: {
referer: `https://111.90.151.26`,
},
});
const bsxList = res.match(/<article([\s\S]+?<\/article>)/g);
const bangumi = [];
bsxList.forEach((element) => {
const url = element.match(/href="https:\/\/111.90.151.26(\/.+?)"/)[1];
const title = element.match(/title="Permalink to:(.+?)"/)[1];
const cover = element.match(/src="(.+?)"/)[1];
bangumi.push({
title,
url:`${url};${cover}`,
cover,
});
});
return bangumi;
}

async latest(page) {
const res = await this.request(`/page/${page}/`);
const bsxList = res.match(/<article([\s\S]+?<\/article>)/g);
const bangumi = [];
bsxList.forEach((element) => {
const url = element.match(/href="https:\/\/111.90.151.26(\/.+?)"/)[1];
const title = element.match(/title="Permalink to:(.+?)"/)[1];
// console.log(title);
const cover = element.match(/src="(.+?)"/)[1];
// console.log(cover);
bangumi.push({
title,
url:`${url};${cover}`,
cover,
});
});
return bangumi;
}

async detail(url) {
const url_split = url.split(';');
const res = await this.request(url_split[0]);
const titleRegex = /<h2 class="entry-title" itemprop="name">(.+?)<\/h2>/;
const titleMatch = res.match(titleRegex);
const title = titleMatch ? titleMatch[1] : null;
const cover = url_split[1];
const descriptionRegex = /<div class="entry-content entry-content-single" itemprop="description">[\s]+<p>(.+?)<\/p>/;
const descriptionMatch = res.match(descriptionRegex);
const desc = descriptionMatch ? descriptionMatch[1] : null;

const ep_button = res.match(/<div class="gmr-listseries"><a class="button button-shadow" [\S\s]+?<\/div>/)
if (ep_button===null){//movie
return {
title: title || "Unknown Title",
cover: cover || "",
desc: desc || "No description available.",
episodes: [
{
title: "Directory",
urls: [{name:"ep1",url:url_split[0]}],
},
],
};
}
const liListRegex = /<a class(.+?)<\/a>/g;
const liListMatch = ep_button[0].match(liListRegex);


const episodes = [];
if (liListMatch) {
liListMatch.forEach((element) => {
const chapterNumRegex = /">(.+?)<\/a>/;
const chapterNumMatch = element.match(chapterNumRegex);
const name = chapterNumMatch ? chapterNumMatch[1] : null;
const chapterUrlRegex = /"https:\/\/111.90.151.26(.+?)"/;
const chapterUrlMatch = element.match(chapterUrlRegex);
url = chapterUrlMatch ? chapterUrlMatch[1] : null;
if (name&& url) {
episodes.push({
name,
url,
});
}
});
}
return {
title: title || "Unknown Title",
cover: cover || "",
desc: desc || "No description available.",
episodes: [
{
title: "Directory",
urls: episodes||null,
},
],
};
}

async watch(url) {
const res = await this.request(url)
const video_url = res.match(/<source src="(.+?.mp4)"/)[1];
// console.log(video_url);


return {
type: "mp4",
url: video_url||null,
headers: {
"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",
referer: "https://111.90.151.26"
},
};
}
}