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

SuperCartoons | tamilyogi update #132

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
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
99 changes: 99 additions & 0 deletions repo/supercartoons.net.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// ==MiruExtension==
// @name SuperCartoons
// @version v0.0.1
// @author bachig26
// @lang en
// @license MIT
// @package supercartoons.net
// @type bangumi
// @icon https://www.supercartoons.net/wp-content/uploads/logo.png
// @webSite https://www.supercartoons.net
// @nsfw false
// ==/MiruExtension==

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

async search(kw) {
const kwstring = kw.replace(/ /g, '+');
const res = await this.request(`/?s=${kwstring}&search=Search`);
const bsxList = await this.querySelectorAll(res, "div.item.col-lg-3.col-md-3");
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, "h3").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, "div.col-lg-8.col-md-8 > h1").text;
const cover = await this.querySelector(res, "meta[property='og:image']").getAttributeText("content");
const desc = await this.querySelector(res, "div.post-content > p").text;
const urlPatterns = [/https?:\/\/[^\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,
desc,
episodes: [
{
title: "Directory",
urls: [
{
name: `Watch ${title}`,
url: episodeUrl,
},
],
},
],
};
}

async watch(url) {
return {
type: "hls",
url: url || "",
};
}
}
11 changes: 5 additions & 6 deletions repo/tamilyogi.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// ==MiruExtension==
// @name TamilYogi
// @version v0.0.2
// @version v0.0.3
// @author appdevelpo
// @lang hi-ta
// @license MIT
// @icon https://tamilyogi.plus/wp-content/uploads/2021/06/ty.png
// @icon https://tamilyogi.party/wp-content/uploads/2021/06/ty.png
// @package tamilyogi
// @type bangumi
// @webSite https://tamilyogi.plus
// @webSite https://tamilyogi.party
// @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.plus(.+?)"/)[1];
const url = element.match(/href="https:\/\/tamilyogi.party(.+?)"/)[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.plus(.+?)"/)[1];
const url = element.match(/href="https:\/\/tamilyogi.party(.+?)"/)[1];
const title = element.match(/alt="(.+?)"/)[1];
const cover_match = element.match(/src="(.+?)"/)[1];
bangumi.push({
Expand Down Expand Up @@ -105,4 +105,3 @@ export default class extends Extension {
};
}
}