MCPcopy Create free account
hub / github.com/MALSync/MALSync / mangapark

Function mangapark

webpackConfig/autoUrls.mjs:108–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108async function mangapark() {
109 const response = await fetch('https://mangaparkmirrors.pages.dev');
110 const body = await response.text();
111
112 const jsonMatch = body.match(/const domains = (\[.*?\]);/s);
113 if (!jsonMatch) {
114 throw new Error('No domains found');
115 }
116
117 const urls = [...jsonMatch[1].matchAll(/"https?:\/\/(.*?)"/g)].map(match => {
118 return new URL(match[0].replace(/"/g, ''));
119 });
120
121 let formattedUrls = [];
122 for (const url of urls) {
123 formattedUrls.push('*://' + url.hostname + '/*');
124 }
125 addChibiUrls('MangaPark', formattedUrls);
126}
127
128function addPageUrls(page, urls) {
129 logFoundUrls(page, urls, URL_TYPES.PAGE);

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.85
addChibiUrlsFunction · 0.85

Tested by

no test coverage detected