MCPcopy Index your code
hub / github.com/MALSync/MALSync / bato

Function bato

webpackConfig/autoUrls.mjs:86–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84}
85
86async function bato() {
87 const response = await fetch('https://batotomirrors.pages.dev');
88 const body = await response.text();
89 const $ = cheerio.load(body);
90
91 // Bato url gave JS to list their bato endpoint when fetch() it.
92 const urlJS = $('script')
93 .map((i, el) => $(el).html())
94 .get()
95 .find(text => text.includes('const domains'));
96
97 const ExtractUrl = [...urlJS.matchAll(/url:\s*"(.*?)"/g)];
98 const urls = ExtractUrl.map(m => new URL(m[1]));
99
100 let formattedUrls = [];
101 for (const url of urls) {
102 formattedUrls.push('*://' + url.hostname + '/*');
103 }
104 addChibiUrls('bato', formattedUrls, 'mainV2.ts');
105 addChibiUrls('bato', formattedUrls, 'mainV3.ts');
106}
107
108async function mangapark() {
109 const response = await fetch('https://mangaparkmirrors.pages.dev');

Callers

nothing calls this directly

Calls 3

fetchFunction · 0.85
addChibiUrlsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected