mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-11 17:40:03 -04:00
Rewrite api:load script
This commit is contained in:
parent
18a6142484
commit
92ae51171d
9 changed files with 379 additions and 50 deletions
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p temp/data
|
||||
curl -L -o temp/data/blocklist.json https://iptv-org.github.io/api/blocklist.json
|
||||
curl -L -o temp/data/categories.json https://iptv-org.github.io/api/categories.json
|
||||
curl -L -o temp/data/channels.json https://iptv-org.github.io/api/channels.json
|
||||
curl -L -o temp/data/countries.json https://iptv-org.github.io/api/countries.json
|
||||
curl -L -o temp/data/languages.json https://iptv-org.github.io/api/languages.json
|
||||
curl -L -o temp/data/regions.json https://iptv-org.github.io/api/regions.json
|
||||
curl -L -o temp/data/subdivisions.json https://iptv-org.github.io/api/subdivisions.json
|
21
scripts/commands/api/load.ts
Normal file
21
scripts/commands/api/load.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { Logger } from '@freearhey/core'
|
||||
import { ApiClient } from '../../core'
|
||||
|
||||
async function main() {
|
||||
const logger = new Logger()
|
||||
const client = new ApiClient({ logger })
|
||||
|
||||
const requests = [
|
||||
client.download('blocklist.json'),
|
||||
client.download('categories.json'),
|
||||
client.download('channels.json'),
|
||||
client.download('countries.json'),
|
||||
client.download('languages.json'),
|
||||
client.download('regions.json'),
|
||||
client.download('subdivisions.json')
|
||||
]
|
||||
|
||||
await Promise.all(requests)
|
||||
}
|
||||
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue