From f5ae940e51a4269bb094df3742837ad01d400b17 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:54:24 +0300 Subject: [PATCH] Create load.js --- src/load.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/load.js diff --git a/src/load.js b/src/load.js new file mode 100644 index 000000000..5225a9ebc --- /dev/null +++ b/src/load.js @@ -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()