-
Notifications
You must be signed in to change notification settings - Fork 102
/
tamilyogi.js
107 lines (100 loc) · 3.58 KB
/
tamilyogi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// ==MiruExtension==
// @name TamilYogi
// @version v0.0.4
// @author appdevelpo
// @lang hi-ta
// @license MIT
// @icon https://tamilyogi.plus/wp-content/uploads/2021/06/ty.png
// @package tamilyogi
// @type bangumi
// @webSite https://tamilyogi.plus
// @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.plus(.+?)"/)[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.plus(.+?)"/)[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",
}
};
}
}