-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathparse.js
More file actions
23 lines (20 loc) · 740 Bytes
/
parse.js
File metadata and controls
23 lines (20 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'node:url';
export function ini(){
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const providers = ["flixhq", "fmovies"];
const types = ["tvmap", "moviesmap"];
for (const provider of providers) {
for(const type of types){
const data = JSON.parse(fs.readFileSync(path.join(__dirname, `./data/${provider}/${type}.json`), "utf-8"));
for(const key in data){
const value = data[key].toString();
if(value === "0"){
continue;
}
fs.writeFileSync(`./pages/${provider}/${key}.txt`, value);
}
}
}
}