Skip to content

Commit

Permalink
Merge pull request #132 from bachig26/main
Browse files Browse the repository at this point in the history
SuperCartoons | tamilyogi update
  • Loading branch information
OshekharO authored Dec 14, 2023
2 parents e1363a0 + b705a7a commit cf569ea
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 6 deletions.
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 {
};
}
}

0 comments on commit cf569ea

Please sign in to comment.