Merge branch 'add-launched-closed-fields'

This commit is contained in:
Aleksandr Statciuk 2022-04-11 23:51:53 +03:00
commit f6cd5c3d7e
6 changed files with 28962 additions and 28925 deletions

View file

@ -19,7 +19,7 @@ All data is stored in the [/data](data) folder as [CSV](https://en.wikipedia.org
| Field | Description | Required | Example | | Field | Description | Required | Example |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------ | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
| id | Unique channel ID. Should be derived from the name of the channel and country code separated by dot. May only contain Latin letters, numbers and dot. | Required | `AnhuiTV.cn` | | id | Unique channel ID. Should be derived from the name of the channel and country code separated by dot. May only contain Latin letters, numbers and dot. | Required | `AnhuiTV.cn` |
| name | Official channel name in English. May include: `a-z`, `à-ÿ`, `0-9`, `space`, `-`, `!`, `:`, `&`, `.`, `+`, `'`, `/`, `»`, `#`, `%`, `°`, `$`, `@`, `?`, `(`, `)`. | Required | `Anhui TV` | | name | Official channel name in English. May include: `a-z`, `à-ÿ`, `0-9`, `space`, `-`, `!`, `:`, `&`, `.`, `+`, `'`, `/`, `»`, `#`, `%`, `°`, `$`, `@`, `?`, `(`, `)`. | Required | `Anhui TV` |
| native_name | Channel name in the original language. May contain any characters except `,` and `"`. | Optional | `安徽卫视` | | native_name | Channel name in the original language. May contain any characters except `,` and `"`. | Optional | `安徽卫视` |
| network | Name of the network operating the channel. | Optional | `Anhui` | | network | Name of the network operating the channel. | Optional | `Anhui` |
| country | Country code from which the channel is transmitted. A list of all supported countries and their codes can be found in [data/countries.csv](data/countries.csv) | Required | `CN` | | country | Country code from which the channel is transmitted. A list of all supported countries and their codes can be found in [data/countries.csv](data/countries.csv) | Required | `CN` |
@ -29,8 +29,10 @@ All data is stored in the [/data](data) folder as [CSV](https://en.wikipedia.org
| languages | List of languages in which the channel is broadcast separated by `;`. A list of all supported languages and their codes can be found in [data/languages.csv](data/languages.csv) | Required | `zho` | | languages | List of languages in which the channel is broadcast separated by `;`. A list of all supported languages and their codes can be found in [data/languages.csv](data/languages.csv) | Required | `zho` |
| categories | List of categories to which this channel belongs separated by `;`. A list of all supported categories can be found in [data/categories.csv](data/categories.csv) | Optional | `general` | | categories | List of categories to which this channel belongs separated by `;`. A list of all supported categories can be found in [data/categories.csv](data/categories.csv) | Optional | `general` |
| is_nsfw | Indicates whether the channel broadcasts adult content (`TRUE` or `FALSE`) | Required | `FALSE` | | is_nsfw | Indicates whether the channel broadcasts adult content (`TRUE` or `FALSE`) | Required | `FALSE` |
| launched | Launch date of the channel (`YYYY-MM-DD`) | Optional | `2016-07-28` |
| closed | Date on which the channel closed (`YYYY-MM-DD`) | Optional | `2020-05-31` |
| website | Official website URL. | Optional | `http://www.ahtv.cn/` | | website | Official website URL. | Optional | `http://www.ahtv.cn/` |
| logo | Logo URL. Only URL with HTTPS protocol are allowed. Supported image types: `PNG`, `JPEG`. | Optional | `https://example.com/logo.png` | | logo | Logo URL. Only URL with HTTPS protocol are allowed. Supported image types: `PNG`, `JPEG`. | Optional | `https://example.com/logo.png` |
### categories ### categories

File diff suppressed because it is too large Load diff

42
package-lock.json generated
View file

@ -6,6 +6,7 @@
"": { "": {
"name": "@iptv-org/database", "name": "@iptv-org/database",
"dependencies": { "dependencies": {
"@joi/date": "^2.1.0",
"axios": "^0.25.0", "axios": "^0.25.0",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.10", "cheerio": "^1.0.0-rc.10",
@ -37,6 +38,14 @@
"@hapi/hoek": "^9.0.0" "@hapi/hoek": "^9.0.0"
} }
}, },
"node_modules/@joi/date": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@joi/date/-/date-2.1.0.tgz",
"integrity": "sha512-2zN5m0LgxZp/cynHGbzEImVmFIa+n+IOb/Nlw5LX/PLJneeCwG1NbiGw7MvPjsAKUGQK8z31Nn6V6lEN+4fZhg==",
"dependencies": {
"moment": "2.x.x"
}
},
"node_modules/@sideway/address": { "node_modules/@sideway/address": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz",
@ -667,9 +676,17 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"node_modules/moment": {
"version": "2.29.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz",
"integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==",
"engines": {
"node": "*"
}
}, },
"node_modules/mz": { "node_modules/mz": {
"version": "2.7.0", "version": "2.7.0",
@ -1170,6 +1187,14 @@
"@hapi/hoek": "^9.0.0" "@hapi/hoek": "^9.0.0"
} }
}, },
"@joi/date": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@joi/date/-/date-2.1.0.tgz",
"integrity": "sha512-2zN5m0LgxZp/cynHGbzEImVmFIa+n+IOb/Nlw5LX/PLJneeCwG1NbiGw7MvPjsAKUGQK8z31Nn6V6lEN+4fZhg==",
"requires": {
"moment": "2.x.x"
}
},
"@sideway/address": { "@sideway/address": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz",
@ -1655,9 +1680,14 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"moment": {
"version": "2.29.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz",
"integrity": "sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg=="
}, },
"mz": { "mz": {
"version": "2.7.0", "version": "2.7.0",

View file

@ -12,6 +12,7 @@
"private": true, "private": true,
"author": "Arhey", "author": "Arhey",
"dependencies": { "dependencies": {
"@joi/date": "^2.1.0",
"axios": "^0.25.0", "axios": "^0.25.0",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.10", "cheerio": "^1.0.0-rc.10",

View file

@ -23,6 +23,8 @@ const csv2jsonOptions = {
subdivision: nullable, subdivision: nullable,
city: nullable, city: nullable,
network: nullable, network: nullable,
launched: nullable,
closed: nullable,
website: nullable, website: nullable,
native_name: nullable native_name: nullable
} }

View file

@ -1,4 +1,4 @@
const Joi = require('joi') const Joi = require('joi').extend(require('@joi/date'))
const path = require('path') const path = require('path')
module.exports = { module.exports = {
@ -33,6 +33,8 @@ module.exports = {
), ),
categories: Joi.array().items(Joi.string().regex(/^[a-z]+$/)), categories: Joi.array().items(Joi.string().regex(/^[a-z]+$/)),
is_nsfw: Joi.boolean().strict().required(), is_nsfw: Joi.boolean().strict().required(),
launched: Joi.date().format('YYYY-MM-DD').raw().allow(null),
closed: Joi.date().format('YYYY-MM-DD').raw().allow(null),
website: Joi.string() website: Joi.string()
.uri({ .uri({
scheme: ['http', 'https'] scheme: ['http', 'https']