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 tamilyogi.band.js #76

Merged
merged 2 commits into from
Oct 20, 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
108 changes: 108 additions & 0 deletions repo/tamilyogi.band.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// ==MiruExtension==
// @name TamilYogi
// @version v0.0.1
// @author appdevelpo
// @lang hi-ta
// @license MIT
// @icon https://tamilyogi.band/wp-content/uploads/2021/06/ty.png
// @package tamilyogi.band
// @type bangumi
// @webSite https://tamilyogi.band
// @nsfw false
// ==/MiruExtension==

export default class extends Extension {
async search(kw, page) {
const res = await this.request(`/page/${page}/?s=${kw}`);
const bsxList = res.match(/"cover[\s\S]+?postmetadata/g);
const bangumi = [];
bsxList.forEach((element) => {
const url = element.match(/href="https:\/\/tamilyogi.band(.+?)"/)[1];
// console.log(url);
const title = element.match(/alt="(.+?)"/)[1];
// console.log(title);
const cover_match = element.match(/src="(.+?)"/)[1];
bangumi.push({
title,
url: `${url};${cover_match}`,
cover:cover_match,
});
});
return bangumi;
}

async latest(page) {
const url = `/category/tamilyogi-full-movie-online/page/${page}/`;
const res = await this.request(url);
const bsxList = res.match(/"cover[\s\S]+?postmetadata/g);
const bangumi = [];
bsxList.forEach((element) => {
const url = element.match(/href="https:\/\/tamilyogi.band(.+?)"/)[1];
const title = element.match(/alt="(.+?)"/)[1];
const cover_match = element.match(/src="(.+?)"/)[1];
bangumi.push({
title,
url: `${url};${cover_match}`,
cover:cover_match,
});
});
return bangumi;
}

async detail(url) {

const res = await this.request(url.split(';')[0]);
const embed_link = res.match(/IFRAME SRC="(.+?)"/)[1];
const res_embed = await this.request("",{
headers: {
"Miru-Url": embed_link
}
});
const link = res_embed.match(/window.top.location.href='.+?\?(.+?)'/);
const res_video = await this.request("",{
headers: {
"Miru-Url": `https://vembx.one/xembed-${link[1]}.html`,
"Referer": "https://tamilvip.live/"

}
});
const title = res.match(/title=".+?">(.+?)<\/a><\/h1>/)[1];
const cover = url.split(';')[1];
const m3u8_link = res_video.match(/vembz.one\/\w+\/v\.mp4/g);
const resolution = res_video.match(/label:"(.+?)"/g)
const urls=[];
const base_url = res_video.match(/https:.+?vembz.one/)[0];
m3u8_link.forEach((element,index)=>{
const ur = element.match(/vembz.one\/(.+?)\/v.mp4/)[1];
const name = resolution[index].match(/label:"(.+?)"/)[1];

urls.push({
name: name,
url: `${base_url}/hls/${ur}/index-v1-a1.m3u8`
})
})
const episodes = [{
title: "Directory",
urls
}];
return {
title: title || "Unknown Title",
cover: cover || "",
desc:"No description available.",
episodes
};
}

async watch(url) {
return {
type: "hls",
url: url || null,
headers: {
"Referer": "https://vembx.one/",
"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",
}
};
}
}