mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Create scripts/tmp directory
This commit is contained in:
parent
691ba44d0c
commit
8a448a981a
8 changed files with 437 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mkdir -p scripts/data
|
mkdir -p scripts/tmp/data
|
||||||
curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json
|
curl -L -o scripts/tmp/data/channels.json https://iptv-org.github.io/api/channels.json
|
||||||
curl -L -o scripts/data/countries.json https://iptv-org.github.io/api/countries.json
|
curl -L -o scripts/tmp/data/countries.json https://iptv-org.github.io/api/countries.json
|
||||||
curl -L -o scripts/data/regions.json https://iptv-org.github.io/api/regions.json
|
curl -L -o scripts/tmp/data/regions.json https://iptv-org.github.io/api/regions.json
|
||||||
curl -L -o scripts/data/subdivisions.json https://iptv-org.github.io/api/subdivisions.json
|
curl -L -o scripts/tmp/data/subdivisions.json https://iptv-org.github.io/api/subdivisions.json
|
|
@ -1,7 +1,7 @@
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
|
|
||||||
const DATA_DIR = process.env.DATA_DIR || './scripts/data'
|
const DATA_DIR = process.env.DATA_DIR || './scripts/tmp/data'
|
||||||
|
|
||||||
class API {
|
class API {
|
||||||
constructor(filepath) {
|
constructor(filepath) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const nedb = require('nedb-promises')
|
const nedb = require('nedb-promises')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
|
|
||||||
const DB_DIR = process.env.DB_DIR || './scripts/database'
|
const DB_DIR = process.env.DB_DIR || './scripts/tmp/database'
|
||||||
|
|
||||||
class Database {
|
class Database {
|
||||||
constructor(filepath) {
|
constructor(filepath) {
|
||||||
|
|
2
scripts/tmp/.gitignore
vendored
Normal file
2
scripts/tmp/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
74
tests/__data__/input/tmp/data/channels.json
Normal file
74
tests/__data__/input/tmp/data/channels.json
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "BravoEast.us",
|
||||||
|
"name": "Bravo East",
|
||||||
|
"network": null,
|
||||||
|
"country": "US",
|
||||||
|
"subdivision": null,
|
||||||
|
"city": null,
|
||||||
|
"broadcast_area": [
|
||||||
|
"c/US"
|
||||||
|
],
|
||||||
|
"languages": [
|
||||||
|
"eng"
|
||||||
|
],
|
||||||
|
"categories": [],
|
||||||
|
"is_nsfw": false,
|
||||||
|
"logo": "https://www.directv.com/images/logos/channels/dark/large/579.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "CNNInternationalEurope.us",
|
||||||
|
"name": "CNN International Europe",
|
||||||
|
"network": null,
|
||||||
|
"country": "US",
|
||||||
|
"subdivision": null,
|
||||||
|
"city": null,
|
||||||
|
"broadcast_area": [
|
||||||
|
"r/EUR"
|
||||||
|
],
|
||||||
|
"languages": [
|
||||||
|
"eng"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"news"
|
||||||
|
],
|
||||||
|
"is_nsfw": false,
|
||||||
|
"logo": "https://i.imgur.com/2BXCg0x.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "MNetMovies2.za",
|
||||||
|
"name": "M-Net Movies 2",
|
||||||
|
"network": null,
|
||||||
|
"country": "ZA",
|
||||||
|
"subdivision": null,
|
||||||
|
"city": null,
|
||||||
|
"broadcast_area": [
|
||||||
|
"c/ZA"
|
||||||
|
],
|
||||||
|
"languages": [
|
||||||
|
"afr"
|
||||||
|
],
|
||||||
|
"categories": [],
|
||||||
|
"is_nsfw": false,
|
||||||
|
"logo": "https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png"
|
||||||
|
},
|
||||||
|
{"id":"6eren.dk","name":"6'eren","alt_names":[],"network":null,"owners":["Warner Bros. Discovery EMEA"],"country":"DK","subdivision":null,"city":null,"broadcast_area":["c/DK"],"languages":["dan"],"categories":[],"is_nsfw":false,"launched":"2009-01-01","closed":null,"replaced_by":null,"website":"http://www.6-eren.dk/","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png"},
|
||||||
|
{"id":"BBCNews.uk","name":"BBC News","alt_names":[],"network":null,"owners":[],"country":"UK","subdivision":null,"city":null,"broadcast_area":["c/UK"],"languages":["eng"],"categories":["news"],"is_nsfw":false,"launched":null,"closed":null,"replaced_by":null,"website":"http://news.bbc.co.uk/","logo":"https://i.imgur.com/rPzH88J.png"},
|
||||||
|
{
|
||||||
|
"id": "CNN.us",
|
||||||
|
"name": "CNN",
|
||||||
|
"network": null,
|
||||||
|
"country": "US",
|
||||||
|
"subdivision": null,
|
||||||
|
"city": null,
|
||||||
|
"broadcast_area": [
|
||||||
|
"c/US"
|
||||||
|
],
|
||||||
|
"languages": [
|
||||||
|
"eng"
|
||||||
|
],
|
||||||
|
"categories": [],
|
||||||
|
"is_nsfw": false,
|
||||||
|
"logo": "https://www.directv.com/images/logos/channels/dark/large/579.png"
|
||||||
|
}
|
||||||
|
]
|
1
tests/__data__/input/tmp/data/countries.json
Normal file
1
tests/__data__/input/tmp/data/countries.json
Normal file
File diff suppressed because one or more lines are too long
1
tests/__data__/input/tmp/data/regions.json
Normal file
1
tests/__data__/input/tmp/data/regions.json
Normal file
File diff suppressed because one or more lines are too long
352
tests/__data__/input/tmp/data/subdivisions.json
Normal file
352
tests/__data__/input/tmp/data/subdivisions.json
Normal file
|
@ -0,0 +1,352 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Alberta",
|
||||||
|
"code": "CA-AB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "British Columbia",
|
||||||
|
"code": "CA-BC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Manitoba",
|
||||||
|
"code": "CA-MB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "New Brunswick",
|
||||||
|
"code": "CA-NB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Newfoundland and Labrador",
|
||||||
|
"code": "CA-NL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Northwest Territories",
|
||||||
|
"code": "CA-NT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Nova Scotia",
|
||||||
|
"code": "CA-NS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Nunavut",
|
||||||
|
"code": "CA-NU"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Ontario",
|
||||||
|
"code": "CA-ON"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Prince Edward Island",
|
||||||
|
"code": "CA-PE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Quebec",
|
||||||
|
"code": "CA-QC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Saskatchewan",
|
||||||
|
"code": "CA-SK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "CA",
|
||||||
|
"name": "Yukon",
|
||||||
|
"code": "CA-YT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Alabama",
|
||||||
|
"code": "US-AL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Alaska",
|
||||||
|
"code": "US-AK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "American Samoa",
|
||||||
|
"code": "US-AS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Arizona",
|
||||||
|
"code": "US-AZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Arkansas",
|
||||||
|
"code": "US-AR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "California",
|
||||||
|
"code": "US-CA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Colorado",
|
||||||
|
"code": "US-CO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Connecticut",
|
||||||
|
"code": "US-CT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Delaware",
|
||||||
|
"code": "US-DE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "District of Columbia",
|
||||||
|
"code": "US-DC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Florida",
|
||||||
|
"code": "US-FL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Georgia",
|
||||||
|
"code": "US-GA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Guam",
|
||||||
|
"code": "US-GU"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Hawaii",
|
||||||
|
"code": "US-HI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Idaho",
|
||||||
|
"code": "US-ID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Illinois",
|
||||||
|
"code": "US-IL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Indiana",
|
||||||
|
"code": "US-IN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Iowa",
|
||||||
|
"code": "US-IA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Kansas",
|
||||||
|
"code": "US-KS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Kentucky",
|
||||||
|
"code": "US-KY"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Louisiana",
|
||||||
|
"code": "US-LA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Maine",
|
||||||
|
"code": "US-ME"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Maryland",
|
||||||
|
"code": "US-MD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Massachusetts",
|
||||||
|
"code": "US-MA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Michigan",
|
||||||
|
"code": "US-MI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Minnesota",
|
||||||
|
"code": "US-MN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Mississippi",
|
||||||
|
"code": "US-MS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Missouri",
|
||||||
|
"code": "US-MO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Montana",
|
||||||
|
"code": "US-MT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Nebraska",
|
||||||
|
"code": "US-NE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Nevada",
|
||||||
|
"code": "US-NV"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "New Hampshire",
|
||||||
|
"code": "US-NH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "New Jersey",
|
||||||
|
"code": "US-NJ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "New Mexico",
|
||||||
|
"code": "US-NM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "New York",
|
||||||
|
"code": "US-NY"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "North Carolina",
|
||||||
|
"code": "US-NC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "North Dakota",
|
||||||
|
"code": "US-ND"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Northern Mariana Islands",
|
||||||
|
"code": "US-MP"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Ohio",
|
||||||
|
"code": "US-OH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Oklahoma",
|
||||||
|
"code": "US-OK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Oregon",
|
||||||
|
"code": "US-OR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Pennsylvania",
|
||||||
|
"code": "US-PA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Puerto Rico",
|
||||||
|
"code": "US-PR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Rhode Island",
|
||||||
|
"code": "US-RI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "South Carolina",
|
||||||
|
"code": "US-SC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "South Dakota",
|
||||||
|
"code": "US-SD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Tennessee",
|
||||||
|
"code": "US-TN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Texas",
|
||||||
|
"code": "US-TX"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "U.S. Virgin Islands",
|
||||||
|
"code": "US-VI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "United States Minor Outlying Islands",
|
||||||
|
"code": "US-UM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Utah",
|
||||||
|
"code": "US-UT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Vermont",
|
||||||
|
"code": "US-VT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Virginia",
|
||||||
|
"code": "US-VA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Washington",
|
||||||
|
"code": "US-WA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "West Virginia",
|
||||||
|
"code": "US-WV"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Wisconsin",
|
||||||
|
"code": "US-WI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "US",
|
||||||
|
"name": "Wyoming",
|
||||||
|
"code": "US-WY"
|
||||||
|
}
|
||||||
|
]
|
Loading…
Add table
Add a link
Reference in a new issue