mirror of
https://github.com/iptv-org/api.git
synced 2025-05-11 01:20:07 -04:00
Init
This commit is contained in:
commit
8132a25d1b
11 changed files with 33970 additions and 0 deletions
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: iptv-org
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
28
.github/workflows/auto-update.yml
vendored
Normal file
28
.github/workflows/auto-update.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: auto-update
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: npm install
|
||||||
|
- run: node update.js
|
||||||
|
- uses: tibdex/github-app-token@v1
|
||||||
|
if: ${{ !env.ACT }}
|
||||||
|
id: create-app-token
|
||||||
|
with:
|
||||||
|
app_id: ${{ secrets.APP_ID }}
|
||||||
|
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
- uses: JamesIves/github-pages-deploy-action@4.1.1
|
||||||
|
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
|
||||||
|
with:
|
||||||
|
branch: gh-pages
|
||||||
|
folder: .gh-pages
|
||||||
|
token: ${{ steps.create-app-token.outputs.token }}
|
||||||
|
git-config-name: iptv-bot[bot]
|
||||||
|
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com
|
||||||
|
commit-message: '[Bot] Deploy to GitHub Pages'
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/node_modules/
|
||||||
|
/.artifacts/
|
24
LICENSE
Normal file
24
LICENSE
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <http://unlicense.org/>
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# API
|
||||||
|
|
||||||
|
_WIP_
|
25102
database/channels.csv
Normal file
25102
database/channels.csv
Normal file
File diff suppressed because it is too large
Load diff
251
database/countries.csv
Normal file
251
database/countries.csv
Normal file
|
@ -0,0 +1,251 @@
|
||||||
|
name,code,lang,flag
|
||||||
|
Andorra,AD,cat,🇦🇩
|
||||||
|
United Arab Emirates,AE,ara,🇦🇪
|
||||||
|
Afghanistan,AF,pus,🇦🇫
|
||||||
|
Antigua and Barbuda,AG,eng,🇦🇬
|
||||||
|
Anguilla,AI,eng,
|
||||||
|
Albania,AL,sqi,🇦🇱
|
||||||
|
Armenia,AM,hye,🇦🇲
|
||||||
|
Angola,AO,por,🇦🇴
|
||||||
|
Antarctica,AQ,,
|
||||||
|
Argentina,AR,spa,🇦🇷
|
||||||
|
American Samoa,AS,eng,🇦🇸
|
||||||
|
Austria,AT,deu,🇦🇹
|
||||||
|
Australia,AU,eng,🇦🇺
|
||||||
|
Aruba,AW,nld,🇦🇼
|
||||||
|
Åland,AX,swe,
|
||||||
|
Azerbaijan,AZ,aze,🇦🇿
|
||||||
|
Bosnia and Herzegovina,BA,bos,🇧🇦
|
||||||
|
Barbados,BB,eng,🇧🇧
|
||||||
|
Bangladesh,BD,ben,🇧🇩
|
||||||
|
Belgium,BE,nld,🇧🇪
|
||||||
|
Burkina Faso,BF,fra,🇧🇫
|
||||||
|
Bulgaria,BG,bul,🇧🇬
|
||||||
|
Bahrain,BH,ara,🇧🇭
|
||||||
|
Burundi,BI,fra,🇧🇮
|
||||||
|
Benin,BJ,fra,🇧🇯
|
||||||
|
Saint Barthélemy,BL,fra,🇧🇱
|
||||||
|
Bermuda,BM,eng,
|
||||||
|
Brunei,BN,msa,🇧🇳
|
||||||
|
Bolivia,BO,spa,🇧🇴
|
||||||
|
Bonaire,BQ,nld,
|
||||||
|
Brazil,BR,por,🇧🇷
|
||||||
|
Bahamas,BS,eng,🇧🇸
|
||||||
|
Bhutan,BT,dzo,🇧🇹
|
||||||
|
Bouvet Island,BV,nor,
|
||||||
|
Botswana,BW,eng,🇧🇼
|
||||||
|
Belarus,BY,bel,🇧🇾
|
||||||
|
Belize,BZ,eng,
|
||||||
|
Canada,CA,eng,🇨🇦
|
||||||
|
Cocos [Keeling] Islands,CC,eng,
|
||||||
|
Democratic Republic of the Congo,CD,fra,🇨🇩
|
||||||
|
Central African Republic,CF,fra,🇨🇫
|
||||||
|
Republic of the Congo,CG,fra,🇨🇬
|
||||||
|
Switzerland,CH,deu,🇨🇭
|
||||||
|
Ivory Coast,CI,fra,🇨🇮
|
||||||
|
Cook Islands,CK,eng,🇨🇰
|
||||||
|
Chile,CL,spa,🇨🇱
|
||||||
|
Cameroon,CM,eng,🇨🇲
|
||||||
|
China,CN,zho,🇨🇳
|
||||||
|
Colombia,CO,spa,🇨🇴
|
||||||
|
Costa Rica,CR,spa,🇨🇷
|
||||||
|
Cuba,CU,spa,🇨🇺
|
||||||
|
Cape Verde,CV,por,🇨🇻
|
||||||
|
Curacao,CW,nld,🇨🇼
|
||||||
|
Christmas Island,CX,eng,
|
||||||
|
Cyprus,CY,ell,🇨🇾
|
||||||
|
Czech Republic,CZ,ces,🇨🇿
|
||||||
|
Germany,DE,deu,🇩🇪
|
||||||
|
Djibouti,DJ,fra,🇩🇯
|
||||||
|
Denmark,DK,dan,🇩🇰
|
||||||
|
Dominica,DM,eng,
|
||||||
|
Dominican Republic,DO,spa,🇩🇴
|
||||||
|
Algeria,DZ,ara,🇩🇿
|
||||||
|
Ecuador,EC,spa,🇪🇨
|
||||||
|
Estonia,EE,est,🇪🇪
|
||||||
|
Egypt,EG,ara,🇪🇬
|
||||||
|
Western Sahara,EH,spa,🇪🇭
|
||||||
|
Eritrea,ER,tir,🇪🇷
|
||||||
|
Spain,ES,spa,🇪🇸
|
||||||
|
Ethiopia,ET,amh,🇪🇹
|
||||||
|
Finland,FI,fin,🇫🇮
|
||||||
|
Fiji,FJ,eng,🇫🇯
|
||||||
|
Falkland Islands,FK,eng,
|
||||||
|
Micronesia,FM,eng,🇫🇲
|
||||||
|
Faroe Islands,FO,fao,🇫🇴
|
||||||
|
France,FR,fra,🇫🇷
|
||||||
|
Gabon,GA,fra,🇬🇦
|
||||||
|
United Kingdom,UK,eng,🇬🇧
|
||||||
|
Grenada,GD,eng,
|
||||||
|
Georgia,GE,kat,🇬🇪
|
||||||
|
French Guiana,GF,fra,🇬🇫
|
||||||
|
Guernsey,GG,eng,
|
||||||
|
Ghana,GH,eng,🇬🇭
|
||||||
|
Gibraltar,GI,eng,
|
||||||
|
Greenland,GL,kal,🇬🇱
|
||||||
|
Gambia,GM,eng,🇬🇲
|
||||||
|
Guinea,GN,fra,🇬🇳
|
||||||
|
Guadeloupe,GP,fra,🇬🇵
|
||||||
|
Equatorial Guinea,GQ,spa,🇬🇶
|
||||||
|
Greece,GR,ell,🇬🇷
|
||||||
|
South Georgia and the South Sandwich Islands,GS,eng,
|
||||||
|
Guatemala,GT,spa,🇬🇹
|
||||||
|
Guam,GU,eng,🇬🇺
|
||||||
|
Guinea-Bissau,GW,por,🇬🇼
|
||||||
|
Guyana,GY,eng,
|
||||||
|
Hong Kong,HK,zho,🇭🇰
|
||||||
|
Heard Island and McDonald Islands,HM,eng,
|
||||||
|
Honduras,HN,spa,🇭🇳
|
||||||
|
Croatia,HR,hrv,🇭🇷
|
||||||
|
Haiti,HT,fra,🇭🇹
|
||||||
|
Hungary,HU,hun,🇭🇺
|
||||||
|
Indonesia,ID,ind,🇮🇩
|
||||||
|
Ireland,IE,gle,🇮🇪
|
||||||
|
Israel,IL,heb,🇮🇱
|
||||||
|
Isle of Man,IM,eng,
|
||||||
|
India,IN,hin,🇮🇳
|
||||||
|
British Indian Ocean Territory,IO,eng,
|
||||||
|
Iraq,IQ,ara,🇮🇶
|
||||||
|
Iran,IR,fas,🇮🇷
|
||||||
|
Iceland,IS,isl,🇮🇸
|
||||||
|
Italy,IT,ita,🇮🇹
|
||||||
|
Jersey,JE,eng,
|
||||||
|
Jamaica,JM,eng,🇯🇲
|
||||||
|
Jordan,JO,ara,🇯🇴
|
||||||
|
Japan,JP,jpn,🇯🇵
|
||||||
|
Kenya,KE,eng,🇰🇪
|
||||||
|
Kyrgyzstan,KG,kir,🇰🇬
|
||||||
|
Cambodia,KH,khm,🇰🇭
|
||||||
|
Kiribati,KI,eng,🇰🇮
|
||||||
|
Comoros,KM,ara,🇰🇲
|
||||||
|
Saint Kitts and Nevis,KN,eng,
|
||||||
|
North Korea,KP,kor,🇰🇵
|
||||||
|
South Korea,KR,kor,🇰🇷
|
||||||
|
Kuwait,KW,ara,🇰🇼
|
||||||
|
Cayman Islands,KY,eng,
|
||||||
|
Kazakhstan,KZ,kaz,🇰🇿
|
||||||
|
Laos,LA,lao,🇱🇦
|
||||||
|
Lebanon,LB,ara,🇱🇧
|
||||||
|
Saint Lucia,LC,eng,
|
||||||
|
Liechtenstein,LI,deu,🇱🇮
|
||||||
|
Sri Lanka,LK,sin,🇱🇰
|
||||||
|
Liberia,LR,eng,🇱🇷
|
||||||
|
Lesotho,LS,eng,🇱🇸
|
||||||
|
Lithuania,LT,lit,🇱🇹
|
||||||
|
Luxembourg,LU,fra,🇱🇺
|
||||||
|
Latvia,LV,lav,🇱🇻
|
||||||
|
Libya,LY,ara,🇱🇾
|
||||||
|
Morocco,MA,ara,🇲🇦
|
||||||
|
Monaco,MC,fra,🇲🇨
|
||||||
|
Moldova,MD,ron,🇲🇩
|
||||||
|
Montenegro,ME,srp,🇲🇪
|
||||||
|
Saint Martin,MF,eng,🇲🇫
|
||||||
|
Madagascar,MG,fra,🇲🇬
|
||||||
|
Marshall Islands,MH,eng,🇲🇭
|
||||||
|
North Macedonia,MK,mkd,🇲🇰
|
||||||
|
Mali,ML,fra,🇲🇱
|
||||||
|
Myanmar [Burma],MM,mya,🇲🇲
|
||||||
|
Mongolia,MN,mon,🇲🇳
|
||||||
|
Macao,MO,zho,🇲🇴
|
||||||
|
Northern Mariana Islands,MP,eng,🇲🇵
|
||||||
|
Martinique,MQ,fra,🇲🇶
|
||||||
|
Mauritania,MR,ara,🇲🇷
|
||||||
|
Montserrat,MS,eng,
|
||||||
|
Malta,MT,mlt,🇲🇹
|
||||||
|
Mauritius,MU,eng,🇲🇺
|
||||||
|
Maldives,MV,div,🇲🇻
|
||||||
|
Malawi,MW,eng,🇲🇼
|
||||||
|
Mexico,MX,spa,🇲🇽
|
||||||
|
Malaysia,MY,msa,🇲🇾
|
||||||
|
Mozambique,MZ,por,🇲🇿
|
||||||
|
Namibia,NA,eng,🇳🇦
|
||||||
|
New Caledonia,NC,fra,🇳🇨
|
||||||
|
Niger,NE,fra,🇳🇪
|
||||||
|
Norfolk Island,NF,eng,🇳🇫
|
||||||
|
Nigeria,NG,eng,🇳🇬
|
||||||
|
Nicaragua,NI,spa,🇳🇮
|
||||||
|
Netherlands,NL,nld,🇳🇱
|
||||||
|
Norway,NO,nor,🇳🇴
|
||||||
|
Nepal,NP,nep,🇳🇵
|
||||||
|
Nauru,NR,eng,🇳🇷
|
||||||
|
Niue,NU,eng,🇳🇺
|
||||||
|
New Zealand,NZ,eng,🇳🇿
|
||||||
|
Oman,OM,ara,🇴🇲
|
||||||
|
Panama,PA,spa,🇵🇦
|
||||||
|
Peru,PE,spa,🇵🇪
|
||||||
|
French Polynesia,PF,fra,🇵🇫
|
||||||
|
Papua New Guinea,PG,eng,🇵🇬
|
||||||
|
Philippines,PH,eng,🇵🇭
|
||||||
|
Pakistan,PK,eng,🇵🇰
|
||||||
|
Poland,PL,pol,🇵🇱
|
||||||
|
Saint Pierre and Miquelon,PM,fra,
|
||||||
|
Pitcairn Islands,PN,eng,🇵🇳
|
||||||
|
Puerto Rico,PR,spa,🇵🇷
|
||||||
|
Palestine,PS,ara,🇵🇸
|
||||||
|
Portugal,PT,por,🇵🇹
|
||||||
|
Palau,PW,eng,🇵🇼
|
||||||
|
Paraguay,PY,spa,🇵🇾
|
||||||
|
Qatar,QA,ara,🇶🇦
|
||||||
|
Réunion,RE,fra,🇷🇪
|
||||||
|
Romania,RO,ron,🇷🇴
|
||||||
|
Serbia,RS,srp,🇷🇸
|
||||||
|
Russia,RU,rus,🇷🇺
|
||||||
|
Rwanda,RW,kin,🇷🇼
|
||||||
|
Saudi Arabia,SA,ara,🇸🇦
|
||||||
|
Solomon Islands,SB,eng,🇸🇧
|
||||||
|
Seychelles,SC,fra,🇸🇨
|
||||||
|
Sudan,SD,ara,🇸🇩
|
||||||
|
Sweden,SE,swe,🇸🇪
|
||||||
|
Singapore,SG,eng,🇸🇬
|
||||||
|
Saint Helena,SH,eng,🇸🇭
|
||||||
|
Slovenia,SI,slv,🇸🇮
|
||||||
|
Svalbard and Jan Mayen,SJ,nor,
|
||||||
|
Slovakia,SK,slk,🇸🇰
|
||||||
|
Sierra Leone,SL,eng,🇸🇱
|
||||||
|
San Marino,SM,ita,🇸🇲
|
||||||
|
Senegal,SN,fra,🇸🇳
|
||||||
|
Somalia,SO,som,🇸🇴
|
||||||
|
Suriname,SR,nld,
|
||||||
|
South Sudan,SS,eng,🇸🇸
|
||||||
|
São Tomé and Príncipe,ST,por,🇸🇹
|
||||||
|
El Salvador,SV,spa,🇸🇻
|
||||||
|
Sint Maarten,SX,nld,
|
||||||
|
Syria,SY,ara,🇸🇾
|
||||||
|
Swaziland,SZ,eng,🇸🇿
|
||||||
|
Turks and Caicos Islands,TC,eng,
|
||||||
|
Chad,TD,fra,🇹🇩
|
||||||
|
French Southern Territories,TF,fra,🇹🇫
|
||||||
|
Togo,TG,fra,🇹🇬
|
||||||
|
Thailand,TH,tha,🇹🇭
|
||||||
|
Tajikistan,TJ,tgk,🇹🇯
|
||||||
|
Tokelau,TK,eng,🇹🇰
|
||||||
|
East Timor,TL,por,🇹🇱
|
||||||
|
Turkmenistan,TM,tuk,🇹🇲
|
||||||
|
Tunisia,TN,ara,🇹🇳
|
||||||
|
Tonga,TO,eng,🇹🇴
|
||||||
|
Turkey,TR,tur,🇹🇷
|
||||||
|
Trinidad and Tobago,TT,eng,🇹🇹
|
||||||
|
Tuvalu,TV,eng,🇹🇻
|
||||||
|
Taiwan,TW,zho,🇹🇼
|
||||||
|
Tanzania,TZ,swa,🇹🇿
|
||||||
|
Ukraine,UA,ukr,🇺🇦
|
||||||
|
Uganda,UG,eng,🇺🇬
|
||||||
|
U.S. Minor Outlying Islands,UM,eng,
|
||||||
|
United States,US,eng,🇺🇸
|
||||||
|
Uruguay,UY,spa,🇺🇾
|
||||||
|
Uzbekistan,UZ,uzb,🇺🇿
|
||||||
|
Vatican City,VA,ita,🇻🇦
|
||||||
|
Saint Vincent and the Grenadines,VC,eng,
|
||||||
|
Venezuela,VE,spa,🇻🇪
|
||||||
|
British Virgin Islands,VG,eng,
|
||||||
|
U.S. Virgin Islands,VI,eng,🇻🇮
|
||||||
|
Vietnam,VN,vie,🇻🇳
|
||||||
|
Vanuatu,VU,bis,🇻🇺
|
||||||
|
Wallis and Futuna,WF,fra,🇼🇫
|
||||||
|
Samoa,WS,smo,🇼🇸
|
||||||
|
Kosovo,XK,sqi,🇽🇰
|
||||||
|
Yemen,YE,ara,🇾🇪
|
||||||
|
Mayotte,YT,fra,🇾🇹
|
||||||
|
South Africa,ZA,afr,🇿🇦
|
||||||
|
Zambia,ZM,eng,🇿🇲
|
||||||
|
Zimbabwe,ZW,eng,🇿🇼
|
|
8255
database/languages.csv
Normal file
8255
database/languages.csv
Normal file
File diff suppressed because it is too large
Load diff
258
package-lock.json
generated
Normal file
258
package-lock.json
generated
Normal file
|
@ -0,0 +1,258 @@
|
||||||
|
{
|
||||||
|
"name": "@iptv-org/api",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "@iptv-org/api",
|
||||||
|
"dependencies": {
|
||||||
|
"csvtojson": "^2.0.10",
|
||||||
|
"glob": "^7.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/balanced-match": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
|
},
|
||||||
|
"node_modules/bluebird": {
|
||||||
|
"version": "3.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||||
|
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
|
||||||
|
},
|
||||||
|
"node_modules/brace-expansion": {
|
||||||
|
"version": "1.1.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
|
},
|
||||||
|
"node_modules/csvtojson": {
|
||||||
|
"version": "2.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz",
|
||||||
|
"integrity": "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"bluebird": "^3.5.1",
|
||||||
|
"lodash": "^4.17.3",
|
||||||
|
"strip-bom": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"csvtojson": "bin/csvtojson"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fs.realpath": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
|
},
|
||||||
|
"node_modules/glob": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"fs.realpath": "^1.0.0",
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "^3.0.4",
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"path-is-absolute": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inflight": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
|
},
|
||||||
|
"node_modules/is-utf8": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||||
|
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
|
||||||
|
},
|
||||||
|
"node_modules/lodash": {
|
||||||
|
"version": "4.17.21",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
|
},
|
||||||
|
"node_modules/minimatch": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-is-absolute": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-bom": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
|
||||||
|
"dependencies": {
|
||||||
|
"is-utf8": "^0.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
|
},
|
||||||
|
"bluebird": {
|
||||||
|
"version": "3.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||||
|
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
|
||||||
|
},
|
||||||
|
"brace-expansion": {
|
||||||
|
"version": "1.1.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
|
"requires": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
|
},
|
||||||
|
"csvtojson": {
|
||||||
|
"version": "2.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz",
|
||||||
|
"integrity": "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ==",
|
||||||
|
"requires": {
|
||||||
|
"bluebird": "^3.5.1",
|
||||||
|
"lodash": "^4.17.3",
|
||||||
|
"strip-bom": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fs.realpath": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||||
|
"requires": {
|
||||||
|
"fs.realpath": "^1.0.0",
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "^3.0.4",
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"path-is-absolute": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inflight": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
|
"requires": {
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
|
},
|
||||||
|
"is-utf8": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||||
|
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
|
||||||
|
},
|
||||||
|
"lodash": {
|
||||||
|
"version": "4.17.21",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
|
},
|
||||||
|
"minimatch": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"requires": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-is-absolute": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||||
|
},
|
||||||
|
"strip-bom": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
|
||||||
|
"requires": {
|
||||||
|
"is-utf8": "^0.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
package.json
Normal file
12
package.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"name": "@iptv-org/api",
|
||||||
|
"scripts": {
|
||||||
|
"act": "act workflow_dispatch -W .github/workflows/auto-update.yml --artifact-server-path ./.artifacts"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"author": "Arhey",
|
||||||
|
"dependencies": {
|
||||||
|
"csvtojson": "^2.0.10",
|
||||||
|
"glob": "^7.2.0"
|
||||||
|
}
|
||||||
|
}
|
23
update.js
Normal file
23
update.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
const csv = require('csvtojson')
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const glob = require('glob')
|
||||||
|
|
||||||
|
const DATABASE_DIR = './database'
|
||||||
|
const OUTPUT_DIR = './.gh-pages'
|
||||||
|
|
||||||
|
fs.exists(OUTPUT_DIR, function (exists) {
|
||||||
|
if (!exists) {
|
||||||
|
fs.mkdirSync(OUTPUT_DIR)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
glob(`${DATABASE_DIR}/*.csv`, async function (err, files) {
|
||||||
|
for (const inputFile of files) {
|
||||||
|
const inputFilename = path.parse(inputFile).name
|
||||||
|
const outputFile = `${OUTPUT_DIR}/${inputFilename}.json`
|
||||||
|
|
||||||
|
const json = await csv().fromFile(inputFile)
|
||||||
|
fs.writeFileSync(path.resolve(outputFile), JSON.stringify(json))
|
||||||
|
}
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue