Create load.js

This commit is contained in:
freearhey 2025-02-03 21:54:24 +03:00
parent ceef93ed00
commit f5ae940e51

22
src/load.js Normal file
View file

@ -0,0 +1,22 @@
import { Storage } from '@freearhey/core'
import { ApiClient } from './utils/apiClient.js'
async function main() {
const client = new ApiClient({ storage: new Storage('src/data') })
const requests = [
client.download('blocklist.json'),
client.download('categories.json'),
client.download('channels.json'),
client.download('streams.json'),
client.download('guides.json'),
client.download('countries.json'),
client.download('languages.json'),
client.download('regions.json'),
client.download('subdivisions.json')
]
await Promise.all(requests)
}
main()