From 8fd8223cda3b31c4e6d9ad583b30505ba909bb63 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 11:20:34 +0300 Subject: [PATCH 01/39] Delete "legacy" tests/__data__ --- .../guides/bh/chaines-tv.orange.fr.epg.json | 1 - .../guides/bh/chaines-tv.orange.fr.epg.xml | 5 ----- .../guides/bh/chaines-tv.orange.fr.epg.xml.gz | Bin 623 -> 0 bytes .../guides/fr/chaines-tv.orange.fr.epg.json | 1 - .../guides/fr/chaines-tv.orange.fr.epg.xml | 5 ----- .../guides/fr/chaines-tv.orange.fr.epg.xml.gz | Bin 623 -> 0 bytes .../expected/guides/ge/magticom.ge.epg.json | 1 - .../expected/guides/ge/magticom.ge.epg.xml | 3 --- .../expected/guides/ge/magticom.ge.epg.xml.gz | Bin 198 -> 0 bytes .../expected/guides/ru/yandex.ru.epg.json | 1 - .../__data__/expected/guides/ru/yandex.ru.epg.xml | 2 -- .../expected/guides/ru/yandex.ru.epg.xml.gz | Bin 86 -> 0 bytes .../expected/guides/us/directv.com.epg.json | 1 - .../expected/guides/us/directv.com.epg.xml | 2 -- .../expected/guides/us/directv.com.epg.xml.gz | Bin 86 -> 0 bytes .../__data__/expected/guides/zw/dstv.com.epg.json | 1 - .../__data__/expected/guides/zw/dstv.com.epg.xml | 4 ---- .../expected/guides/zw/dstv.com.epg.xml.gz | Bin 342 -> 0 bytes 18 files changed, 27 deletions(-) delete mode 100644 tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.json delete mode 100644 tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml delete mode 100644 tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml.gz delete mode 100644 tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.json delete mode 100644 tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml delete mode 100644 tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml.gz delete mode 100644 tests/__data__/expected/guides/ge/magticom.ge.epg.json delete mode 100644 tests/__data__/expected/guides/ge/magticom.ge.epg.xml delete mode 100644 tests/__data__/expected/guides/ge/magticom.ge.epg.xml.gz delete mode 100644 tests/__data__/expected/guides/ru/yandex.ru.epg.json delete mode 100644 tests/__data__/expected/guides/ru/yandex.ru.epg.xml delete mode 100644 tests/__data__/expected/guides/ru/yandex.ru.epg.xml.gz delete mode 100644 tests/__data__/expected/guides/us/directv.com.epg.json delete mode 100644 tests/__data__/expected/guides/us/directv.com.epg.xml delete mode 100644 tests/__data__/expected/guides/us/directv.com.epg.xml.gz delete mode 100644 tests/__data__/expected/guides/zw/dstv.com.epg.json delete mode 100644 tests/__data__/expected/guides/zw/dstv.com.epg.xml delete mode 100644 tests/__data__/expected/guides/zw/dstv.com.epg.xml.gz diff --git a/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.json b/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.json deleted file mode 100644 index fb005c3c..00000000 --- a/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"CNNInternationalEurope.us","name":"CNN International","site":"chaines-tv.orange.fr","site_id":"53","lang":"fr","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://chaines-tv.orange.fr"}],"programs":[{"site":"chaines-tv.orange.fr","channel":"CNNInternationalEurope.us","titles":[{"value":"World Sport","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","lang":"fr"}],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1641825900000,"stop":1641826800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"chaines-tv.orange.fr","channel":"CNNInternationalEurope.us","titles":[{"value":"Connecting Africa. 114-я серия","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","lang":"fr"}],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1641843900000,"stop":1641844800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml b/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml deleted file mode 100644 index 61118187..00000000 --- a/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml +++ /dev/null @@ -1,5 +0,0 @@ - -CNN Internationalhttps://chaines-tv.orange.fr -World SportВсе о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов. -Connecting Africa. 114-я серия114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке. - \ No newline at end of file diff --git a/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml.gz b/tests/__data__/expected/guides/bh/chaines-tv.orange.fr.epg.xml.gz deleted file mode 100644 index 5281d05cc5bdd34fa02c1fedb49842de913361f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 623 zcmV-#0+9V5iwFP!000006QxqYZqq;%yd&`sD_==$Cu$@>jw`4@;?fHsxLS^z8acML z-bCfrq=0~k6!8J@3r=WgX&Uzz-u@BuHfhxgwL-$uO4fU`^XAR0x4G9##2}JIoTY86 zVY`-y(lG19X}4{?eDSn?-x8a?rv{=EsHkl<-DcBmxh>1Td&diRgEWm25qH|w*7o+Z zR7Elk6sUsaNnd7pWcLfp_d0QrC&Al#8uTI`KyeM}IoJAL9A>E~WZ1TLmCB2UjuYE) zuiKY)nDw0IF`ZDn^V2~51QBhX|JCi}$jqDxiIgId}wNzG}%d9Jd zUM~`b3Zz=^)M&Vkjg6M;ihC|T3(YLQ(ra<`qPJ$deQOn~Boax$PVPv{f0fCkBcA7( zRGwp+a3(6kD-imohcp*d3HnJ3DrrVbJ=X69%I8$+eLbR+tHp|@_(f44qCjW(*{9ML z^qr=3Y;KGhSJIieg1aUC`d3o=T@%1BaTZ|a$|;pKp0lJm4#o=og-#9A+%Q!%vymwF zg6o%7-|qW^n|*J(|Lyx$hC89cix!V|WE=*zXf!tJEPcqLd5fC@`3neZf8eje`lotS z6KuC0q7P%}SdZCYJ<*@oJd@)>Pv~fs&WQl3f_dl0RFhfF)YvzU3fUX~XU5ErhHAt! z<|tLnr9a@_1UVuY{f;%6$xEXE+yc3uAbI4&qHAVqB`{#V8pfl9iTE>Ej{sikLo`P# zaZ8i3Ntf578D7FrkMseHh7+JJStHAt;v4~Y070t_@M>B7Vy*D&rNa3QZ^BUn{|`o> J9Uz1R004+KHdz1w diff --git a/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.json b/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.json deleted file mode 100644 index fb005c3c..00000000 --- a/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"CNNInternationalEurope.us","name":"CNN International","site":"chaines-tv.orange.fr","site_id":"53","lang":"fr","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://chaines-tv.orange.fr"}],"programs":[{"site":"chaines-tv.orange.fr","channel":"CNNInternationalEurope.us","titles":[{"value":"World Sport","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","lang":"fr"}],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1641825900000,"stop":1641826800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"chaines-tv.orange.fr","channel":"CNNInternationalEurope.us","titles":[{"value":"Connecting Africa. 114-я серия","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","lang":"fr"}],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1641843900000,"stop":1641844800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml b/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml deleted file mode 100644 index 61118187..00000000 --- a/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml +++ /dev/null @@ -1,5 +0,0 @@ - -CNN Internationalhttps://chaines-tv.orange.fr -World SportВсе о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов. -Connecting Africa. 114-я серия114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке. - \ No newline at end of file diff --git a/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml.gz b/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml.gz deleted file mode 100644 index 5281d05cc5bdd34fa02c1fedb49842de913361f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 623 zcmV-#0+9V5iwFP!000006QxqYZqq;%yd&`sD_==$Cu$@>jw`4@;?fHsxLS^z8acML z-bCfrq=0~k6!8J@3r=WgX&Uzz-u@BuHfhxgwL-$uO4fU`^XAR0x4G9##2}JIoTY86 zVY`-y(lG19X}4{?eDSn?-x8a?rv{=EsHkl<-DcBmxh>1Td&diRgEWm25qH|w*7o+Z zR7Elk6sUsaNnd7pWcLfp_d0QrC&Al#8uTI`KyeM}IoJAL9A>E~WZ1TLmCB2UjuYE) zuiKY)nDw0IF`ZDn^V2~51QBhX|JCi}$jqDxiIgId}wNzG}%d9Jd zUM~`b3Zz=^)M&Vkjg6M;ihC|T3(YLQ(ra<`qPJ$deQOn~Boax$PVPv{f0fCkBcA7( zRGwp+a3(6kD-imohcp*d3HnJ3DrrVbJ=X69%I8$+eLbR+tHp|@_(f44qCjW(*{9ML z^qr=3Y;KGhSJIieg1aUC`d3o=T@%1BaTZ|a$|;pKp0lJm4#o=og-#9A+%Q!%vymwF zg6o%7-|qW^n|*J(|Lyx$hC89cix!V|WE=*zXf!tJEPcqLd5fC@`3neZf8eje`lotS z6KuC0q7P%}SdZCYJ<*@oJd@)>Pv~fs&WQl3f_dl0RFhfF)YvzU3fUX~XU5ErhHAt! z<|tLnr9a@_1UVuY{f;%6$xEXE+yc3uAbI4&qHAVqB`{#V8pfl9iTE>Ej{sikLo`P# zaZ8i3Ntf578D7FrkMseHh7+JJStHAt;v4~Y070t_@M>B7Vy*D&rNa3QZ^BUn{|`o> J9Uz1R004+KHdz1w diff --git a/tests/__data__/expected/guides/ge/magticom.ge.epg.json b/tests/__data__/expected/guides/ge/magticom.ge.epg.json deleted file mode 100644 index a418f6d7..00000000 --- a/tests/__data__/expected/guides/ge/magticom.ge.epg.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"CNNInternationalEurope.us","name":"CNN International","site":"magticom.ge","site_id":"140","lang":"ru","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://magticom.ge"}],"programs":[]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/ge/magticom.ge.epg.xml b/tests/__data__/expected/guides/ge/magticom.ge.epg.xml deleted file mode 100644 index 9a4ed48e..00000000 --- a/tests/__data__/expected/guides/ge/magticom.ge.epg.xml +++ /dev/null @@ -1,3 +0,0 @@ - -CNN Internationalhttps://magticom.ge - \ No newline at end of file diff --git a/tests/__data__/expected/guides/ge/magticom.ge.epg.xml.gz b/tests/__data__/expected/guides/ge/magticom.ge.epg.xml.gz deleted file mode 100644 index e51b322101ec983c27b3d30e9e48cb13f41cf31e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmV;%06G63iwFP!000006IG5us{$buM)yJgLGC`afgs{)P`n3k)2g7YIAVrg2X%(t zzi)zCv_9wiIJkeL$R<~6$fRJ+B``-e_kp~E%lUV;1-94NCf1wg6m+ud5rN#WZHaX;?G#};P_ZUV;|}e&Hsu_a(Wiomx - \ No newline at end of file diff --git a/tests/__data__/expected/guides/ru/yandex.ru.epg.xml.gz b/tests/__data__/expected/guides/ru/yandex.ru.epg.xml.gz deleted file mode 100644 index 53935329f82edd82c16e195a7574aa2a91e82378..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmb2|=3oE=;msS@pEw(+;jOE6?#%hkp+;AX1A;uxdY|(@dB%HtC>L+x<*flh8@6xO m)C~6U)bZRJYGh;pM5YFzn;t*ibWvY(Gc&^jE7?#dpm6|~4Ip{| diff --git a/tests/__data__/expected/guides/us/directv.com.epg.json b/tests/__data__/expected/guides/us/directv.com.epg.json deleted file mode 100644 index e74c7fac..00000000 --- a/tests/__data__/expected/guides/us/directv.com.epg.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[],"programs":[]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/us/directv.com.epg.xml b/tests/__data__/expected/guides/us/directv.com.epg.xml deleted file mode 100644 index d396a1df..00000000 --- a/tests/__data__/expected/guides/us/directv.com.epg.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/tests/__data__/expected/guides/us/directv.com.epg.xml.gz b/tests/__data__/expected/guides/us/directv.com.epg.xml.gz deleted file mode 100644 index 53935329f82edd82c16e195a7574aa2a91e82378..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmb2|=3oE=;msS@pEw(+;jOE6?#%hkp+;AX1A;uxdY|(@dB%HtC>L+x<*flh8@6xO m)C~6U)bZRJYGh;pM5YFzn;t*ibWvY(Gc&^jE7?#dpm6|~4Ip{| diff --git a/tests/__data__/expected/guides/zw/dstv.com.epg.json b/tests/__data__/expected/guides/zw/dstv.com.epg.json deleted file mode 100644 index e52810b4..00000000 --- a/tests/__data__/expected/guides/zw/dstv.com.epg.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"MNetMovies2.za","name":"M-Net Movies 2","site":"dstv.com","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","lang":"en","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","url":"https://dstv.com"}],"programs":[{"site":"dstv.com","channel":"MNetMovies2.za","titles":[{"value":"Robin Hood","lang":"en"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"8.256.0/1"},{"system":"onscreen","value":"S09E257"}],"date":null,"start":1641822300000,"stop":1641829200000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/zw/dstv.com.epg.xml b/tests/__data__/expected/guides/zw/dstv.com.epg.xml deleted file mode 100644 index efb0e0ab..00000000 --- a/tests/__data__/expected/guides/zw/dstv.com.epg.xml +++ /dev/null @@ -1,4 +0,0 @@ - -M-Net Movies 2https://dstv.com -Robin Hood8.256.0/1S09E257 - \ No newline at end of file diff --git a/tests/__data__/expected/guides/zw/dstv.com.epg.xml.gz b/tests/__data__/expected/guides/zw/dstv.com.epg.xml.gz deleted file mode 100644 index 9b7c206430da3163c471c398f554fa9082bc066a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 342 zcmV-c0jd5UiwFP!000006K#=CPXi$k#qTD52g23t!qTo*!_t$+gZ1E_^9F%zi7;${ zZdyORyKU8K)7Q_!Y>jYnyhvhfWb|0xeGBrFyst1nAR oDo#!Y|KAFbR5X*#GrhiL_0^vp@*Q=`P4XZ<0qUac(h>py0N?4I?f?J) From 807f3cd15b24201c2b1978bdea2ea801d2d08aea Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 11:22:28 +0300 Subject: [PATCH 02/39] Update tests/__data__ --- tests/__data__/expected/guides/allente.se/da.json | 1 + tests/__data__/expected/guides/allente.se/da.xml | 4 ++++ .../__data__/expected/guides/allente.se/da.xml.gz | Bin 0 -> 452 bytes tests/__data__/expected/guides/sky.com/en.json | 1 + tests/__data__/expected/guides/sky.com/en.xml | 4 ++++ tests/__data__/expected/guides/sky.com/en.xml.gz | Bin 0 -> 377 bytes .../expected/guides/virginmedia.com/en.json | 1 + .../expected/guides/virginmedia.com/en.xml | 4 ++++ .../expected/guides/virginmedia.com/en.xml.gz | Bin 0 -> 378 bytes tests/__data__/expected/logs/guides/update.log | 7 +++++-- 10 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tests/__data__/expected/guides/allente.se/da.json create mode 100644 tests/__data__/expected/guides/allente.se/da.xml create mode 100644 tests/__data__/expected/guides/allente.se/da.xml.gz create mode 100644 tests/__data__/expected/guides/sky.com/en.json create mode 100644 tests/__data__/expected/guides/sky.com/en.xml create mode 100644 tests/__data__/expected/guides/sky.com/en.xml.gz create mode 100644 tests/__data__/expected/guides/virginmedia.com/en.json create mode 100644 tests/__data__/expected/guides/virginmedia.com/en.xml create mode 100644 tests/__data__/expected/guides/virginmedia.com/en.xml.gz diff --git a/tests/__data__/expected/guides/allente.se/da.json b/tests/__data__/expected/guides/allente.se/da.json new file mode 100644 index 00000000..37dcb8ba --- /dev/null +++ b/tests/__data__/expected/guides/allente.se/da.json @@ -0,0 +1 @@ +{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se/da.xml b/tests/__data__/expected/guides/allente.se/da.xml new file mode 100644 index 00000000..40e099ac --- /dev/null +++ b/tests/__data__/expected/guides/allente.se/da.xml @@ -0,0 +1,4 @@ + +6'erenhttps://allente.se +Diners, Drive-Ins and DivesUnderholdningseries23.5.0/1S24E06 + \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se/da.xml.gz b/tests/__data__/expected/guides/allente.se/da.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..fe964bfa63dab1f4fe64d2c1e55681ee6c931a8f GIT binary patch literal 452 zcmV;#0XzO5iwFP!000006K#@FZ`&Xc$KNOIJ0PU(Wiw#rIPHcVY04(;ZBp0g2$_>Z zYXjnl*X+{|wxms~@_;!0cPH-mM{OSFi7XJ&de_mK2}-~X-dHzw^!C^H>WY$0uhK${ zPS8;)q^yM$w14|X4SVezOvIXwwh+NFb5DC^EQU!RE2n4Z+xI$n{8CiKpDD@?-VuyL zNB1cO{LJ|wOkNxI+uqw5jMdD?k(Vfxh!1|Ay+hvew&CqNxh`FIQq(IJ+(>z^4sq(w z&Ga;ZOTZ8mFZYU{-dmm?q93E4XCRn#Opk*#q7iwK4`ruW^x;yIt0(Q$?b+zbrU}TT z3q7N0zqKy2{YbXaE>Qh&NVGF#n*&t*UvkC;I9!z6IsPa6xIy~|I=O1aL)|o@*aE?#H&D65Oz?;a=8oo%mzJGF u+RIOD#RRVvzsP&ND7!yI07v^9*?bf2ixU25Yw?(;rT+_$9H*q=0ssJ{Gv#am literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/guides/sky.com/en.json b/tests/__data__/expected/guides/sky.com/en.json new file mode 100644 index 00000000..03f35c39 --- /dev/null +++ b/tests/__data__/expected/guides/sky.com/en.json @@ -0,0 +1 @@ +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com/en.xml b/tests/__data__/expected/guides/sky.com/en.xml new file mode 100644 index 00000000..1eeac223 --- /dev/null +++ b/tests/__data__/expected/guides/sky.com/en.xml @@ -0,0 +1,4 @@ + +BBC Newshttps://sky.com +BBC News at OneThe latest national and international news from the BBC. [S,SL] + \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com/en.xml.gz b/tests/__data__/expected/guides/sky.com/en.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3f1f279c8c741a25937fd54480ba4bd02bfe2a4 GIT binary patch literal 377 zcmV-<0fzn`iwFP!000006J3!(Yuqpph3|py*ty6X|D!KE{zN$6)Nn-X(pfqUp*WAXUKzdv}d-5UHOza zCh(LpVj6*b56&kJr;0B@+b~a%vOh;l_;LUC{>#ryEa$x@l?m`N`SSU9I%?eWi8ZRC;~2)tl{Rt!qYA XH%;M>C$xn#rbG7^Z`vxII|2XzEoQvk literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/guides/virginmedia.com/en.json b/tests/__data__/expected/guides/virginmedia.com/en.json new file mode 100644 index 00000000..5ff6b490 --- /dev/null +++ b/tests/__data__/expected/guides/virginmedia.com/en.json @@ -0,0 +1 @@ +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com/en.xml b/tests/__data__/expected/guides/virginmedia.com/en.xml new file mode 100644 index 00000000..667c2f07 --- /dev/null +++ b/tests/__data__/expected/guides/virginmedia.com/en.xml @@ -0,0 +1,4 @@ + +BBC Newshttps://virginmedia.com +BBC News at OneThe latest national and international news, followed by weather.News96839999.145799123.0/1S96840000E145799124 + \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com/en.xml.gz b/tests/__data__/expected/guides/virginmedia.com/en.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..c41ccf960353939aeab81801ed1e97e94c23eb97 GIT binary patch literal 378 zcmV-=0fqh_iwFP!000006K#>fZWJ*LhVMvy2P@aIlbPv4cTpylia>}1Akm(yFk@z; zCeA4F&ayl`3GJ?i3LkRtZ-23WtD9fm!HhB4K%Ho+S^!cX21{cn?(aUXHUe(6;u!|R z*on4o+oo=7p)X#kerJf#fgL(=d;9(i9#XY`6j}{7P0k!wWIXDuK#`REC#`HB2vY1j zv16XnJ1K2t{kV@+AH0m;et+6*K35ZsLTa^-PM^wV8%IkX2Wv{Hl0{VVd73iV6vG&e z_Xvqis2149E?VvOeuWzcK*8Jr6T9N@t=$ z6b4+;-a|SjM&F5iW1b%<3B7&0x!UHan)RFO?KZDm)v{4?(e-~spwve!AAZk_b@AxK YiLrjsFVFUuTS%VuAK6+uY-a)h0ARtfzyJUM literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index fdba1db3..ac7777d7 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -1,2 +1,5 @@ -{"country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk"} -{"country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} +{"groupedBy":"broadcast_area","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk"} +{"groupedBy":"broadcast_area","country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} +{"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} +{"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} +{"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} From a4d6f33a0cdac34767ec3e743e81ffe1175a4897 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 11:22:35 +0300 Subject: [PATCH 03/39] Update update.js --- scripts/commands/guides/update.js | 124 ++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 39 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index e0e09b17..b2ac326b 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -9,6 +9,10 @@ const CURR_DATE = process.env.CURR_DATE || new Date() const logPath = `${LOGS_DIR}/guides/update.log` +let api_channels = [] +let channels_dic = {} +let db_programs = [] + async function main() { logger.info(`starting...`) @@ -18,20 +22,14 @@ async function main() { await api.regions.load() await api.subdivisions.load() - let countries = await api.countries.all() - let api_channels = await api.channels.all() - - let channels_dic = {} + api_channels = await api.channels.all() api_channels.forEach(channel => { channels_dic[channel.id] = channel }) - let api_regions = await api.regions.all() - let api_subdivisions = await api.subdivisions.all() - logger.info('loading database/programs.db...') await db.programs.load() - let db_programs = await db.programs.find({}) + db_programs = await db.programs.find({}) db_programs = db_programs .map(p => { if (p.titles.length) { @@ -48,7 +46,46 @@ async function main() { logger.info(`creating ${logPath}...`) await file.create(logPath) - for (let country of countries) { + await generateByCountry() + + await generateBySource() +} + +main() + +async function generateBySource() { + let sites = _.groupBy(db_programs, 'site') + + for (let site in sites) { + let langs = _.groupBy(sites[site], p => p.titles[0].lang) + + for (let lang in langs) { + let programs = langs[lang] + let filename = `${site}/${lang}` + + let { channels } = await save(filename, programs) + + for (let channel of channels) { + let result = { + groupedBy: 'site+lang', + lang: channel.lang, + site: channel.site, + channel: channel.id, + filename + } + + await file.append(logPath, JSON.stringify(result) + '\r\n') + } + } + } +} + +async function generateByCountry() { + let api_countries = await api.countries.all() + let api_regions = await api.regions.all() + let api_subdivisions = await api.subdivisions.all() + + for (let country of api_countries) { let countryBroadcastCode = `c/${country.code}` let countryRegions = api_regions .filter(r => r.countries.includes(country.code)) @@ -90,39 +127,13 @@ async function main() { if (!programs.length) continue - let channels = programs.map(p => { - let c = channels_dic[p.channel] - c.site = p.site - c.lang = p.lang - - return new Channel(c) - }) - channels = _.sortBy(channels, 'id') - channels = _.uniqBy(channels, 'id') - - programs = _.sortBy(programs, ['channel', 'start']) - programs = programs.map(p => new Program(p, new Channel(channels_dic[p.channel]))) - programs = _.uniqBy(programs, p => p.channel + p.start) - const filename = country.code.toLowerCase() - const xmlFilepath = `${PUBLIC_DIR}/guides/${filename}.xml` - const gzFilepath = `${PUBLIC_DIR}/guides/${filename}.xml.gz` - const jsonFilepath = `${PUBLIC_DIR}/guides/${filename}.json` - logger.info(`creating ${xmlFilepath}...`) - const xmltv = generateXMLTV({ - channels, - programs, - date: CURR_DATE - }) - await file.create(xmlFilepath, xmltv) - logger.info(`creating ${gzFilepath}...`) - const compressed = await zip.compress(xmltv) - await file.create(gzFilepath, compressed) - logger.info(`creating ${jsonFilepath}...`) - await file.create(jsonFilepath, JSON.stringify({ channels, programs })) + + let { channels } = await save(filename, programs) for (let channel of channels) { let result = { + groupedBy: 'broadcast_area', country: country.code, lang: channel.lang, site: channel.site, @@ -135,7 +146,42 @@ async function main() { } } -main() +async function save(filepath, programs) { + let channels = programs.map(p => { + let c = channels_dic[p.channel] + c.site = p.site + c.lang = p.lang + + return new Channel(c) + }) + channels = _.sortBy(channels, 'id') + channels = _.uniqBy(channels, 'id') + + programs = _.sortBy(programs, ['channel', 'start']) + programs = programs.map(p => new Program(p, new Channel(channels_dic[p.channel]))) + programs = _.uniqBy(programs, p => p.channel + p.start) + + const xmlFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml` + const gzFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml.gz` + const jsonFilepath = `${PUBLIC_DIR}/guides/${filepath}.json` + logger.info(`creating ${xmlFilepath}...`) + const xmltv = generateXMLTV({ + channels, + programs, + date: CURR_DATE + }) + await file.create(xmlFilepath, xmltv) + logger.info(`creating ${gzFilepath}...`) + const compressed = await zip.compress(xmltv) + await file.create(gzFilepath, compressed) + logger.info(`creating ${jsonFilepath}...`) + await file.create(jsonFilepath, JSON.stringify({ channels, programs })) + + return { + channels, + programs + } +} function convertLangCode(code, from, to) { let found = langs.where(from, code) From 50f4668ab5b3e0d2d4d3a87faa55a59ee0486f27 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:19:58 +0300 Subject: [PATCH 04/39] Update update.log --- tests/__data__/expected/logs/guides/update.log | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index ac7777d7..ffdec449 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -1,5 +1,5 @@ -{"groupedBy":"broadcast_area","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk"} -{"groupedBy":"broadcast_area","country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} +{"groupedBy":"country","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk"} +{"groupedBy":"country","country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} {"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} {"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} {"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} From 14915051011cbf5d6d7caf49d50e8a23d04dc3e7 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:20:03 +0300 Subject: [PATCH 05/39] Update update.js --- scripts/commands/guides/update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index b2ac326b..fb7e1a98 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -133,7 +133,7 @@ async function generateByCountry() { for (let channel of channels) { let result = { - groupedBy: 'broadcast_area', + groupedBy: 'country', country: country.code, lang: channel.lang, site: channel.site, From 913d4592c91183f511f12f112311e7db007b4914 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:20:12 +0300 Subject: [PATCH 06/39] Update update.log --- tests/__data__/input/logs/guides/update.log | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/__data__/input/logs/guides/update.log b/tests/__data__/input/logs/guides/update.log index 87eb14a2..cde0637c 100644 --- a/tests/__data__/input/logs/guides/update.log +++ b/tests/__data__/input/logs/guides/update.log @@ -1,8 +1,12 @@ -{"country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk_da"} -{"country":"CA","lang":"fr","site":"tvhebdo.com","channel":"ABCSpark.ca","filename":"ca_fr"} -{"country":"CA","lang":"fr","site":"tvhebdo.com","channel":"BBCEarthCanada.ca","filename":"ca_fr"} -{"country":"CA","lang":"fr","site":"tvhebdo.com","channel":"beINSportsCanada.ca","filename":"ca_fr"} -{"country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_fr"} -{"country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_fr"} -{"country":"CA","lang":"en","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_en"} -{"country":"CA","lang":"en","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_en"} \ No newline at end of file +{"groupedBy":"country","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk_da"} +{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"ABCSpark.ca","filename":"ca_fr"} +{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"BBCEarthCanada.ca","filename":"ca_fr"} +{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"beINSportsCanada.ca","filename":"ca_fr"} +{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_fr"} +{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_fr"} +{"groupedBy":"country","country":"CA","lang":"en","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_en"} +{"groupedBy":"country","country":"CA","lang":"en","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_en"} +{"groupedBy":"site+lang","lang":"en","site":"allente.se","channel":"6eren.dk","filename":"allente.se/en"} +{"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} +{"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} +{"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} From 993776aa69461de2f5cf450e6d50d0bd60ecd5ed Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:20:24 +0300 Subject: [PATCH 07/39] Update _readme.md --- tests/__data__/expected/_readme.md | 36 +++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index 0e754087..036ca66d 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -1,11 +1,21 @@ # EPG +[![_update](https://github.com/iptv-org/epg/actions/workflows/_update.yml/badge.svg)](https://github.com/iptv-org/epg/actions/workflows/_update.yml) + EPG (Electronic Program Guide) for thousands of TV channels collected from different sources. -## Usage +## How to use? To load a program guide, all you need to do is copy the link to one or more of the guides from the list below and paste it into your favorite player. +## Guides + +### Grouped by country + +
+Expand +
+ @@ -18,6 +28,30 @@ To load a program guide, all you need to do is copy the link to one or more of t
+
+ +### Grouped by source + +
+Expand +
+ + + + + + + + + + + + +
SiteChannelsEPG
allente.se1https://iptv-org.github.io/epg/guides/allente.se/en.xml
1https://iptv-org.github.io/epg/guides/allente.se/da.xml
sky.com1https://iptv-org.github.io/epg/guides/sky.com/en.xml
virginmedia.com1https://iptv-org.github.io/epg/guides/virginmedia.com/en.xml
+ +
+
+ All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. ## Contribution From b5f6640446cab9ca3d3b7eb0a74f727fc6984eec Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:20:58 +0300 Subject: [PATCH 08/39] Update readme.md --- .readme/readme.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.readme/readme.md b/.readme/readme.md index 678f6939..6b49aa10 100644 --- a/.readme/readme.md +++ b/.readme/readme.md @@ -4,13 +4,35 @@ EPG (Electronic Program Guide) for thousands of TV channels collected from different sources. -## Usage +## How to use? To load a program guide, all you need to do is copy the link to one or more of the guides from the list below and paste it into your favorite player. +## Guides + +### Grouped by country + +
+Expand +
+ #include "./.readme/_countries.md" +
+ +### Grouped by source + +
+Expand +
+ + +#include "./.readme/_sources.md" + +
+
+ All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. ## Contribution From 4f7c7d013639c1779291e80a2720ef76bfd0a2c5 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:21:02 +0300 Subject: [PATCH 09/39] Update update.js --- scripts/commands/readme/update.js | 94 ++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index 157ed92d..b327325a 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -12,20 +12,79 @@ const options = program async function main() { await api.countries.load().catch(console.error) const logPath = `${LOGS_DIR}/guides/update.log` - let results = await parser.parseLogs(logPath) - let files = results.reduce((acc, curr) => { - if (acc[curr.filename]) { - acc[curr.filename].channels++ - } else { - acc[curr.filename] = { - country: curr.country, - channels: 1, - filename: curr.filename - } - } + let log = await parser.parseLogs(logPath) - return acc - }, {}) + await createCountriesTable(log) + await createSourcesTable(log) + + await updateReadme() +} + +main() + +async function createSourcesTable(log) { + let files = log + .filter(c => c.groupedBy === 'site+lang') + .reduce((acc, curr) => { + if (!acc[curr.filename]) { + acc[curr.filename] = { + site: curr.site, + lang: curr.lang, + channels: 0, + filename: curr.filename + } + } + + acc[curr.filename].channels++ + + return acc + }, {}) + + let data = [] + for (const filename in files) { + const item = files[filename] + + data.push([ + item.site, + item.lang, + item.channels, + `https://iptv-org.github.io/epg/guides/${filename}.xml` + ]) + } + + data = _.orderBy( + data, + [item => item[0], item => (item[1] === 'en' ? Infinity : item[2])], + ['asc', 'desc'] + ) + data = data.map(i => { + i.splice(1, 1) + return i + }) + data = Object.values(_.groupBy(data, item => item[0])) + + const output = table.create(data, ['Site', 'Channels', 'EPG']) + + await file.create('./.readme/_sources.md', output) +} + +async function createCountriesTable(log) { + let files = log + .filter(c => c.groupedBy === 'country') + .reduce((acc, curr) => { + if (!acc[curr.filename]) { + acc[curr.filename] = { + country: curr.country, + lang: curr.lang, + channels: 0, + filename: curr.filename + } + } + + acc[curr.filename].channels++ + + return acc + }, {}) let data = [] for (const filename in files) { @@ -35,6 +94,7 @@ async function main() { data.push([ country.name, + item.lang, `${country.flag} ${country.name}`, item.channels, `https://iptv-org.github.io/epg/guides/${filename}.xml` @@ -43,11 +103,11 @@ async function main() { data = _.orderBy( data, - [item => item[0], item => (item[3].includes('_en') ? Infinity : item[2])], + [item => item[0], item => (item[1] === 'en' ? Infinity : item[3])], ['asc', 'desc'] ) data = data.map(i => { - i.shift() + i.splice(0, 2) return i }) data = Object.values(_.groupBy(data, item => item[0])) @@ -55,12 +115,8 @@ async function main() { const output = table.create(data, ['Country', 'Channels', 'EPG']) await file.create('./.readme/_countries.md', output) - - await updateReadme() } -main() - async function updateReadme() { logger.info('updating readme.md...') From 14c015137ef1b34806a0673eeb24ebc102b804ee Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:21:05 +0300 Subject: [PATCH 10/39] Update .gitignore --- .readme/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.readme/.gitignore b/.readme/.gitignore index 7453eaa7..9f1700ca 100644 --- a/.readme/.gitignore +++ b/.readme/.gitignore @@ -1,2 +1,3 @@ _countries.md -_sites.md \ No newline at end of file +_sites.md +_sources.md \ No newline at end of file From 693bc94d216957aeddc454103d7cf059f54a337f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 12:23:03 +0300 Subject: [PATCH 11/39] Update guides.json --- tests/__data__/expected/api/guides.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__data__/expected/api/guides.json b/tests/__data__/expected/api/guides.json index a6fd2a2a..35c8273d 100644 --- a/tests/__data__/expected/api/guides.json +++ b/tests/__data__/expected/api/guides.json @@ -1 +1 @@ -[{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/dk_da.xml"},{"channel":"ABCSpark.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"BBCEarthCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"beINSportsCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"}] \ No newline at end of file +[{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/dk_da.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"en","url":"https://iptv-org.github.io/epg/guides/allente.se/en.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/allente.se/da.xml"},{"channel":"ABCSpark.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"BBCEarthCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/virginmedia.com/en.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/sky.com/en.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"beINSportsCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"}] \ No newline at end of file From 9ecd2c5ffbd4890b2841c46de6ec4c923ca08c66 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 15:02:33 +0300 Subject: [PATCH 12/39] Update update.log --- tests/__data__/expected/logs/guides/update.log | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index 98c6a2f7..abebf1c4 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -2,4 +2,5 @@ {"groupedBy":"country","country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} {"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} {"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} +{"groupedBy":"site+lang","lang":"fr","site":"sky.com","channel":"CNN.us","filename":"sky.com/fr"} {"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} \ No newline at end of file From c40ef23e9b64b857417eb12055c282fcf04b69dd Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 15:02:36 +0300 Subject: [PATCH 13/39] Update update.test.js --- tests/commands/guides/update.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/commands/guides/update.test.js b/tests/commands/guides/update.test.js index eac2e69c..f2dc8208 100644 --- a/tests/commands/guides/update.test.js +++ b/tests/commands/guides/update.test.js @@ -35,6 +35,18 @@ creating tests/__data__/output/guides/dk.json... creating tests/__data__/output/guides/uk.xml... creating tests/__data__/output/guides/uk.xml.gz... creating tests/__data__/output/guides/uk.json... +creating tests/__data__/output/guides/allente.se/da.xml... +creating tests/__data__/output/guides/allente.se/da.xml.gz... +creating tests/__data__/output/guides/allente.se/da.json... +creating tests/__data__/output/guides/virginmedia.com/en.xml... +creating tests/__data__/output/guides/virginmedia.com/en.xml.gz... +creating tests/__data__/output/guides/virginmedia.com/en.json... +creating tests/__data__/output/guides/sky.com/fr.xml... +creating tests/__data__/output/guides/sky.com/fr.xml.gz... +creating tests/__data__/output/guides/sky.com/fr.json... +creating tests/__data__/output/guides/sky.com/en.xml... +creating tests/__data__/output/guides/sky.com/en.xml.gz... +creating tests/__data__/output/guides/sky.com/en.json... creating tests/__data__/output/logs/guides/update.log... report: From 80c02a6c4fc33a044e2420c345e5db570d8bb26b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 8 Jan 2023 15:02:46 +0300 Subject: [PATCH 14/39] Update update.js --- scripts/commands/guides/update.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index e4c9d797..c1f203c5 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -47,9 +47,6 @@ async function main() { .filter(Boolean) logger.info(`found ${db_programs.length} programs`) - logger.info(`creating ${logPath}...`) - await file.create(logPath) - await generateByCountry() await generateBySource() @@ -231,9 +228,10 @@ function calcScore(program) { async function makeReport() { const errors = [] + let countryGuides = guides.filter(g => g.groupedBy === 'country') let programs = _.uniqBy(db_programs, p => p.site + p.channel) for (let program of programs) { - if (!guides.find(g => g.channel === program.channel)) { + if (!countryGuides.find(g => g.channel === program.channel)) { const channel = await api.channels.find({ id: program.channel }) errors.push({ type: 'no_guide', ...program, ...channel }) } From 3c7794d0a4f32072dbe7f71399e7e209dac80690 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:44:54 +0300 Subject: [PATCH 15/39] Update tests/__data__ --- tests/__data__/expected/_readme.md | 38 ++---------------- tests/__data__/expected/_status.md | 11 ----- tests/__data__/expected/api/guides.json | 2 +- .../{allente.se/da.json => allente.se.json} | 0 .../{allente.se/da.xml => allente.se.xml} | 0 .../da.xml.gz => allente.se.xml.gz} | Bin tests/__data__/expected/guides/dk.json | 1 - tests/__data__/expected/guides/dk.xml | 4 -- tests/__data__/expected/guides/dk.xml.gz | Bin 452 -> 0 bytes tests/__data__/expected/guides/sky.com.json | 1 + tests/__data__/expected/guides/sky.com.xml | 6 +++ tests/__data__/expected/guides/sky.com.xml.gz | Bin 0 -> 486 bytes .../__data__/expected/guides/sky.com/en.json | 1 - tests/__data__/expected/guides/sky.com/en.xml | 4 -- .../expected/guides/sky.com/en.xml.gz | Bin 377 -> 0 bytes .../guides/{uk.json => virginmedia.com.json} | 0 .../guides/{uk.xml => virginmedia.com.xml} | 0 .../{uk.xml.gz => virginmedia.com.xml.gz} | Bin .../expected/guides/virginmedia.com/en.json | 1 - .../expected/guides/virginmedia.com/en.xml | 4 -- .../expected/guides/virginmedia.com/en.xml.gz | Bin 378 -> 0 bytes .../__data__/expected/logs/guides/update.log | 11 +++-- .../input/database/update-guides/programs.db | 1 + tests/__data__/input/logs/guides/update.log | 17 +++----- 24 files changed, 23 insertions(+), 79 deletions(-) delete mode 100644 tests/__data__/expected/_status.md rename tests/__data__/expected/guides/{allente.se/da.json => allente.se.json} (100%) rename tests/__data__/expected/guides/{allente.se/da.xml => allente.se.xml} (100%) rename tests/__data__/expected/guides/{allente.se/da.xml.gz => allente.se.xml.gz} (100%) delete mode 100644 tests/__data__/expected/guides/dk.json delete mode 100644 tests/__data__/expected/guides/dk.xml delete mode 100644 tests/__data__/expected/guides/dk.xml.gz create mode 100644 tests/__data__/expected/guides/sky.com.json create mode 100644 tests/__data__/expected/guides/sky.com.xml create mode 100644 tests/__data__/expected/guides/sky.com.xml.gz delete mode 100644 tests/__data__/expected/guides/sky.com/en.json delete mode 100644 tests/__data__/expected/guides/sky.com/en.xml delete mode 100644 tests/__data__/expected/guides/sky.com/en.xml.gz rename tests/__data__/expected/guides/{uk.json => virginmedia.com.json} (100%) rename tests/__data__/expected/guides/{uk.xml => virginmedia.com.xml} (100%) rename tests/__data__/expected/guides/{uk.xml.gz => virginmedia.com.xml.gz} (100%) delete mode 100644 tests/__data__/expected/guides/virginmedia.com/en.json delete mode 100644 tests/__data__/expected/guides/virginmedia.com/en.xml delete mode 100644 tests/__data__/expected/guides/virginmedia.com/en.xml.gz diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index 036ca66d..d16e056c 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -10,48 +10,18 @@ To load a program guide, all you need to do is copy the link to one or more of t ## Guides -### Grouped by country - -
-Expand -
- - + - - - + + +
CountryChannelsEPG
SiteChannelsEPGStatus
🇨🇦 Canada2https://iptv-org.github.io/epg/guides/ca_en.xml
5https://iptv-org.github.io/epg/guides/ca_fr.xml
🇩🇰 Denmark1https://iptv-org.github.io/epg/guides/dk_da.xml
allente.se1https://iptv-org.github.io/epg/guides/allente.se.xmlallente.se
sky.com1https://iptv-org.github.io/epg/guides/sky.com.xmlsky.com
virginmedia.com1https://iptv-org.github.io/epg/guides/virginmedia.com.xmlvirginmedia.com
-
- -### Grouped by source - -
-Expand -
- - - - - - - - - - - - -
SiteChannelsEPG
allente.se1https://iptv-org.github.io/epg/guides/allente.se/en.xml
1https://iptv-org.github.io/epg/guides/allente.se/da.xml
sky.com1https://iptv-org.github.io/epg/guides/sky.com/en.xml
virginmedia.com1https://iptv-org.github.io/epg/guides/virginmedia.com/en.xml
- -
-
- All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. ## Contribution diff --git a/tests/__data__/expected/_status.md b/tests/__data__/expected/_status.md deleted file mode 100644 index 25e8e613..00000000 --- a/tests/__data__/expected/_status.md +++ /dev/null @@ -1,11 +0,0 @@ -# Status - - - - - - - - - -
SiteStatus                                                   
example.comexample.com
diff --git a/tests/__data__/expected/api/guides.json b/tests/__data__/expected/api/guides.json index 35c8273d..a25bcba9 100644 --- a/tests/__data__/expected/api/guides.json +++ b/tests/__data__/expected/api/guides.json @@ -1 +1 @@ -[{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/dk_da.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"en","url":"https://iptv-org.github.io/epg/guides/allente.se/en.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/allente.se/da.xml"},{"channel":"ABCSpark.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"BBCEarthCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/virginmedia.com/en.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/sky.com/en.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CFMTDT.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"},{"channel":"CanalVie.ca","site":"tvhebdo.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/ca_en.xml"},{"channel":"beINSportsCanada.ca","site":"tvhebdo.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/ca_fr.xml"}] \ No newline at end of file +[{"channel":"6eren.dk","site":"allente.se","lang":"en","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/virginmedia.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"}] \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se/da.json b/tests/__data__/expected/guides/allente.se.json similarity index 100% rename from tests/__data__/expected/guides/allente.se/da.json rename to tests/__data__/expected/guides/allente.se.json diff --git a/tests/__data__/expected/guides/allente.se/da.xml b/tests/__data__/expected/guides/allente.se.xml similarity index 100% rename from tests/__data__/expected/guides/allente.se/da.xml rename to tests/__data__/expected/guides/allente.se.xml diff --git a/tests/__data__/expected/guides/allente.se/da.xml.gz b/tests/__data__/expected/guides/allente.se.xml.gz similarity index 100% rename from tests/__data__/expected/guides/allente.se/da.xml.gz rename to tests/__data__/expected/guides/allente.se.xml.gz diff --git a/tests/__data__/expected/guides/dk.json b/tests/__data__/expected/guides/dk.json deleted file mode 100644 index 37dcb8ba..00000000 --- a/tests/__data__/expected/guides/dk.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/dk.xml b/tests/__data__/expected/guides/dk.xml deleted file mode 100644 index 40e099ac..00000000 --- a/tests/__data__/expected/guides/dk.xml +++ /dev/null @@ -1,4 +0,0 @@ - -6'erenhttps://allente.se -Diners, Drive-Ins and DivesUnderholdningseries23.5.0/1S24E06 - \ No newline at end of file diff --git a/tests/__data__/expected/guides/dk.xml.gz b/tests/__data__/expected/guides/dk.xml.gz deleted file mode 100644 index fe964bfa63dab1f4fe64d2c1e55681ee6c931a8f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 452 zcmV;#0XzO5iwFP!000006K#@FZ`&Xc$KNOIJ0PU(Wiw#rIPHcVY04(;ZBp0g2$_>Z zYXjnl*X+{|wxms~@_;!0cPH-mM{OSFi7XJ&de_mK2}-~X-dHzw^!C^H>WY$0uhK${ zPS8;)q^yM$w14|X4SVezOvIXwwh+NFb5DC^EQU!RE2n4Z+xI$n{8CiKpDD@?-VuyL zNB1cO{LJ|wOkNxI+uqw5jMdD?k(Vfxh!1|Ay+hvew&CqNxh`FIQq(IJ+(>z^4sq(w z&Ga;ZOTZ8mFZYU{-dmm?q93E4XCRn#Opk*#q7iwK4`ruW^x;yIt0(Q$?b+zbrU}TT z3q7N0zqKy2{YbXaE>Qh&NVGF#n*&t*UvkC;I9!z6IsPa6xIy~|I=O1aL)|o@*aE?#H&D65Oz?;a=8oo%mzJGF u+RIOD#RRVvzsP&ND7!yI07v^9*?bf2ixU25Yw?(;rT+_$9H*q=0ssJ{Gv#am diff --git a/tests/__data__/expected/guides/sky.com.json b/tests/__data__/expected/guides/sky.com.json new file mode 100644 index 00000000..6aba8984 --- /dev/null +++ b/tests/__data__/expected/guides/sky.com.json @@ -0,0 +1 @@ +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"},{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"},{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com.xml b/tests/__data__/expected/guides/sky.com.xml new file mode 100644 index 00000000..454db214 --- /dev/null +++ b/tests/__data__/expected/guides/sky.com.xml @@ -0,0 +1,6 @@ + +BBC Newshttps://sky.com +CNNhttps://sky.com +BBC News at OneBBC News at OneThe latest national and international news from the BBC. [S,SL]Les dernières nouvelles nationales et internationales de la BBC. [S,SL] +French title + \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com.xml.gz b/tests/__data__/expected/guides/sky.com.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..d22558437ce33449d8affb5e622003a9c28b0b89 GIT binary patch literal 486 zcmVT1UC6kyqw3I@95W}09H;;Ma?D~5v$%xvBPUSRWAtk8Ft`e%r>6gd5 zAf@EG$m~ceZZW5E7{^f4*k21!{NXxp|P~%q(!v6K?AaDI&&IlpyGNDlIsRxom~B!&|Y_q=533_ zSg!57*CdKV_mMaLr7qd^=ec)hxg*=f=B=<2iR9isRCHcG;g)<-n88%AtgH2(>nb$m z8QtT~H(4~6C~n=&a7nnTh)@>wj3`f3>#il%)jMiNzCOHtxc}x>@Aww1e)v5aQn`Nd z@>9D|b;F2K`sm2$LbS^vQ;XyH9sSZ#X9V_*+p`rVJ6hrqchDT%#Y4|0gJHFS2&6C^ z)+}bR3l(yGvJFZeuac)S4K`002CKBb3evQSf^@U4)1*!|X^0SqQRL46W{3Z`-Sb^v cT6m}3pSvRyJo~rQ0d_2Y0Ydv0x$^@60P}tJ{r~^~ literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/guides/sky.com/en.json b/tests/__data__/expected/guides/sky.com/en.json deleted file mode 100644 index 03f35c39..00000000 --- a/tests/__data__/expected/guides/sky.com/en.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com/en.xml b/tests/__data__/expected/guides/sky.com/en.xml deleted file mode 100644 index 1eeac223..00000000 --- a/tests/__data__/expected/guides/sky.com/en.xml +++ /dev/null @@ -1,4 +0,0 @@ - -BBC Newshttps://sky.com -BBC News at OneThe latest national and international news from the BBC. [S,SL] - \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com/en.xml.gz b/tests/__data__/expected/guides/sky.com/en.xml.gz deleted file mode 100644 index c3f1f279c8c741a25937fd54480ba4bd02bfe2a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 377 zcmV-<0fzn`iwFP!000006J3!(Yuqpph3|py*ty6X|D!KE{zN$6)Nn-X(pfqUp*WAXUKzdv}d-5UHOza zCh(LpVj6*b56&kJr;0B@+b~a%vOh;l_;LUC{>#ryEa$x@l?m`N`SSU9I%?eWi8ZRC;~2)tl{Rt!qYA XH%;M>C$xn#rbG7^Z`vxII|2XzEoQvk diff --git a/tests/__data__/expected/guides/uk.json b/tests/__data__/expected/guides/virginmedia.com.json similarity index 100% rename from tests/__data__/expected/guides/uk.json rename to tests/__data__/expected/guides/virginmedia.com.json diff --git a/tests/__data__/expected/guides/uk.xml b/tests/__data__/expected/guides/virginmedia.com.xml similarity index 100% rename from tests/__data__/expected/guides/uk.xml rename to tests/__data__/expected/guides/virginmedia.com.xml diff --git a/tests/__data__/expected/guides/uk.xml.gz b/tests/__data__/expected/guides/virginmedia.com.xml.gz similarity index 100% rename from tests/__data__/expected/guides/uk.xml.gz rename to tests/__data__/expected/guides/virginmedia.com.xml.gz diff --git a/tests/__data__/expected/guides/virginmedia.com/en.json b/tests/__data__/expected/guides/virginmedia.com/en.json deleted file mode 100644 index 5ff6b490..00000000 --- a/tests/__data__/expected/guides/virginmedia.com/en.json +++ /dev/null @@ -1 +0,0 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com/en.xml b/tests/__data__/expected/guides/virginmedia.com/en.xml deleted file mode 100644 index 667c2f07..00000000 --- a/tests/__data__/expected/guides/virginmedia.com/en.xml +++ /dev/null @@ -1,4 +0,0 @@ - -BBC Newshttps://virginmedia.com -BBC News at OneThe latest national and international news, followed by weather.News96839999.145799123.0/1S96840000E145799124 - \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com/en.xml.gz b/tests/__data__/expected/guides/virginmedia.com/en.xml.gz deleted file mode 100644 index c41ccf960353939aeab81801ed1e97e94c23eb97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 378 zcmV-=0fqh_iwFP!000006K#>fZWJ*LhVMvy2P@aIlbPv4cTpylia>}1Akm(yFk@z; zCeA4F&ayl`3GJ?i3LkRtZ-23WtD9fm!HhB4K%Ho+S^!cX21{cn?(aUXHUe(6;u!|R z*on4o+oo=7p)X#kerJf#fgL(=d;9(i9#XY`6j}{7P0k!wWIXDuK#`REC#`HB2vY1j zv16XnJ1K2t{kV@+AH0m;et+6*K35ZsLTa^-PM^wV8%IkX2Wv{Hl0{VVd73iV6vG&e z_Xvqis2149E?VvOeuWzcK*8Jr6T9N@t=$ z6b4+;-a|SjM&F5iW1b%<3B7&0x!UHan)RFO?KZDm)v{4?(e-~spwve!AAZk_b@AxK YiLrjsFVFUuTS%VuAK6+uY-a)h0ARtfzyJUM diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index abebf1c4..a1fd872d 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -1,6 +1,5 @@ -{"groupedBy":"country","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk"} -{"groupedBy":"country","country":"UK","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"uk"} -{"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} -{"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} -{"groupedBy":"site+lang","lang":"fr","site":"sky.com","channel":"CNN.us","filename":"sky.com/fr"} -{"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} \ No newline at end of file +{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} +{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} +{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} +{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} +{"lang":"fr","site":"sky.com","channel":"CNN.us","filename":"sky.com"} \ No newline at end of file diff --git a/tests/__data__/input/database/update-guides/programs.db b/tests/__data__/input/database/update-guides/programs.db index e72a3252..0bedb48e 100644 --- a/tests/__data__/input/database/update-guides/programs.db +++ b/tests/__data__/input/database/update-guides/programs.db @@ -2,4 +2,5 @@ {"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[],"_qid":"f6cxTM73LfZ8TdYz","_id":"HxsrBRTFj1z05TAK"} {"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[],"_qid":"lNXh3lBnb4n1DBzs","_id":"quKCInjZV98xFUAf"} {"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[],"_qid":"36duI92slofEXlSa","_id":"ryzed0Bqda1QtE7i"} +{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[],"_qid":"32duI92slofEXlSa","_id":"r5zed0Bqda1QtE7i"} {"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[],"_qid":"37duI92slofEXlSa","_id":"rxzed0Bqda1QtE7i"} \ No newline at end of file diff --git a/tests/__data__/input/logs/guides/update.log b/tests/__data__/input/logs/guides/update.log index cde0637c..1e9a9cc3 100644 --- a/tests/__data__/input/logs/guides/update.log +++ b/tests/__data__/input/logs/guides/update.log @@ -1,12 +1,5 @@ -{"groupedBy":"country","country":"DK","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"dk_da"} -{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"ABCSpark.ca","filename":"ca_fr"} -{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"BBCEarthCanada.ca","filename":"ca_fr"} -{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"beINSportsCanada.ca","filename":"ca_fr"} -{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_fr"} -{"groupedBy":"country","country":"CA","lang":"fr","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_fr"} -{"groupedBy":"country","country":"CA","lang":"en","site":"tvhebdo.com","channel":"CanalVie.ca","filename":"ca_en"} -{"groupedBy":"country","country":"CA","lang":"en","site":"tvhebdo.com","channel":"CFMTDT.ca","filename":"ca_en"} -{"groupedBy":"site+lang","lang":"en","site":"allente.se","channel":"6eren.dk","filename":"allente.se/en"} -{"groupedBy":"site+lang","lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se/da"} -{"groupedBy":"site+lang","lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com/en"} -{"groupedBy":"site+lang","lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com/en"} +{"lang":"en","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} +{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} +{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} +{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} +{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} From 8d9e4133657f1ed53b3fa17ee9c6ecfc3240876c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:10 +0300 Subject: [PATCH 16/39] Update update.test.js --- tests/commands/guides/update.test.js | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/tests/commands/guides/update.test.js b/tests/commands/guides/update.test.js index f2dc8208..cd46b4e2 100644 --- a/tests/commands/guides/update.test.js +++ b/tests/commands/guides/update.test.js @@ -23,39 +23,20 @@ it('can generate /guides', () => { > NODE_OPTIONS=--max-old-space-size=5120 node scripts/commands/guides/update.js starting... -loading data/countries.json... loading data/channels.json... -loading data/regions.json... -loading data/subdivisions.json... loading database/programs.db... -found 5 programs -creating tests/__data__/output/guides/dk.xml... -creating tests/__data__/output/guides/dk.xml.gz... -creating tests/__data__/output/guides/dk.json... -creating tests/__data__/output/guides/uk.xml... -creating tests/__data__/output/guides/uk.xml.gz... -creating tests/__data__/output/guides/uk.json... -creating tests/__data__/output/guides/allente.se/da.xml... -creating tests/__data__/output/guides/allente.se/da.xml.gz... -creating tests/__data__/output/guides/allente.se/da.json... -creating tests/__data__/output/guides/virginmedia.com/en.xml... -creating tests/__data__/output/guides/virginmedia.com/en.xml.gz... -creating tests/__data__/output/guides/virginmedia.com/en.json... -creating tests/__data__/output/guides/sky.com/fr.xml... -creating tests/__data__/output/guides/sky.com/fr.xml.gz... -creating tests/__data__/output/guides/sky.com/fr.json... -creating tests/__data__/output/guides/sky.com/en.xml... -creating tests/__data__/output/guides/sky.com/en.xml.gz... -creating tests/__data__/output/guides/sky.com/en.json... +found 6 programs +creating tests/__data__/output/guides/allente.se.xml... +creating tests/__data__/output/guides/allente.se.xml.gz... +creating tests/__data__/output/guides/allente.se.json... +creating tests/__data__/output/guides/virginmedia.com.xml... +creating tests/__data__/output/guides/virginmedia.com.xml.gz... +creating tests/__data__/output/guides/virginmedia.com.json... +creating tests/__data__/output/guides/sky.com.xml... +creating tests/__data__/output/guides/sky.com.xml.gz... +creating tests/__data__/output/guides/sky.com.json... creating tests/__data__/output/logs/guides/update.log... - -report: -┌─────────┬────────────┬───────────┬──────┬──────────┬────────────────┬───────────┐ -│ (index) │ type │ site │ lang │ channel │ broadcast_area │ languages │ -├─────────┼────────────┼───────────┼──────┼──────────┼────────────────┼───────────┤ -│ 0 │ 'no_guide' │ 'sky.com' │ 'fr' │ 'CNN.us' │ [ 'c/US' ] │ [ 'eng' ] │ -└─────────┴────────────┴───────────┴──────┴──────────┴────────────────┴───────────┘ -found 1 error(s) +finished ` ) From 0890d1dabf83c0b0f5c833a78e28c5a713fa43a0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:17 +0300 Subject: [PATCH 17/39] Update update.js --- scripts/commands/guides/update.js | 199 ++++++------------------------ 1 file changed, 39 insertions(+), 160 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index c1f203c5..caea0871 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -1,7 +1,6 @@ const { db, api, logger, file, zip } = require('../../core') const { generateXMLTV, Program, Channel } = require('epg-grabber') const _ = require('lodash') -const langs = require('langs') const PUBLIC_DIR = process.env.PUBLIC_DIR || '.gh-pages' const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' @@ -9,7 +8,6 @@ const CURR_DATE = process.env.CURR_DATE || new Date() const logPath = `${LOGS_DIR}/guides/update.log` -let api_channels = [] let channels_dic = {} let db_programs = [] let guides = [] @@ -17,16 +15,10 @@ let guides = [] async function main() { logger.info(`starting...`) - logger.info('loading data/countries.json...') - await api.countries.load() logger.info('loading data/channels.json...') await api.channels.load() - logger.info('loading data/regions.json...') - await api.regions.load() - logger.info('loading data/subdivisions.json...') - await api.subdivisions.load() - api_channels = await api.channels.all() + let api_channels = await api.channels.all() api_channels.forEach(channel => { channels_dic[channel.id] = channel }) @@ -34,111 +26,37 @@ async function main() { logger.info('loading database/programs.db...') await db.programs.load() db_programs = await db.programs.find({}) - db_programs = db_programs - .map(p => { - if (p.titles.length) { - p.score = calcScore(p) - p.lang = p.titles[0].lang - - return p - } - return null - }) - .filter(Boolean) logger.info(`found ${db_programs.length} programs`) - await generateByCountry() - - await generateBySource() + await generate() logger.info(`creating ${logPath}...`) await file.create(logPath, guides.map(g => JSON.stringify(g)).join('\r\n')) - await makeReport() + logger.info('finished') } main() -async function generateBySource() { +async function generate() { let sites = _.groupBy(db_programs, 'site') for (let site in sites) { - let langs = _.groupBy(sites[site], p => p.titles[0].lang) - - for (let lang in langs) { - let programs = langs[lang] - let filename = `${site}/${lang}` - - let { channels } = await save(filename, programs) - - for (let channel of channels) { - guides.push({ - groupedBy: 'site+lang', - lang: channel.lang, - site: channel.site, - channel: channel.id, - filename - }) - } - } - } -} - -async function generateByCountry() { - let api_countries = await api.countries.all() - let api_regions = await api.regions.all() - let api_subdivisions = await api.subdivisions.all() - - for (let country of api_countries) { - let countryBroadcastCode = `c/${country.code}` - let countryRegions = api_regions - .filter(r => r.countries.includes(country.code)) - .map(r => `r/${r.code}`) - let countrySubdivisions = api_subdivisions - .filter(s => s.country === country.code) - .map(s => `s/${s.code}`) - let broadcastCodes = [countryBroadcastCode, ...countryRegions, ...countrySubdivisions] - - let countryChannels = api_channels.filter( - c => _.intersection(c.broadcast_area, broadcastCodes).length - ) - countryChannels = countryChannels.map(c => c.id) - - let countryPrograms = db_programs.filter(p => countryChannels.includes(p.channel)) - let langGroups = _.groupBy(countryPrograms, 'lang') - let countryLanguages = _.uniq([...country.languages, 'eng']) - let programs = {} - for (let langCode of countryLanguages) { - const lang = convertLangCode(langCode, '3', '1') - if (!lang) continue - - let langPrograms = langGroups[lang] - if (!langPrograms || !langPrograms.length) continue - - let channelGroups = _.groupBy(langPrograms, 'channel') - for (let channel in channelGroups) { - if (programs[channel]) continue - let groupedPrograms = channelGroups[channel] - let channelPrograms = getChannelPrograms(groupedPrograms) - if (!channelPrograms.length) continue - - programs[channel] = channelPrograms + for (let prog of sites[site]) { + let key = prog.channel + prog.start + if (!programs[key]) { + programs[key] = prog + } else { + programs[key] = merge(programs[key], prog) } } - programs = _.flatten(Object.values(programs)) - - if (!programs.length) continue - - const filename = country.code.toLowerCase() - - let { channels } = await save(filename, programs) + let filename = `${site}` + let { channels } = await save(filename, Object.values(programs)) for (let channel of channels) { guides.push({ - groupedBy: 'country', - country: country.code, lang: channel.lang, site: channel.site, channel: channel.id, @@ -148,15 +66,34 @@ async function generateByCountry() { } } -async function save(filepath, programs) { - let channels = programs.map(p => { - let c = channels_dic[p.channel] - c.site = p.site - c.lang = p.lang +function merge(p1, p2) { + for (let prop in p1) { + if (Array.isArray(p1[prop])) { + p1[prop] = _.orderBy( + _.uniqWith(p1[prop].concat(p2[prop]), _.isEqual), + v => (v.lang === 'en' ? Infinity : 1), + 'desc' + ) + } + } - return new Channel(c) + return p1 +} + +async function save(filepath, programs) { + let all_channels = {} + programs.forEach(p => { + p.titles.forEach(t => { + let c = channels_dic[p.channel] + c.site = p.site + c.lang = t.lang + if (!all_channels[p.channel + t.lang]) { + all_channels[p.channel + t.lang] = new Channel(c) + } + }) }) - channels = _.sortBy(channels, 'id') + + let channels = _.sortBy(Object.values(all_channels), 'id') channels = _.uniqBy(channels, 'id') programs = _.sortBy(programs, ['channel', 'start']) @@ -180,65 +117,7 @@ async function save(filepath, programs) { await file.create(jsonFilepath, JSON.stringify({ channels, programs })) return { - channels, + channels: Object.values(all_channels), programs } } - -function convertLangCode(code, from, to) { - let found = langs.where(from, code) - - return found ? found[to] : null -} - -function getChannelPrograms(programs) { - let sites = _.groupBy(programs, 'site') - - let topScore = 0 - let selected - for (let site in sites) { - let sitePrograms = sites[site] - let siteScore = _.sumBy(sitePrograms, 'score') - - if (siteScore > topScore) { - selected = site - topScore = siteScore - } - } - - return sites[selected] || [] -} - -function calcScore(program) { - let score = 0 - let values = Object.values(program) - for (let value of values) { - if (Array.isArray(value) && value.length) { - score++ - } else if (typeof value === 'string' && value) { - score++ - } else if (value && typeof value === 'object' && Object.values(value).map(Boolean).length) { - score++ - } - } - - return score -} - -async function makeReport() { - const errors = [] - - let countryGuides = guides.filter(g => g.groupedBy === 'country') - let programs = _.uniqBy(db_programs, p => p.site + p.channel) - for (let program of programs) { - if (!countryGuides.find(g => g.channel === program.channel)) { - const channel = await api.channels.find({ id: program.channel }) - errors.push({ type: 'no_guide', ...program, ...channel }) - } - } - - console.log() - logger.info(`report:`) - console.table(errors, ['type', 'site', 'lang', 'channel', 'broadcast_area', 'languages']) - logger.error(`found ${errors.length} error(s)`) -} From 2233601d64c3b484916172f904389a7888aab741 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:37 +0300 Subject: [PATCH 18/39] Update update.js --- scripts/commands/readme/update.js | 85 +++++++------------------------ 1 file changed, 17 insertions(+), 68 deletions(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index b327325a..3b049bc5 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -14,31 +14,28 @@ async function main() { const logPath = `${LOGS_DIR}/guides/update.log` let log = await parser.parseLogs(logPath) - await createCountriesTable(log) - await createSourcesTable(log) + await createTable(log) await updateReadme() } main() -async function createSourcesTable(log) { - let files = log - .filter(c => c.groupedBy === 'site+lang') - .reduce((acc, curr) => { - if (!acc[curr.filename]) { - acc[curr.filename] = { - site: curr.site, - lang: curr.lang, - channels: 0, - filename: curr.filename - } +async function createTable(log) { + let files = _.uniqBy(log, i => i.site + i.channel).reduce((acc, curr) => { + if (!acc[curr.filename]) { + acc[curr.filename] = { + site: curr.site, + lang: curr.lang, + channels: 0, + filename: curr.filename } + } - acc[curr.filename].channels++ + acc[curr.filename].channels++ - return acc - }, {}) + return acc + }, {}) let data = [] for (const filename in files) { @@ -48,7 +45,8 @@ async function createSourcesTable(log) { item.site, item.lang, item.channels, - `https://iptv-org.github.io/epg/guides/${filename}.xml` + `https://iptv-org.github.io/epg/guides/${filename}.xml`, + `${filename}` ]) } @@ -63,58 +61,9 @@ async function createSourcesTable(log) { }) data = Object.values(_.groupBy(data, item => item[0])) - const output = table.create(data, ['Site', 'Channels', 'EPG']) + const output = table.create(data, ['Site', 'Channels', 'EPG', 'Status']) - await file.create('./.readme/_sources.md', output) -} - -async function createCountriesTable(log) { - let files = log - .filter(c => c.groupedBy === 'country') - .reduce((acc, curr) => { - if (!acc[curr.filename]) { - acc[curr.filename] = { - country: curr.country, - lang: curr.lang, - channels: 0, - filename: curr.filename - } - } - - acc[curr.filename].channels++ - - return acc - }, {}) - - let data = [] - for (const filename in files) { - const item = files[filename] - const country = api.countries.find({ code: item.country }) - if (!country) continue - - data.push([ - country.name, - item.lang, - `${country.flag} ${country.name}`, - item.channels, - `https://iptv-org.github.io/epg/guides/${filename}.xml` - ]) - } - - data = _.orderBy( - data, - [item => item[0], item => (item[1] === 'en' ? Infinity : item[3])], - ['asc', 'desc'] - ) - data = data.map(i => { - i.splice(0, 2) - return i - }) - data = Object.values(_.groupBy(data, item => item[0])) - - const output = table.create(data, ['Country', 'Channels', 'EPG']) - - await file.create('./.readme/_countries.md', output) + await file.create('./.readme/_sites.md', output) } async function updateReadme() { From c75b92394684cbf79c22b27f9aed9fe47cf787c9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:40 +0300 Subject: [PATCH 19/39] Update readme.md --- .readme/readme.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/.readme/readme.md b/.readme/readme.md index 6b49aa10..216839c7 100644 --- a/.readme/readme.md +++ b/.readme/readme.md @@ -10,28 +10,8 @@ To load a program guide, all you need to do is copy the link to one or more of t ## Guides -### Grouped by country - -
-Expand -
- -#include "./.readme/_countries.md" - -
- -### Grouped by source - -
-Expand -
- - -#include "./.readme/_sources.md" - -
-
+#include "./.readme/_sites.md" All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. From 926d874b6fec5f5601735b345d6c606caa860839 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:44 +0300 Subject: [PATCH 20/39] Delete status.json --- .readme/status.json | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .readme/status.json diff --git a/.readme/status.json b/.readme/status.json deleted file mode 100644 index 1505b3a8..00000000 --- a/.readme/status.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "build": "STATUS.md", - "files": ["./.readme/status.md"] -} \ No newline at end of file From 9458e46978959a9be1b3efdb0adb54e9524eca08 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:46 +0300 Subject: [PATCH 21/39] Delete status.md --- .readme/status.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .readme/status.md diff --git a/.readme/status.md b/.readme/status.md deleted file mode 100644 index 3ee20ea5..00000000 --- a/.readme/status.md +++ /dev/null @@ -1,4 +0,0 @@ -# Status - - -#include "./.readme/_sites.md" From 7ff62795eabaa3840c8a6ab77cc8ec8334a74c63 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:52 +0300 Subject: [PATCH 22/39] Delete update.test.js --- tests/commands/status/update.test.js | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 tests/commands/status/update.test.js diff --git a/tests/commands/status/update.test.js b/tests/commands/status/update.test.js deleted file mode 100644 index 568869b8..00000000 --- a/tests/commands/status/update.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const { execSync } = require('child_process') -const fs = require('fs-extra') -const path = require('path') - -beforeEach(() => { - fs.emptyDirSync('tests/__data__/output') - - const stdout = execSync( - 'CONFIGS_PATH=tests/__data__/input/sites/example.com.config.js DATA_DIR=tests/__data__/input/data npm run status:update -- --config=tests/__data__/input/status.json', - { encoding: 'utf8' } - ) -}) - -it('can update status.md', () => { - expect(content('tests/__data__/output/status.md')).toBe( - content('tests/__data__/expected/_status.md') - ) -}) - -function content(filepath) { - const data = fs.readFileSync(path.resolve(filepath), { - encoding: 'utf8' - }) - - return JSON.stringify(data) -} From 71fe14643f974823a8e7ac2d4f3e9d04d44a3b19 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:45:54 +0300 Subject: [PATCH 23/39] Delete update.js --- scripts/commands/status/update.js | 52 ------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 scripts/commands/status/update.js diff --git a/scripts/commands/status/update.js b/scripts/commands/status/update.js deleted file mode 100644 index b7db23d5..00000000 --- a/scripts/commands/status/update.js +++ /dev/null @@ -1,52 +0,0 @@ -const { file, markdown, logger, table } = require('../../core') -const { program } = require('commander') -const _ = require('lodash') - -const CONFIGS_PATH = process.env.CONFIGS_PATH || 'sites/**/*.config.js' - -const options = program - .option('-c, --config ', 'Set path to config file', '.readme/status.json') - .parse(process.argv) - .opts() - -async function main() { - let data = [] - - const files = await file.list(CONFIGS_PATH).catch(console.error) - for (const filepath of files) { - try { - const { site, skip } = require(file.resolve(filepath)) - - if (skip) continue - - data.push([ - site, - `${site}` - ]) - } catch (err) { - console.error(err) - continue - } - } - - data = Object.values(_.groupBy(data, item => item[0])) - - const output = table.create(data, [ - 'Site', - 'Status                                                   ' - ]) - - await file.create('./.readme/_sites.md', output) - - await updateMarkdown() -} - -main() - -async function updateMarkdown() { - logger.info('updating status.md...') - - const config = require(file.resolve(options.config)) - await file.createDir(file.dirname(config.build)) - await markdown.compile(options.config) -} From 8a312b72360d87e3f1a0b8f46e6968edfd33ea03 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:49:48 +0300 Subject: [PATCH 24/39] Update package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index f54438de..87c21c12 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "api:load": "./scripts/commands/api/load.sh", "api:update": "node scripts/commands/api/update.js", "readme:update": "node scripts/commands/readme/update.js", - "status:update": "node scripts/commands/status/update.js", "lint": "npx eslint ./scripts/**/*.js", "test": "TZ=Pacific/Nauru npx jest --runInBand", "test:commands": "npx jest --runInBand -- commands", From bf17ec6b8e160e8df9e7a65e001a8f3c78f57f7a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 10:49:50 +0300 Subject: [PATCH 25/39] Update _update.yml --- .github/workflows/_update.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/_update.yml b/.github/workflows/_update.yml index 190b532b..1ae0cf67 100644 --- a/.github/workflows/_update.yml +++ b/.github/workflows/_update.yml @@ -39,14 +39,11 @@ jobs: path: scripts/logs - run: npm run api:update - run: npm run readme:update - - run: npm run status:update - name: Commit Changes if: ${{ !env.ACT }} run: | git add README.md git commit --allow-empty -m "[Bot] Update README.md" - git add STATUS.md - git commit --allow-empty -m "[Bot] Update STATUS.md" git status - name: Push to origin if: ${{ !env.ACT }} From 344effdcab9c98aa47911ce734be470811729fd9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 11:04:01 +0300 Subject: [PATCH 26/39] Delete STATUS.md --- STATUS.md | 150 ------------------------------------------------------ 1 file changed, 150 deletions(-) delete mode 100644 STATUS.md diff --git a/STATUS.md b/STATUS.md deleted file mode 100644 index 7eb2a76a..00000000 --- a/STATUS.md +++ /dev/null @@ -1,150 +0,0 @@ -# Status - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SiteStatus                                                   
9tv.co.il9tv.co.il
abc.net.auabc.net.au
allente.seallente.se
andorradifusio.adandorradifusio.ad
arianaafgtv.comarianaafgtv.com
arianatelevision.comarianatelevision.com
artonline.tvartonline.tv
astro.com.myastro.com.my
bein.combein.com
beinsports.combeinsports.com
bt.combt.com
cablego.com.pecablego.com.pe
canalplus-afrique.comcanalplus-afrique.com
canalplus-caraibes.comcanalplus-caraibes.com
canalplus-haiti.comcanalplus-haiti.com
canalplus-reunion.comcanalplus-reunion.com
canalplus.comcanalplus.com
cgates.ltcgates.lt
chaines-tv.orange.frchaines-tv.orange.fr
clickthecity.comclickthecity.com
compulms.comcompulms.com
comteco.com.bocomteco.com.bo
cosmote.grcosmote.gr
delta.nldelta.nl
digiturk.com.trdigiturk.com.tr
directv.com.ardirectv.com.ar
directv.com.uydirectv.com.uy
directv.comdirectv.com
dishtv.indishtv.in
dsmart.com.trdsmart.com.tr
dstv.comdstv.com
elcinema.comelcinema.com
epg.i-cable.comepg.i-cable.com
foxsports.com.aufoxsports.com.au
frikanalen.nofrikanalen.no
gatotv.comgatotv.com
getafteritmedia.comgetafteritmedia.com
guidatv.sky.itguidatv.sky.it
guide.dstv.comguide.dstv.com
hd-plus.dehd-plus.de
horizon.tvhorizon.tv
i.mjh.nzi.mjh.nz
i24news.tvi24news.tv
ionplustv.comionplustv.com
ipko.comipko.com
knr.glknr.gl
kvf.fokvf.fo
m.tv.sms.czm.tv.sms.cz
magentatv.atmagentatv.at
magticom.gemagticom.ge
mako.co.ilmako.co.il
maxtv.hrvatskitelekom.hrmaxtv.hrvatskitelekom.hr
maxtvgo.mkmaxtvgo.mk
mediaklikk.humediaklikk.hu
mediaset.itmediaset.it
melita.commelita.com
meo.ptmeo.pt
mewatch.sgmewatch.sg
mi.tvmi.tv
mncvision.idmncvision.id
movistarplus.esmovistarplus.es
mtel.bamtel.ba
mts.rsmts.rs
mujtvprogram.czmujtvprogram.cz
musor.tvmusor.tv
myafn.dodmedia.osd.milmyafn.dodmedia.osd.mil
mysky.com.phmysky.com.ph
mytvsuper.commytvsuper.com
novacyprus.comnovacyprus.com
novasports.grnovasports.gr
nowplayer.now.comnowplayer.now.com
ontvtonight.comontvtonight.com
osn.comosn.com
pbsguam.orgpbsguam.org
plex.tvplex.tv
programacion-tv.elpais.comprogramacion-tv.elpais.com
programetv.roprogrametv.ro
programme-tv.netprogramme-tv.net
programme-tv.vini.pfprogramme-tv.vini.pf
programme.tvb.comprogramme.tvb.com
programtv.onet.plprogramtv.onet.pl
raiplay.itraiplay.it
reportv.com.arreportv.com.ar
rev.bsrev.bs
rthk.hkrthk.hk
rtmklik.rtm.gov.myrtmklik.rtm.gov.my
rtp.ptrtp.pt
ruv.isruv.is
seezntv.comseezntv.com
siba.com.cosiba.com.co
sjonvarp.issjonvarp.is
sky.comsky.com
sportsnet.casportsnet.ca
starhubtvplus.comstarhubtvplus.com
startimestv.comstartimestv.com
tapdmv.comtapdmv.com
telecablesat.frtelecablesat.fr
telenet.tvtelenet.tv
teliatv.eeteliatv.ee
telkku.comtelkku.com
telkussa.fitelkussa.fi
telsu.fitelsu.fi
tivu.tvtivu.tv
toonamiaftermath.comtoonamiaftermath.com
transvision.co.idtransvision.co.id
tv.blue.chtv.blue.ch
tv.cctv.comtv.cctv.com
tv.dir.bgtv.dir.bg
tv.lvtv.lv
tv.mail.rutv.mail.ru
tv.movistar.com.petv.movistar.com.pe
tv.nutv.nu
tv.trueid.nettv.trueid.net
tv.yandex.rutv.yandex.ru
tv.yettel.hutv.yettel.hu
tv24.co.uktv24.co.uk
tv24.setv24.se
tv2go.t-2.nettv2go.t-2.net
tva.tvtva.tv
tvarenasport.comtvarenasport.com
tvcubana.icrt.cutvcubana.icrt.cu
tvgids.nltvgids.nl
tvguide.comtvguide.com
tvguide.myjcom.jptvguide.myjcom.jp
tvhebdo.comtvhebdo.com
tvheute.attvheute.at
tvim.tvtvim.tv
tvmi.mttvmi.mt
tvmusor.hutvmusor.hu
tvpassport.comtvpassport.com
tvplus.com.trtvplus.com.tr
useetv.comuseetv.com
vidio.comvidio.com
virginmedia.comvirginmedia.com
vtm.bevtm.be
watchyour.tvwatchyour.tv
wavve.comwavve.com
xumo.tvxumo.tv
ziggogo.tvziggogo.tv
znbc.co.zmznbc.co.zm
From b47c6ff01054427998edc5b117db23ba469dcc59 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 11:07:31 +0300 Subject: [PATCH 27/39] Update _readme.md --- tests/__data__/expected/_readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index d16e056c..4a0ea3ff 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -13,7 +13,7 @@ To load a program guide, all you need to do is copy the link to one or more of t - + From aef3eed09e5d6535e6a32f9e23dafb824cb8811e Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 9 Jan 2023 11:07:34 +0300 Subject: [PATCH 28/39] Update update.js --- scripts/commands/readme/update.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index 3b049bc5..59388b60 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -61,7 +61,12 @@ async function createTable(log) { }) data = Object.values(_.groupBy(data, item => item[0])) - const output = table.create(data, ['Site', 'Channels', 'EPG', 'Status']) + const output = table.create(data, [ + 'Site', + 'Channels', + 'EPG', + 'Status                                                   ' + ]) await file.create('./.readme/_sites.md', output) } From 7388956d276a0a99cb961227aed79304010d11a8 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:37:31 +0300 Subject: [PATCH 29/39] Update tests/__data__ --- tests/__data__/expected/_readme.md | 33 +++++++++++++++--- tests/__data__/expected/api/guides.json | 2 +- .../expected/guides/{ => da}/allente.se.json | 2 +- .../expected/guides/{ => da}/allente.se.xml | 0 .../guides/{ => da}/allente.se.xml.gz | Bin .../__data__/expected/guides/en/sky.com.json | 1 + tests/__data__/expected/guides/en/sky.com.xml | 4 +++ .../expected/guides/en/sky.com.xml.gz | Bin 0 -> 377 bytes .../guides/{ => en}/virginmedia.com.json | 2 +- .../guides/{ => en}/virginmedia.com.xml | 0 .../guides/{ => en}/virginmedia.com.xml.gz | Bin .../expected/guides/{ => fr}/sky.com.json | 2 +- .../expected/guides/{ => fr}/sky.com.xml | 2 +- .../expected/guides/fr/sky.com.xml.gz | Bin 0 -> 452 bytes tests/__data__/expected/guides/sky.com.xml.gz | Bin 486 -> 0 bytes .../__data__/expected/logs/guides/update.log | 10 +++--- tests/__data__/input/logs/guides/update.log | 10 +++--- .../input/sites/example.com.config.js | 1 + 18 files changed, 50 insertions(+), 19 deletions(-) rename tests/__data__/expected/guides/{ => da}/allente.se.json (97%) rename tests/__data__/expected/guides/{ => da}/allente.se.xml (100%) rename tests/__data__/expected/guides/{ => da}/allente.se.xml.gz (100%) create mode 100644 tests/__data__/expected/guides/en/sky.com.json create mode 100644 tests/__data__/expected/guides/en/sky.com.xml create mode 100644 tests/__data__/expected/guides/en/sky.com.xml.gz rename tests/__data__/expected/guides/{ => en}/virginmedia.com.json (92%) rename tests/__data__/expected/guides/{ => en}/virginmedia.com.xml (100%) rename tests/__data__/expected/guides/{ => en}/virginmedia.com.xml.gz (100%) rename tests/__data__/expected/guides/{ => fr}/sky.com.json (79%) rename tests/__data__/expected/guides/{ => fr}/sky.com.xml (56%) create mode 100644 tests/__data__/expected/guides/fr/sky.com.xml.gz delete mode 100644 tests/__data__/expected/guides/sky.com.xml.gz diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index 4a0ea3ff..a0e36cfc 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -10,19 +10,44 @@ To load a program guide, all you need to do is copy the link to one or more of t ## Guides +All guides also have a compressed and JSON version. To load them just change the extension from `.xml` to `.xml.gz` or `.json` respectively. + +### Danish +
SiteChannelsEPGStatus
SiteChannelsEPGStatus                                                   
allente.se1https://iptv-org.github.io/epg/guides/allente.se.xmlallente.se
- - - +
SiteChannelsEPGStatus                                                   
allente.se1https://iptv-org.github.io/epg/guides/allente.se.xmlallente.se
sky.com1https://iptv-org.github.io/epg/guides/sky.com.xmlsky.com
virginmedia.com1https://iptv-org.github.io/epg/guides/virginmedia.com.xmlvirginmedia.com
allente.se1https://iptv-org.github.io/epg/guides/da/allente.se.xmlallente.se
-All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. +### English + + + + + + + + + +
SiteChannelsEPGStatus                                                   
sky.com1https://iptv-org.github.io/epg/guides/en/sky.com.xmlsky.com
virginmedia.com1https://iptv-org.github.io/epg/guides/en/virginmedia.com.xmlvirginmedia.com
+ +### French + + + + + + + + +
SiteChannelsEPGStatus                                                   
sky.com2https://iptv-org.github.io/epg/guides/fr/sky.com.xmlsky.com
+ + ## Contribution diff --git a/tests/__data__/expected/api/guides.json b/tests/__data__/expected/api/guides.json index a25bcba9..458eaf5e 100644 --- a/tests/__data__/expected/api/guides.json +++ b/tests/__data__/expected/api/guides.json @@ -1 +1 @@ -[{"channel":"6eren.dk","site":"allente.se","lang":"en","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"6eren.dk","site":"allente.se","lang":"da","url":"https://iptv-org.github.io/epg/guides/allente.se.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/virginmedia.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"fr","url":"https://iptv-org.github.io/epg/guides/sky.com.xml"}] \ No newline at end of file +[{"channel":"6eren.dk","site":"allente.se","lang":"da","days":2,"url":"https://iptv-org.github.io/epg/guides/da/allente.se.xml"},{"channel":"BBCNews.uk","site":"virginmedia.com","lang":"en","days":2,"url":"https://iptv-org.github.io/epg/guides/en/virginmedia.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"fr","days":2,"url":"https://iptv-org.github.io/epg/guides/fr/sky.com.xml"},{"channel":"BBCNews.uk","site":"sky.com","lang":"en","days":2,"url":"https://iptv-org.github.io/epg/guides/en/sky.com.xml"},{"channel":"CNN.us","site":"sky.com","lang":"fr","days":2,"url":"https://iptv-org.github.io/epg/guides/fr/sky.com.xml"}] \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se.json b/tests/__data__/expected/guides/da/allente.se.json similarity index 97% rename from tests/__data__/expected/guides/allente.se.json rename to tests/__data__/expected/guides/da/allente.se.json index 37dcb8ba..1b04e3f4 100644 --- a/tests/__data__/expected/guides/allente.se.json +++ b/tests/__data__/expected/guides/da/allente.se.json @@ -1 +1 @@ -{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/allente.se.xml b/tests/__data__/expected/guides/da/allente.se.xml similarity index 100% rename from tests/__data__/expected/guides/allente.se.xml rename to tests/__data__/expected/guides/da/allente.se.xml diff --git a/tests/__data__/expected/guides/allente.se.xml.gz b/tests/__data__/expected/guides/da/allente.se.xml.gz similarity index 100% rename from tests/__data__/expected/guides/allente.se.xml.gz rename to tests/__data__/expected/guides/da/allente.se.xml.gz diff --git a/tests/__data__/expected/guides/en/sky.com.json b/tests/__data__/expected/guides/en/sky.com.json new file mode 100644 index 00000000..4a49b379 --- /dev/null +++ b/tests/__data__/expected/guides/en/sky.com.json @@ -0,0 +1 @@ +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/en/sky.com.xml b/tests/__data__/expected/guides/en/sky.com.xml new file mode 100644 index 00000000..1eeac223 --- /dev/null +++ b/tests/__data__/expected/guides/en/sky.com.xml @@ -0,0 +1,4 @@ + +BBC Newshttps://sky.com +BBC News at OneThe latest national and international news from the BBC. [S,SL] + \ No newline at end of file diff --git a/tests/__data__/expected/guides/en/sky.com.xml.gz b/tests/__data__/expected/guides/en/sky.com.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3f1f279c8c741a25937fd54480ba4bd02bfe2a4 GIT binary patch literal 377 zcmV-<0fzn`iwFP!000006J3!(Yuqpph3|py*ty6X|D!KE{zN$6)Nn-X(pfqUp*WAXUKzdv}d-5UHOza zCh(LpVj6*b56&kJr;0B@+b~a%vOh;l_;LUC{>#ryEa$x@l?m`N`SSU9I%?eWi8ZRC;~2)tl{Rt!qYA XH%;M>C$xn#rbG7^Z`vxII|2XzEoQvk literal 0 HcmV?d00001 diff --git a/tests/__data__/expected/guides/virginmedia.com.json b/tests/__data__/expected/guides/en/virginmedia.com.json similarity index 92% rename from tests/__data__/expected/guides/virginmedia.com.json rename to tests/__data__/expected/guides/en/virginmedia.com.json index 5ff6b490..85e4504f 100644 --- a/tests/__data__/expected/guides/virginmedia.com.json +++ b/tests/__data__/expected/guides/en/virginmedia.com.json @@ -1 +1 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/virginmedia.com.xml b/tests/__data__/expected/guides/en/virginmedia.com.xml similarity index 100% rename from tests/__data__/expected/guides/virginmedia.com.xml rename to tests/__data__/expected/guides/en/virginmedia.com.xml diff --git a/tests/__data__/expected/guides/virginmedia.com.xml.gz b/tests/__data__/expected/guides/en/virginmedia.com.xml.gz similarity index 100% rename from tests/__data__/expected/guides/virginmedia.com.xml.gz rename to tests/__data__/expected/guides/en/virginmedia.com.xml.gz diff --git a/tests/__data__/expected/guides/sky.com.json b/tests/__data__/expected/guides/fr/sky.com.json similarity index 79% rename from tests/__data__/expected/guides/sky.com.json rename to tests/__data__/expected/guides/fr/sky.com.json index 6aba8984..e6e8888e 100644 --- a/tests/__data__/expected/guides/sky.com.json +++ b/tests/__data__/expected/guides/fr/sky.com.json @@ -1 +1 @@ -{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"},{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"},{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}]} \ No newline at end of file +{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"fr","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"} \ No newline at end of file diff --git a/tests/__data__/expected/guides/sky.com.xml b/tests/__data__/expected/guides/fr/sky.com.xml similarity index 56% rename from tests/__data__/expected/guides/sky.com.xml rename to tests/__data__/expected/guides/fr/sky.com.xml index 454db214..d04dc456 100644 --- a/tests/__data__/expected/guides/sky.com.xml +++ b/tests/__data__/expected/guides/fr/sky.com.xml @@ -1,6 +1,6 @@ BBC Newshttps://sky.com CNNhttps://sky.com -BBC News at OneBBC News at OneThe latest national and international news from the BBC. [S,SL]Les dernières nouvelles nationales et internationales de la BBC. [S,SL] +BBC News at OneLes dernières nouvelles nationales et internationales de la BBC. [S,SL] French title \ No newline at end of file diff --git a/tests/__data__/expected/guides/fr/sky.com.xml.gz b/tests/__data__/expected/guides/fr/sky.com.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..ededb1dd6cb1c3c90c14c7bd283f8861a388c3af GIT binary patch literal 452 zcmV;#0XzO5iwFP!000006RnfMirX*{hVO;GgV43L#&(lfTVyZn!cxkT7PdW=9<=hr z5s_sh$xgRV)c4pIs~i$Hn@cIw2Q&Qhqxt=5EUtgFhK%UE?rcdjmQsRNb+xulNxy!% zOE@Lhl?WrLWx$f=X`W|kp3>^|E1|a1S~Nu0CB3=1UE|)fVMi-bYu_9Blvvqf6+2{V z33wq3tvXA*QzhMo(EIlQn(4L~98+Bj?(@$NoPT7!Z75V?aHcxh{O)P82$)0x#}t== zZr5uz_{%U+{dV?n-gS+WZHvSQ z>B7vl$nrEkTp zI;)?5xmen67}1!ik|Az}oJtHt+Yn8EqT1UC6kyqw3I@95W}09H;;Ma?D~5v$%xvBPUSRWAtk8Ft`e%r>6gd5 zAf@EG$m~ceZZW5E7{^f4*k21!{NXxp|P~%q(!v6K?AaDI&&IlpyGNDlIsRxom~B!&|Y_q=533_ zSg!57*CdKV_mMaLr7qd^=ec)hxg*=f=B=<2iR9isRCHcG;g)<-n88%AtgH2(>nb$m z8QtT~H(4~6C~n=&a7nnTh)@>wj3`f3>#il%)jMiNzCOHtxc}x>@Aww1e)v5aQn`Nd z@>9D|b;F2K`sm2$LbS^vQ;XyH9sSZ#X9V_*+p`rVJ6hrqchDT%#Y4|0gJHFS2&6C^ z)+}bR3l(yGvJFZeuac)S4K`002CKBb3evQSf^@U4)1*!|X^0SqQRL46W{3Z`-Sb^v cT6m}3pSvRyJo~rQ0d_2Y0Ydv0x$^@60P}tJ{r~^~ diff --git a/tests/__data__/expected/logs/guides/update.log b/tests/__data__/expected/logs/guides/update.log index a1fd872d..bf20652e 100644 --- a/tests/__data__/expected/logs/guides/update.log +++ b/tests/__data__/expected/logs/guides/update.log @@ -1,5 +1,5 @@ -{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} -{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"CNN.us","filename":"sky.com"} \ No newline at end of file +{"site":"allente.se","lang":"da","days":2,"channel":"6eren.dk","filename":"da/allente.se"} +{"site":"virginmedia.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/virginmedia.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"BBCNews.uk","filename":"fr/sky.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"CNN.us","filename":"fr/sky.com"} +{"site":"sky.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/sky.com"} \ No newline at end of file diff --git a/tests/__data__/input/logs/guides/update.log b/tests/__data__/input/logs/guides/update.log index 1e9a9cc3..bf20652e 100644 --- a/tests/__data__/input/logs/guides/update.log +++ b/tests/__data__/input/logs/guides/update.log @@ -1,5 +1,5 @@ -{"lang":"en","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"da","site":"allente.se","channel":"6eren.dk","filename":"allente.se"} -{"lang":"en","site":"virginmedia.com","channel":"BBCNews.uk","filename":"virginmedia.com"} -{"lang":"en","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} -{"lang":"fr","site":"sky.com","channel":"BBCNews.uk","filename":"sky.com"} +{"site":"allente.se","lang":"da","days":2,"channel":"6eren.dk","filename":"da/allente.se"} +{"site":"virginmedia.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/virginmedia.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"BBCNews.uk","filename":"fr/sky.com"} +{"site":"sky.com","lang":"fr","days":2,"channel":"CNN.us","filename":"fr/sky.com"} +{"site":"sky.com","lang":"en","days":2,"channel":"BBCNews.uk","filename":"en/sky.com"} \ No newline at end of file diff --git a/tests/__data__/input/sites/example.com.config.js b/tests/__data__/input/sites/example.com.config.js index 20384029..e420f308 100644 --- a/tests/__data__/input/sites/example.com.config.js +++ b/tests/__data__/input/sites/example.com.config.js @@ -1,5 +1,6 @@ module.exports = { site: 'example.com', + days: 2, url() { return `https://example.com` }, From 6dea9e4efdd69b33556f9054a7a5e0a3964e6ef4 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:38:07 +0300 Subject: [PATCH 30/39] Upgrade epg-grabber package --- package-lock.json | 14 +++++++------- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71f1182d..96145b04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "commander": "^8.2.0", "csv-parser": "^3.0.0", "dayjs": "^1.10.8", - "epg-grabber": "^0.29.5", + "epg-grabber": "^0.29.7", "epg-parser": "^0.2.0", "form-data": "^4.0.0", "fs-extra": "^10.0.1", @@ -2436,9 +2436,9 @@ } }, "node_modules/epg-grabber": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.5.tgz", - "integrity": "sha512-HJvziMNM7YDcJnfkIxWm5ulg76T5eH44mxsLL579dfold//QYZgaCKWMQKPNoGVuCW5SMIY7g90d08VC2rZe6w==", + "version": "0.29.7", + "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.7.tgz", + "integrity": "sha512-wvjevMnrJD/fr4TaJ0Wh4Y2Kyy0LLQtp+bOEsHFCsF8oe53jUnThOlUYsAT49Sx5v7A6K9GheGxDAXOpLXV67A==", "dependencies": { "axios": "^0.21.1", "axios-cache-interceptor": "^0.10.3", @@ -8213,9 +8213,9 @@ "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==" }, "epg-grabber": { - "version": "0.29.5", - "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.5.tgz", - "integrity": "sha512-HJvziMNM7YDcJnfkIxWm5ulg76T5eH44mxsLL579dfold//QYZgaCKWMQKPNoGVuCW5SMIY7g90d08VC2rZe6w==", + "version": "0.29.7", + "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.7.tgz", + "integrity": "sha512-wvjevMnrJD/fr4TaJ0Wh4Y2Kyy0LLQtp+bOEsHFCsF8oe53jUnThOlUYsAT49Sx5v7A6K9GheGxDAXOpLXV67A==", "requires": { "axios": "^0.21.1", "axios-cache-interceptor": "^0.10.3", diff --git a/package.json b/package.json index 87c21c12..c5883adb 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "commander": "^8.2.0", "csv-parser": "^3.0.0", "dayjs": "^1.10.8", - "epg-grabber": "^0.29.5", + "epg-grabber": "^0.29.7", "epg-parser": "^0.2.0", "form-data": "^4.0.0", "fs-extra": "^10.0.1", diff --git a/yarn.lock b/yarn.lock index 596f336d..b9ff04ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1631,10 +1631,10 @@ "resolved" "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz" "version" "4.4.0" -"epg-grabber@^0.29.5": - "integrity" "sha512-HJvziMNM7YDcJnfkIxWm5ulg76T5eH44mxsLL579dfold//QYZgaCKWMQKPNoGVuCW5SMIY7g90d08VC2rZe6w==" - "resolved" "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.5.tgz" - "version" "0.29.5" +"epg-grabber@^0.29.7": + "integrity" "sha512-wvjevMnrJD/fr4TaJ0Wh4Y2Kyy0LLQtp+bOEsHFCsF8oe53jUnThOlUYsAT49Sx5v7A6K9GheGxDAXOpLXV67A==" + "resolved" "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.29.7.tgz" + "version" "0.29.7" dependencies: "axios" "^0.21.1" "axios-cache-interceptor" "^0.10.3" From f97f1b55c9313dbbef0b93373ca557e86ab1912c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:40:01 +0300 Subject: [PATCH 31/39] Adds the number of days to config.js --- sites/9tv.co.il/9tv.co.il.config.js | 1 + sites/abc.net.au/abc.net.au.config.js | 1 + sites/allente.se/allente.se.config.js | 1 + sites/andorradifusio.ad/andorradifusio.ad.config.js | 1 + sites/arianaafgtv.com/arianaafgtv.com.config.js | 1 + .../arianatelevision.com.config.js | 1 + sites/artonline.tv/artonline.tv.config.js | 1 + sites/astro.com.my/astro.com.my.config.js | 1 + sites/bein.com/bein.com.config.js | 1 + sites/beinsports.com/beinsports.com.config.js | 1 + sites/bt.com/bt.com.config.js | 1 + sites/cablego.com.pe/cablego.com.pe.config.js | 1 + .../canalplus-afrique.com.config.js | 1 + .../canalplus-caraibes.com.config.js | 1 + .../canalplus-haiti.com.config.js | 1 + .../canalplus-reunion.com.config.js | 1 + sites/canalplus.com/canalplus.com.config.js | 1 + sites/cgates.lt/cgates.lt.config.js | 1 + .../chaines-tv.orange.fr.config.js | 1 + sites/clickthecity.com/clickthecity.com.config.js | 1 + sites/compulms.com/compulms.com.config.js | 1 + sites/comteco.com.bo/comteco.com.bo.config.js | 1 + sites/cosmote.gr/cosmote.gr.config.js | 1 + sites/delta.nl/delta.nl.config.js | 1 + sites/digiturk.com.tr/digiturk.com.tr.config.js | 1 + sites/directv.com.ar/directv.com.ar.config.js | 1 + sites/directv.com.uy/directv.com.uy.config.js | 1 + sites/directv.com/directv.com.config.js | 1 + sites/dishtv.in/dishtv.in.config.js | 1 + sites/dsmart.com.tr/dsmart.com.tr.config.js | 1 + sites/dstv.com/dstv.com.config.js | 1 + sites/elcinema.com/elcinema.com.config.js | 1 + sites/epg.i-cable.com/epg.i-cable.com.config.js | 1 + sites/foxsports.com.au/foxsports.com.au.config.js | 1 + sites/foxtel.com.au/foxtel.com.au.config.js | 1 + sites/frikanalen.no/frikanalen.no.config.js | 1 + sites/gatotv.com/gatotv.com.config.js | 1 + .../getafteritmedia.com.config.js | 1 + sites/guidatv.sky.it/guidatv.sky.it.config.js | 1 + sites/guide.dstv.com/guide.dstv.com.config.js | 1 + sites/hd-plus.de/hd-plus.de.config.js | 1 + sites/horizon.tv/horizon.tv.config.js | 1 + sites/i.mjh.nz/i.mjh.nz.config.js | 1 + sites/i24news.tv/i24news.tv.config.js | 1 + sites/ionplustv.com/ionplustv.com.config.js | 1 + sites/ipko.com/ipko.com.config.js | 1 + sites/kan.org.il/kan.org.il.config.js | 1 + sites/knr.gl/knr.gl.config.js | 1 + sites/kplus.vn/kplus.vn.config.js | 1 + sites/kvf.fo/kvf.fo.config.js | 1 + sites/m.tv.sms.cz/m.tv.sms.cz.config.js | 1 + sites/magentatv.at/magentatv.at.config.js | 1 + sites/magentatv.de/magentatv.de.config.js | 1 + sites/magticom.ge/magticom.ge.config.js | 1 + sites/mako.co.il/mako.co.il.config.js | 1 + .../maxtv.hrvatskitelekom.hr.config.js | 1 + sites/maxtvgo.mk/maxtvgo.mk.config.js | 1 + sites/mbc.net/mbc.net.config.js | 1 + sites/mediaklikk.hu/mediaklikk.hu.config.js | 1 + sites/mediaset.it/mediaset.it.config.js | 1 + sites/melita.com/melita.com.config.js | 1 + sites/meo.pt/meo.pt.config.js | 1 + sites/mewatch.sg/mewatch.sg.config.js | 1 + sites/mi.tv/mi.tv.config.js | 1 + sites/mncvision.id/mncvision.id.config.js | 1 + sites/movistarplus.es/movistarplus.es.config.js | 1 + sites/mtel.ba/mtel.ba.config.js | 1 + sites/mts.rs/mts.rs.config.js | 1 + sites/mujtvprogram.cz/mujtvprogram.cz.config.js | 1 + sites/musor.tv/musor.tv.config.js | 1 + .../myafn.dodmedia.osd.mil.config.js | 1 + sites/mysky.com.ph/mysky.com.ph.config.js | 1 + sites/mytvsuper.com/mytvsuper.com.config.js | 1 + sites/novacyprus.com/novacyprus.com.config.js | 1 + sites/novasports.gr/novasports.gr.config.js | 1 + sites/nowplayer.now.com/nowplayer.now.com.config.js | 1 + sites/ontvtonight.com/ontvtonight.com.config.js | 1 + sites/osn.com/osn.com.config.js | 1 + sites/pbsguam.org/pbsguam.org.config.js | 3 ++- sites/plex.tv/plex.tv.config.js | 1 + .../programacion-tv.elpais.com.config.js | 1 + sites/programetv.ro/programetv.ro.config.js | 1 + sites/programme-tv.net/programme-tv.net.config.js | 1 + .../programme-tv.vini.pf.config.js | 1 + sites/programme.tvb.com/programme.tvb.com.config.js | 1 + sites/programtv.onet.pl/programtv.onet.pl.config.js | 1 + sites/proximusmwc.be/proximusmwc.be.config.js | 1 + sites/raiplay.it/raiplay.it.config.js | 1 + sites/reportv.com.ar/reportv.com.ar.config.js | 1 + sites/rev.bs/rev.bs.config.js | 1 + sites/rotana.net/rotana.net.config.js | 1 + sites/rtb.gov.bn/rtb.gov.bn.config.js | 1 + sites/rthk.hk/rthk.hk.config.js | 1 + .../rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js | 1 + sites/rtp.pt/rtp.pt.config.js | 13 ++++++++----- sites/ruv.is/ruv.is.config.js | 1 + sites/seezntv.com/seezntv.com.config.js | 1 + sites/siba.com.co/siba.com.co.config.js | 1 + sites/sjonvarp.is/sjonvarp.is.config.js | 1 + sites/sky.com/sky.com.config.js | 1 + sites/sky.de/sky.de.config.js | 1 + sites/sportsnet.ca/sportsnet.ca.config.js | 1 + sites/starhubtvplus.com/starhubtvplus.com.config.js | 1 + sites/startimestv.com/startimestv.com.config.js | 1 + sites/startv.com/startv.com.config.js | 1 + sites/tapdmv.com/tapdmv.com.config.js | 1 + sites/telecablesat.fr/telecablesat.fr.config.js | 1 + sites/telenet.tv/telenet.tv.config.js | 1 + sites/teliatv.ee/teliatv.ee.config.js | 1 + sites/telkku.com/telkku.com.config.js | 1 + sites/telkussa.fi/telkussa.fi.config.js | 1 + sites/telsu.fi/telsu.fi.config.js | 1 + sites/tivu.tv/tivu.tv.config.js | 1 + .../toonamiaftermath.com.config.js | 1 + sites/transvision.co.id/transvision.co.id.config.js | 1 + .../turksatkablo.com.tr.config.js | 1 + sites/tv.blue.ch/tv.blue.ch.config.js | 1 + sites/tv.cctv.com/tv.cctv.com.config.js | 1 + sites/tv.dir.bg/tv.dir.bg.config.js | 1 + sites/tv.lv/tv.lv.config.js | 1 + sites/tv.mail.ru/tv.mail.ru.config.js | 1 + .../tv.movistar.com.pe/tv.movistar.com.pe.config.js | 1 + sites/tv.nu/tv.nu.config.js | 1 + sites/tv.trueid.net/tv.trueid.net.config.js | 1 + sites/tv.yandex.ru/tv.yandex.ru.config.js | 1 + sites/tv.yettel.hu/tv.yettel.hu.config.js | 1 + sites/tv24.co.uk/tv24.co.uk.config.js | 1 + sites/tv24.se/tv24.se.config.js | 1 + sites/tv2go.t-2.net/tv2go.t-2.net.config.js | 1 + sites/tva.tv/tva.tv.config.js | 1 + sites/tvarenasport.com/tvarenasport.com.config.js | 1 + sites/tvarenasport.hr/tvarenasport.hr.config.js | 1 + sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js | 1 + sites/tvgid.ua/tvgid.ua.config.js | 1 + sites/tvgids.nl/tvgids.nl.config.js | 1 + sites/tvguide.com/tvguide.com.config.js | 1 + sites/tvguide.myjcom.jp/tvguide.myjcom.jp.config.js | 1 + sites/tvhebdo.com/tvhebdo.com.config.js | 1 + sites/tvheute.at/tvheute.at.config.js | 1 + sites/tvim.tv/tvim.tv.config.js | 1 + sites/tvmi.mt/tvmi.mt.config.js | 1 + sites/tvmusor.hu/tvmusor.hu.config.js | 1 + sites/tvpassport.com/tvpassport.com.config.js | 1 + sites/tvplus.com.tr/tvplus.com.tr.config.js | 1 + sites/tvprofil.com/tvprofil.com.config.js | 1 + sites/tvtv.us/tvtv.us.config.js | 1 + sites/useetv.com/useetv.com.config.js | 1 + sites/vidio.com/vidio.com.config.js | 1 + sites/virginmedia.com/virginmedia.com.config.js | 1 + sites/vivacom.bg/vivacom.bg.config.js | 1 + sites/vtm.be/vtm.be.config.js | 1 + sites/walesi.com.fj/walesi.com.fj.config.js | 1 + sites/watchyour.tv/watchyour.tv.config.js | 1 + sites/wavve.com/wavve.com.config.js | 1 + sites/xumo.tv/xumo.tv.config.js | 1 + sites/zap.co.ao/zap.co.ao.config.js | 1 + sites/ziggogo.tv/ziggogo.tv.config.js | 1 + sites/znbc.co.zm/znbc.co.zm.config.js | 1 + 158 files changed, 166 insertions(+), 6 deletions(-) diff --git a/sites/9tv.co.il/9tv.co.il.config.js b/sites/9tv.co.il/9tv.co.il.config.js index 32c77e37..418d3c55 100644 --- a/sites/9tv.co.il/9tv.co.il.config.js +++ b/sites/9tv.co.il/9tv.co.il.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: '9tv.co.il', + days: 2, url: function ({ date }) { return `https://www.9tv.co.il/BroadcastSchedule/getBrodcastSchedule?date=${date.format( 'DD/MM/YYYY 00:00:00' diff --git a/sites/abc.net.au/abc.net.au.config.js b/sites/abc.net.au/abc.net.au.config.js index a95f51a9..130b6b05 100644 --- a/sites/abc.net.au/abc.net.au.config.js +++ b/sites/abc.net.au/abc.net.au.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'abc.net.au', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/allente.se/allente.se.config.js b/sites/allente.se/allente.se.config.js index 9cb6b02b..f2373b0f 100644 --- a/sites/allente.se/allente.se.config.js +++ b/sites/allente.se/allente.se.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'allente.se', + days: 2, url({ date, channel }) { const [country] = channel.site_id.split('#') diff --git a/sites/andorradifusio.ad/andorradifusio.ad.config.js b/sites/andorradifusio.ad/andorradifusio.ad.config.js index c0963966..7ab7664f 100644 --- a/sites/andorradifusio.ad/andorradifusio.ad.config.js +++ b/sites/andorradifusio.ad/andorradifusio.ad.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'andorradifusio.ad', + days: 2, url({ channel }) { return `https://www.andorradifusio.ad/programacio/${channel.site_id}` }, diff --git a/sites/arianaafgtv.com/arianaafgtv.com.config.js b/sites/arianaafgtv.com/arianaafgtv.com.config.js index c3eaab17..67e00e73 100644 --- a/sites/arianaafgtv.com/arianaafgtv.com.config.js +++ b/sites/arianaafgtv.com/arianaafgtv.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'arianaafgtv.com', + days: 2, url() { return `https://www.arianaafgtv.com/index.html` }, diff --git a/sites/arianatelevision.com/arianatelevision.com.config.js b/sites/arianatelevision.com/arianatelevision.com.config.js index bcd6bd00..ced078c4 100644 --- a/sites/arianatelevision.com/arianatelevision.com.config.js +++ b/sites/arianatelevision.com/arianatelevision.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'arianatelevision.com', + days: 2, url: `https://www.arianatelevision.com/program-schedule/`, parser({ content, date }) { const programs = [] diff --git a/sites/artonline.tv/artonline.tv.config.js b/sites/artonline.tv/artonline.tv.config.js index f5980dc8..3ea3eac6 100644 --- a/sites/artonline.tv/artonline.tv.config.js +++ b/sites/artonline.tv/artonline.tv.config.js @@ -9,6 +9,7 @@ dayjs.extend(utc) module.exports = { site: 'artonline.tv', + days: 2, url: function ({ channel }) { return `https://www.artonline.tv/Home/Tvlist${channel.site_id}` }, diff --git a/sites/astro.com.my/astro.com.my.config.js b/sites/astro.com.my/astro.com.my.config.js index 5e0d4920..a739f38b 100644 --- a/sites/astro.com.my/astro.com.my.config.js +++ b/sites/astro.com.my/astro.com.my.config.js @@ -8,6 +8,7 @@ const API_ENDPOINT = `https://contenthub-api.eco.astro.com.my` module.exports = { site: 'astro.com.my', + days: 2, url: function ({ channel }) { return `${API_ENDPOINT}/channel/${channel.site_id}.json` }, diff --git a/sites/bein.com/bein.com.config.js b/sites/bein.com/bein.com.config.js index aaa2949c..5131a645 100644 --- a/sites/bein.com/bein.com.config.js +++ b/sites/bein.com/bein.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'bein.com', + days: 2, url: function ({ date, channel }) { const [index] = channel.site_id.split('#') diff --git a/sites/beinsports.com/beinsports.com.config.js b/sites/beinsports.com/beinsports.com.config.js index 4d4d801b..deabaa1a 100644 --- a/sites/beinsports.com/beinsports.com.config.js +++ b/sites/beinsports.com/beinsports.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'beinsports.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000, // 1h diff --git a/sites/bt.com/bt.com.config.js b/sites/bt.com/bt.com.config.js index 3154cd69..297bd80c 100644 --- a/sites/bt.com/bt.com.config.js +++ b/sites/bt.com/bt.com.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'bt.com', + days: 2, url: function ({ date, channel }) { return `https://voila.metabroadcast.com/4/schedules/${ channel.site_id diff --git a/sites/cablego.com.pe/cablego.com.pe.config.js b/sites/cablego.com.pe/cablego.com.pe.config.js index 3a270ef5..1bc9eba5 100644 --- a/sites/cablego.com.pe/cablego.com.pe.config.js +++ b/sites/cablego.com.pe/cablego.com.pe.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'cablego.com.pe', + days: 2, request: { method: 'POST', headers: { diff --git a/sites/canalplus-afrique.com/canalplus-afrique.com.config.js b/sites/canalplus-afrique.com/canalplus-afrique.com.config.js index 7b31a2f0..afc50fff 100644 --- a/sites/canalplus-afrique.com/canalplus-afrique.com.config.js +++ b/sites/canalplus-afrique.com/canalplus-afrique.com.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { site: 'canalplus-afrique.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') diff --git a/sites/canalplus-caraibes.com/canalplus-caraibes.com.config.js b/sites/canalplus-caraibes.com/canalplus-caraibes.com.config.js index e287d75e..7740f79b 100644 --- a/sites/canalplus-caraibes.com/canalplus-caraibes.com.config.js +++ b/sites/canalplus-caraibes.com/canalplus-caraibes.com.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { site: 'canalplus-caraibes.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') diff --git a/sites/canalplus-haiti.com/canalplus-haiti.com.config.js b/sites/canalplus-haiti.com/canalplus-haiti.com.config.js index 93ab1a6b..89279868 100644 --- a/sites/canalplus-haiti.com/canalplus-haiti.com.config.js +++ b/sites/canalplus-haiti.com/canalplus-haiti.com.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { site: 'canalplus-haiti.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') diff --git a/sites/canalplus-reunion.com/canalplus-reunion.com.config.js b/sites/canalplus-reunion.com/canalplus-reunion.com.config.js index faea08c4..218e8333 100644 --- a/sites/canalplus-reunion.com/canalplus-reunion.com.config.js +++ b/sites/canalplus-reunion.com/canalplus-reunion.com.config.js @@ -6,6 +6,7 @@ dayjs.extend(utc) module.exports = { site: 'canalplus-reunion.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') diff --git a/sites/canalplus.com/canalplus.com.config.js b/sites/canalplus.com/canalplus.com.config.js index c920c7df..3123917e 100644 --- a/sites/canalplus.com/canalplus.com.config.js +++ b/sites/canalplus.com/canalplus.com.config.js @@ -9,6 +9,7 @@ const API_KEY = 'da2291af3b10e9900d1c55e1a65d3388' // 10.2022 module.exports = { site: 'canalplus.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') diff --git a/sites/cgates.lt/cgates.lt.config.js b/sites/cgates.lt/cgates.lt.config.js index c61916b4..6251a3cc 100644 --- a/sites/cgates.lt/cgates.lt.config.js +++ b/sites/cgates.lt/cgates.lt.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'cgates.lt', + days: 2, url: function ({ channel }) { return `https://www.cgates.lt/tv-kanalai/${channel.site_id}/` }, diff --git a/sites/chaines-tv.orange.fr/chaines-tv.orange.fr.config.js b/sites/chaines-tv.orange.fr/chaines-tv.orange.fr.config.js index be4ecc2f..7f8c46a2 100644 --- a/sites/chaines-tv.orange.fr/chaines-tv.orange.fr.config.js +++ b/sites/chaines-tv.orange.fr/chaines-tv.orange.fr.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'chaines-tv.orange.fr', + days: 2, url({ channel, date }) { return `https://rp-ott-mediation-tv.woopic.com/api-gw/live/v3/applications/STB4PC/programs?groupBy=channel&includeEmptyChannels=false&period=${date.valueOf()},${date .add(1, 'd') diff --git a/sites/clickthecity.com/clickthecity.com.config.js b/sites/clickthecity.com/clickthecity.com.config.js index 366faa08..64cfc26b 100644 --- a/sites/clickthecity.com/clickthecity.com.config.js +++ b/sites/clickthecity.com/clickthecity.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'clickthecity.com', + days: 2, url({ channel }) { return `https://www.clickthecity.com/tv/network/${channel.site_id}` }, diff --git a/sites/compulms.com/compulms.com.config.js b/sites/compulms.com/compulms.com.config.js index 03d551b1..c6202a48 100644 --- a/sites/compulms.com/compulms.com.config.js +++ b/sites/compulms.com/compulms.com.config.js @@ -2,6 +2,7 @@ const parser = require('epg-parser') module.exports = { site: 'compulms.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/comteco.com.bo/comteco.com.bo.config.js b/sites/comteco.com.bo/comteco.com.bo.config.js index 0807c578..04fbc5c8 100644 --- a/sites/comteco.com.bo/comteco.com.bo.config.js +++ b/sites/comteco.com.bo/comteco.com.bo.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'comteco.com.bo', + days: 2, url: function ({ channel }) { return `https://comteco.com.bo/pages/canales-y-programacion-tv/paquete-oro/${channel.site_id}` }, diff --git a/sites/cosmote.gr/cosmote.gr.config.js b/sites/cosmote.gr/cosmote.gr.config.js index 9b803ee0..bac80985 100644 --- a/sites/cosmote.gr/cosmote.gr.config.js +++ b/sites/cosmote.gr/cosmote.gr.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'cosmote.gr', + days: 2, url: function ({ date, channel }) { return `https://www.cosmote.gr/cosmotetv/residential/program/epg/programchannel?p_p_id=channelprogram_WAR_OTETVportlet&p_p_lifecycle=0&_channelprogram_WAR_OTETVportlet_platform=IPTV&_channelprogram_WAR_OTETVportlet_date=${date.format( 'DD-MM-YYYY' diff --git a/sites/delta.nl/delta.nl.config.js b/sites/delta.nl/delta.nl.config.js index 90cbfbf1..f37c26a9 100644 --- a/sites/delta.nl/delta.nl.config.js +++ b/sites/delta.nl/delta.nl.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'delta.nl', + days: 2, url: function ({ channel, date }) { return `https://clientapi.tv.delta.nl/guide/channels/list?start=${date.unix()}&end=${date .add(1, 'd') diff --git a/sites/digiturk.com.tr/digiturk.com.tr.config.js b/sites/digiturk.com.tr/digiturk.com.tr.config.js index df7ddfab..0a8699b7 100644 --- a/sites/digiturk.com.tr/digiturk.com.tr.config.js +++ b/sites/digiturk.com.tr/digiturk.com.tr.config.js @@ -8,6 +8,7 @@ dayjs.extend(timezone) module.exports = { site: 'digiturk.com.tr', + days: 2, url: function ({ date, channel }) { return `https://www.digiturk.com.tr/yayin-akisi/api/program/kanal/${ channel.site_id diff --git a/sites/directv.com.ar/directv.com.ar.config.js b/sites/directv.com.ar/directv.com.ar.config.js index 27113b93..cec99860 100644 --- a/sites/directv.com.ar/directv.com.ar.config.js +++ b/sites/directv.com.ar/directv.com.ar.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'directv.com.ar', + days: 2, url: `https://www.directv.com.ar/guia/ChannelDetail.aspx/GetProgramming`, request: { method: 'POST', diff --git a/sites/directv.com.uy/directv.com.uy.config.js b/sites/directv.com.uy/directv.com.uy.config.js index 591aa038..c03263a3 100644 --- a/sites/directv.com.uy/directv.com.uy.config.js +++ b/sites/directv.com.uy/directv.com.uy.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'directv.com.uy', + days: 2, url: `https://www.directv.com.uy/guia/ChannelDetail.aspx/GetProgramming`, request: { method: 'POST', diff --git a/sites/directv.com/directv.com.config.js b/sites/directv.com/directv.com.config.js index eea5d45d..c07b3592 100644 --- a/sites/directv.com/directv.com.config.js +++ b/sites/directv.com/directv.com.config.js @@ -8,6 +8,7 @@ dayjs.extend(utc) module.exports = { site: 'directv.com', + days: 2, url({ channel, date }) { return `https://www.directv.com/json/channelschedule?channels=${ channel.site_id diff --git a/sites/dishtv.in/dishtv.in.config.js b/sites/dishtv.in/dishtv.in.config.js index fb2cb0d2..955ada01 100644 --- a/sites/dishtv.in/dishtv.in.config.js +++ b/sites/dishtv.in/dishtv.in.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'dishtv.in', + days: 2, url: `https://www.dishtv.in/WhatsonIndiaWebService.asmx/LoadPagginResultDataForProgram`, request: { method: 'POST', diff --git a/sites/dsmart.com.tr/dsmart.com.tr.config.js b/sites/dsmart.com.tr/dsmart.com.tr.config.js index 397eaaa3..adc93726 100644 --- a/sites/dsmart.com.tr/dsmart.com.tr.config.js +++ b/sites/dsmart.com.tr/dsmart.com.tr.config.js @@ -5,6 +5,7 @@ dayjs.extend(utc) module.exports = { site: 'dsmart.com.tr', + days: 2, url({ date, channel }) { return `https://www.dsmart.com.tr/api/v1/public/epg/schedules?page=1&limit=500&day=${date.format( 'YYYY-MM-DD' diff --git a/sites/dstv.com/dstv.com.config.js b/sites/dstv.com/dstv.com.config.js index c3f1d13d..a53b6103 100644 --- a/sites/dstv.com/dstv.com.config.js +++ b/sites/dstv.com/dstv.com.config.js @@ -12,6 +12,7 @@ const API_ENDPOINT = 'https://www.dstv.com/umbraco/api/TvGuide' module.exports = { site: 'dstv.com', + days: 2, request: { cache: { ttl: 3 * 60 * 60 * 1000, // 3h diff --git a/sites/elcinema.com/elcinema.com.config.js b/sites/elcinema.com/elcinema.com.config.js index 3a1639ca..878362f9 100644 --- a/sites/elcinema.com/elcinema.com.config.js +++ b/sites/elcinema.com/elcinema.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(utc) module.exports = { site: 'elcinema.com', + days: 2, url({ channel }) { const lang = channel.lang === 'en' ? 'en/' : '/' diff --git a/sites/epg.i-cable.com/epg.i-cable.com.config.js b/sites/epg.i-cable.com/epg.i-cable.com.config.js index 36c11aa2..2dd92443 100644 --- a/sites/epg.i-cable.com/epg.i-cable.com.config.js +++ b/sites/epg.i-cable.com/epg.i-cable.com.config.js @@ -12,6 +12,7 @@ const API_ENDPOINT = 'http://epg.i-cable.com/ci/channel' module.exports = { site: 'epg.i-cable.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1h diff --git a/sites/foxsports.com.au/foxsports.com.au.config.js b/sites/foxsports.com.au/foxsports.com.au.config.js index d55a572c..a5a84103 100644 --- a/sites/foxsports.com.au/foxsports.com.au.config.js +++ b/sites/foxsports.com.au/foxsports.com.au.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'foxsports.com.au', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/foxtel.com.au/foxtel.com.au.config.js b/sites/foxtel.com.au/foxtel.com.au.config.js index 687c9b46..a93699b1 100644 --- a/sites/foxtel.com.au/foxtel.com.au.config.js +++ b/sites/foxtel.com.au/foxtel.com.au.config.js @@ -5,6 +5,7 @@ const cheerio = require('cheerio') module.exports = { skip: true, // returns "Access Denied" or nothing site: 'foxtel.com.au', + days: 2, url({ channel, date }) { return `https://www.foxtel.com.au/tv-guide/channel/${channel.site_id}/${date.format( 'YYYY/MM/DD' diff --git a/sites/frikanalen.no/frikanalen.no.config.js b/sites/frikanalen.no/frikanalen.no.config.js index 46961c64..e66a6efe 100644 --- a/sites/frikanalen.no/frikanalen.no.config.js +++ b/sites/frikanalen.no/frikanalen.no.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'frikanalen.no', + days: 2, url({ date }) { return `https://frikanalen.no/api/scheduleitems/?date=${date.format( 'YYYY-MM-DD' diff --git a/sites/gatotv.com/gatotv.com.config.js b/sites/gatotv.com/gatotv.com.config.js index 212a33fd..2e8bb216 100644 --- a/sites/gatotv.com/gatotv.com.config.js +++ b/sites/gatotv.com/gatotv.com.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'gatotv.com', + days: 2, url: function ({ channel, date }) { return `https://www.gatotv.com/canal/${channel.site_id}/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/getafteritmedia.com/getafteritmedia.com.config.js b/sites/getafteritmedia.com/getafteritmedia.com.config.js index 5faffbb3..5fdcaed4 100644 --- a/sites/getafteritmedia.com/getafteritmedia.com.config.js +++ b/sites/getafteritmedia.com/getafteritmedia.com.config.js @@ -13,6 +13,7 @@ dayjs.extend(isoWeek) module.exports = { site: 'getafteritmedia.com', + days: 2, url: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQcDmb9OnO0HpbjINfGaepqgGTp3VSmPs7hs654n3sRKrq4Q9y6uPSEvVvq9MwTLYG_n_V7vh0rFYP9/pubhtml', parser({ content, channel, date }) { const programs = [] diff --git a/sites/guidatv.sky.it/guidatv.sky.it.config.js b/sites/guidatv.sky.it/guidatv.sky.it.config.js index a65741bd..d3f5dcf5 100644 --- a/sites/guidatv.sky.it/guidatv.sky.it.config.js +++ b/sites/guidatv.sky.it/guidatv.sky.it.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'guidatv.sky.it', + days: 2, url: function ({ date, channel }) { const [env, id] = channel.site_id.split('#') return `https://apid.sky.it/gtv/v1/events?from=${date.format('YYYY-MM-DD')}T00:00:00Z&to=${date diff --git a/sites/guide.dstv.com/guide.dstv.com.config.js b/sites/guide.dstv.com/guide.dstv.com.config.js index e41a8c48..4c0642ce 100644 --- a/sites/guide.dstv.com/guide.dstv.com.config.js +++ b/sites/guide.dstv.com/guide.dstv.com.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'guide.dstv.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000, diff --git a/sites/hd-plus.de/hd-plus.de.config.js b/sites/hd-plus.de/hd-plus.de.config.js index ad2b1fe7..9b960271 100644 --- a/sites/hd-plus.de/hd-plus.de.config.js +++ b/sites/hd-plus.de/hd-plus.de.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'hd-plus.de', + days: 2, url({ date, channel }) { const today = dayjs().utc().startOf('d') const day = date.diff(today, 'd') diff --git a/sites/horizon.tv/horizon.tv.config.js b/sites/horizon.tv/horizon.tv.config.js index 95d40d80..9eb82a18 100644 --- a/sites/horizon.tv/horizon.tv.config.js +++ b/sites/horizon.tv/horizon.tv.config.js @@ -5,6 +5,7 @@ const API_ENDPOINT = `https://legacy-static.oesp.horizon.tv/oesp/v4` module.exports = { site: 'horizon.tv', + days: 2, url: function ({ date, channel }) { const [country, lang] = channel.site_id.split('#') diff --git a/sites/i.mjh.nz/i.mjh.nz.config.js b/sites/i.mjh.nz/i.mjh.nz.config.js index 6b6b7469..35180317 100644 --- a/sites/i.mjh.nz/i.mjh.nz.config.js +++ b/sites/i.mjh.nz/i.mjh.nz.config.js @@ -11,6 +11,7 @@ const API_ENDPOINT = 'https://raw.githubusercontent.com/matthuisman/i.mjh.nz/mas module.exports = { site: 'i.mjh.nz', + days: 2, request: { cache: { ttl: 3 * 60 * 60 * 1000 // 3h diff --git a/sites/i24news.tv/i24news.tv.config.js b/sites/i24news.tv/i24news.tv.config.js index 7141e34d..3c590bc5 100644 --- a/sites/i24news.tv/i24news.tv.config.js +++ b/sites/i24news.tv/i24news.tv.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'i24news.tv', + days: 2, url: function ({ channel }) { const [lang] = channel.site_id.split('#') diff --git a/sites/ionplustv.com/ionplustv.com.config.js b/sites/ionplustv.com/ionplustv.com.config.js index ccd63973..d9c99696 100644 --- a/sites/ionplustv.com/ionplustv.com.config.js +++ b/sites/ionplustv.com/ionplustv.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'ionplustv.com', + days: 2, url({ date }) { return `https://ionplustv.com/schedule/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/ipko.com/ipko.com.config.js b/sites/ipko.com/ipko.com.config.js index efe2665f..b2f2dfd3 100644 --- a/sites/ipko.com/ipko.com.config.js +++ b/sites/ipko.com/ipko.com.config.js @@ -5,6 +5,7 @@ dayjs.extend(utc) module.exports = { site: 'ipko.com', + days: 2, url: function ({ date }) { return `https://www.ipko.com/epg/admin/programs.php?date=${date.format('YYYY-MM-DD')}` }, diff --git a/sites/kan.org.il/kan.org.il.config.js b/sites/kan.org.il/kan.org.il.config.js index 65e8985c..cf114879 100644 --- a/sites/kan.org.il/kan.org.il.config.js +++ b/sites/kan.org.il/kan.org.il.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { skip: true, // INFO: Request failed with status code 403 (Access denied) site: 'kan.org.il', + days: 2, url: function ({ channel, date }) { return `https://www.kan.org.il/tv-guide/tv_guidePrograms.ashx?stationID=${ channel.site_id diff --git a/sites/knr.gl/knr.gl.config.js b/sites/knr.gl/knr.gl.config.js index e9d8b532..c123d78d 100644 --- a/sites/knr.gl/knr.gl.config.js +++ b/sites/knr.gl/knr.gl.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'knr.gl', + days: 2, url({ date }) { return `https://knr.gl/admin/knr/TV/program/${date.format('YYYY-MM-DD')}/gl` }, diff --git a/sites/kplus.vn/kplus.vn.config.js b/sites/kplus.vn/kplus.vn.config.js index 31723697..a1bc59e8 100644 --- a/sites/kplus.vn/kplus.vn.config.js +++ b/sites/kplus.vn/kplus.vn.config.js @@ -10,6 +10,7 @@ const API_ENDPOINT = `https://www.kplus.vn/Schedule/getSchedule` module.exports = { site: 'kplus.vn', + days: 2, skip: true, // channel list changes with each request url: API_ENDPOINT, request: { diff --git a/sites/kvf.fo/kvf.fo.config.js b/sites/kvf.fo/kvf.fo.config.js index 5b869781..f95a27b9 100644 --- a/sites/kvf.fo/kvf.fo.config.js +++ b/sites/kvf.fo/kvf.fo.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'kvf.fo', + days: 2, url({ date }) { return `https://kvf.fo/nskra/sv?date=${date.format('YYYY-MM-DD')}` }, diff --git a/sites/m.tv.sms.cz/m.tv.sms.cz.config.js b/sites/m.tv.sms.cz/m.tv.sms.cz.config.js index cee697c2..57d2c977 100644 --- a/sites/m.tv.sms.cz/m.tv.sms.cz.config.js +++ b/sites/m.tv.sms.cz/m.tv.sms.cz.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'm.tv.sms.cz', + days: 2, url: function ({ date, channel }) { return `https://m.tv.sms.cz/index.php?stanice=${channel.site_id}&cas=0&den=${date.format( 'YYYY-MM-DD' diff --git a/sites/magentatv.at/magentatv.at.config.js b/sites/magentatv.at/magentatv.at.config.js index db397d11..2295d91d 100644 --- a/sites/magentatv.at/magentatv.at.config.js +++ b/sites/magentatv.at/magentatv.at.config.js @@ -6,6 +6,7 @@ const API_PROD_ENDPOINT = 'https://prod.spark.magentatv.at/deu/web/linear-servic module.exports = { site: 'magentatv.at', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/magentatv.de/magentatv.de.config.js b/sites/magentatv.de/magentatv.de.config.js index 355b3994..ce6ffab1 100644 --- a/sites/magentatv.de/magentatv.de.config.js +++ b/sites/magentatv.de/magentatv.de.config.js @@ -7,6 +7,7 @@ const COOKIE = module.exports = { site: 'magentatv.de', + days: 2, skip: true, // the site uses a constantly updated session ID url: `https://api.prod.sngtv.magentatv.de/EPG/JSON/PlayBillList`, request: { diff --git a/sites/magticom.ge/magticom.ge.config.js b/sites/magticom.ge/magticom.ge.config.js index 5e0c44aa..661f54e9 100644 --- a/sites/magticom.ge/magticom.ge.config.js +++ b/sites/magticom.ge/magticom.ge.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'magticom.ge', + days: 2, url: 'https://www.magticom.ge/request/channel-program.php', request: { method: 'POST', diff --git a/sites/mako.co.il/mako.co.il.config.js b/sites/mako.co.il/mako.co.il.config.js index ce6dc3e5..a0ee67ae 100644 --- a/sites/mako.co.il/mako.co.il.config.js +++ b/sites/mako.co.il/mako.co.il.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mako.co.il', + days: 2, url: 'https://www.mako.co.il/AjaxPage?jspName=EPGResponse.jsp', parser: function ({ content, date }) { let programs = [] diff --git a/sites/maxtv.hrvatskitelekom.hr/maxtv.hrvatskitelekom.hr.config.js b/sites/maxtv.hrvatskitelekom.hr/maxtv.hrvatskitelekom.hr.config.js index e8cc2765..c3d29d5f 100644 --- a/sites/maxtv.hrvatskitelekom.hr/maxtv.hrvatskitelekom.hr.config.js +++ b/sites/maxtv.hrvatskitelekom.hr/maxtv.hrvatskitelekom.hr.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'maxtv.hrvatskitelekom.hr', + days: 2, url: 'https://player.maxtvtogo.tportal.hr:8082/OTT4Proxy/proxy/epg/shows', request: { method: 'POST', diff --git a/sites/maxtvgo.mk/maxtvgo.mk.config.js b/sites/maxtvgo.mk/maxtvgo.mk.config.js index 38bed1ab..934d99fa 100644 --- a/sites/maxtvgo.mk/maxtvgo.mk.config.js +++ b/sites/maxtvgo.mk/maxtvgo.mk.config.js @@ -6,6 +6,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'maxtvgo.mk', + days: 2, url: function ({ channel, date }) { return `https://prd-static-mkt.spectar.tv/rev-1636968171/client_api.php/epg/list/instance_id/1/language/mk/channel_id/${ channel.site_id diff --git a/sites/mbc.net/mbc.net.config.js b/sites/mbc.net/mbc.net.config.js index 06fe5b60..f94d0e0a 100644 --- a/sites/mbc.net/mbc.net.config.js +++ b/sites/mbc.net/mbc.net.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'mbc.net', + days: 2, skip: true, // NOTE: there is no program on the site url({ date, channel }) { return `https://www.mbc.net/.rest/api/channel/grids?from=${date.valueOf()}&to=${date diff --git a/sites/mediaklikk.hu/mediaklikk.hu.config.js b/sites/mediaklikk.hu/mediaklikk.hu.config.js index 5a9dfd96..7a024c15 100644 --- a/sites/mediaklikk.hu/mediaklikk.hu.config.js +++ b/sites/mediaklikk.hu/mediaklikk.hu.config.js @@ -8,6 +8,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mediaklikk.hu', + days: 2, url: 'https://mediaklikk.hu/wp-content/plugins/hms-global-widgets/widgets/programGuide/programGuideInterface.php', request: { method: 'POST', diff --git a/sites/mediaset.it/mediaset.it.config.js b/sites/mediaset.it/mediaset.it.config.js index b3616557..40a84876 100644 --- a/sites/mediaset.it/mediaset.it.config.js +++ b/sites/mediaset.it/mediaset.it.config.js @@ -7,6 +7,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mediaset.it', + days: 2, url: function ({ date, channel }) { return `http://www.mediaset.it/guidatv/inc/canali/${date.format('YYYYMM')}/${date.format( 'YYYYMMDD' diff --git a/sites/melita.com/melita.com.config.js b/sites/melita.com/melita.com.config.js index 6735cd36..7fff861a 100644 --- a/sites/melita.com/melita.com.config.js +++ b/sites/melita.com/melita.com.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'melita.com', + days: 2, url: function ({ channel, date }) { return `https://androme.melitacable.com/api/epg/v1/schedule/channel/${ channel.site_id diff --git a/sites/meo.pt/meo.pt.config.js b/sites/meo.pt/meo.pt.config.js index 0a1ffa44..b4ae2d7a 100644 --- a/sites/meo.pt/meo.pt.config.js +++ b/sites/meo.pt/meo.pt.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'meo.pt', + days: 2, url: `https://www.meo.pt/_layouts/15/Ptsi.Isites.GridTv/GridTvMng.asmx/getProgramsFromChannels`, request: { method: 'POST', diff --git a/sites/mewatch.sg/mewatch.sg.config.js b/sites/mewatch.sg/mewatch.sg.config.js index ebfa4589..a8dc1363 100644 --- a/sites/mewatch.sg/mewatch.sg.config.js +++ b/sites/mewatch.sg/mewatch.sg.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'mewatch.sg', + days: 2, url: function ({ channel, date }) { return `https://cdn.mewatch.sg/api/schedules?channels=${channel.site_id}&date=${date.format( 'YYYY-MM-DD' diff --git a/sites/mi.tv/mi.tv.config.js b/sites/mi.tv/mi.tv.config.js index eeb37988..6de2b808 100644 --- a/sites/mi.tv/mi.tv.config.js +++ b/sites/mi.tv/mi.tv.config.js @@ -8,6 +8,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mi.tv', + days: 2, url({ date, channel }) { const [country, id] = channel.site_id.split('#') diff --git a/sites/mncvision.id/mncvision.id.config.js b/sites/mncvision.id/mncvision.id.config.js index 0067336a..012dad43 100644 --- a/sites/mncvision.id/mncvision.id.config.js +++ b/sites/mncvision.id/mncvision.id.config.js @@ -12,6 +12,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mncvision.id', + days: 2, url: 'https://mncvision.id/schedule/table', request: { method: 'POST', diff --git a/sites/movistarplus.es/movistarplus.es.config.js b/sites/movistarplus.es/movistarplus.es.config.js index bf036873..c3c6c895 100644 --- a/sites/movistarplus.es/movistarplus.es.config.js +++ b/sites/movistarplus.es/movistarplus.es.config.js @@ -8,6 +8,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'movistarplus.es', + days: 2, url: function ({ date }) { return `https://www.movistarplus.es/programacion-tv/${date.format('YYYY-MM-DD')}?v=json` }, diff --git a/sites/mtel.ba/mtel.ba.config.js b/sites/mtel.ba/mtel.ba.config.js index 647936ed..7c50b8a2 100644 --- a/sites/mtel.ba/mtel.ba.config.js +++ b/sites/mtel.ba/mtel.ba.config.js @@ -5,6 +5,7 @@ dayjs.extend(timezone) module.exports = { site: 'mtel.ba', + days: 2, url: function ({ channel, date }) { const [position] = channel.site_id.split('#') diff --git a/sites/mts.rs/mts.rs.config.js b/sites/mts.rs/mts.rs.config.js index 65a19edb..89e488f4 100644 --- a/sites/mts.rs/mts.rs.config.js +++ b/sites/mts.rs/mts.rs.config.js @@ -7,6 +7,7 @@ dayjs.extend(timezone) module.exports = { site: 'mts.rs', + days: 2, url({ date, channel }) { const [position] = channel.site_id.split('#') diff --git a/sites/mujtvprogram.cz/mujtvprogram.cz.config.js b/sites/mujtvprogram.cz/mujtvprogram.cz.config.js index a7093716..8e9f0caa 100644 --- a/sites/mujtvprogram.cz/mujtvprogram.cz.config.js +++ b/sites/mujtvprogram.cz/mujtvprogram.cz.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mujtvprogram.cz', + days: 2, url({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') return `https://services.mujtvprogram.cz/tvprogram2services/services/tvprogrammelist_mobile.php?channel_cid=${channel.site_id}&day=${diff}` diff --git a/sites/musor.tv/musor.tv.config.js b/sites/musor.tv/musor.tv.config.js index 594e8602..a436b8af 100644 --- a/sites/musor.tv/musor.tv.config.js +++ b/sites/musor.tv/musor.tv.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'musor.tv', + days: 2, url({ channel, date }) { return dayjs.utc().isSame(date, 'd') ? `https://musor.tv/mai/tvmusor/${channel.site_id}` diff --git a/sites/myafn.dodmedia.osd.mil/myafn.dodmedia.osd.mil.config.js b/sites/myafn.dodmedia.osd.mil/myafn.dodmedia.osd.mil.config.js index 8770e0aa..024fc0c7 100644 --- a/sites/myafn.dodmedia.osd.mil/myafn.dodmedia.osd.mil.config.js +++ b/sites/myafn.dodmedia.osd.mil/myafn.dodmedia.osd.mil.config.js @@ -8,6 +8,7 @@ dayjs.extend(utc) module.exports = { site: 'myafn.dodmedia.osd.mil', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/mysky.com.ph/mysky.com.ph.config.js b/sites/mysky.com.ph/mysky.com.ph.config.js index ecc6c46c..3735b0e0 100644 --- a/sites/mysky.com.ph/mysky.com.ph.config.js +++ b/sites/mysky.com.ph/mysky.com.ph.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'mysky.com.ph', + days: 2, url: 'https://skyepg.mysky.com.ph/Main/getEventsbyType', request: { cache: { diff --git a/sites/mytvsuper.com/mytvsuper.com.config.js b/sites/mytvsuper.com/mytvsuper.com.config.js index 5883d07b..8a73c0e9 100644 --- a/sites/mytvsuper.com/mytvsuper.com.config.js +++ b/sites/mytvsuper.com/mytvsuper.com.config.js @@ -10,6 +10,7 @@ const API_ENDPOINT = 'https://content-api.mytvsuper.com/v1' module.exports = { site: 'mytvsuper.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1h diff --git a/sites/novacyprus.com/novacyprus.com.config.js b/sites/novacyprus.com/novacyprus.com.config.js index cee97aaa..fc49bf01 100644 --- a/sites/novacyprus.com/novacyprus.com.config.js +++ b/sites/novacyprus.com/novacyprus.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'novacyprus.com', + days: 2, url({ channel, date }) { return `https://www.novacyprus.com/api/v1/tvprogram/from/${date.format('YYYYMMDD')}/to/${date .add(1, 'd') diff --git a/sites/novasports.gr/novasports.gr.config.js b/sites/novasports.gr/novasports.gr.config.js index 653751b3..9fba886a 100644 --- a/sites/novasports.gr/novasports.gr.config.js +++ b/sites/novasports.gr/novasports.gr.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'novasports.gr', + days: 2, url: function ({ date, channel }) { return `https://www.novasports.gr/wp-admin/admin-ajax.php?action=nova_get_template&template=tv-program/broadcast&dt=${date.format( 'YYYY-MM-DD' diff --git a/sites/nowplayer.now.com/nowplayer.now.com.config.js b/sites/nowplayer.now.com/nowplayer.now.com.config.js index 99ec1b86..0b63e9b2 100644 --- a/sites/nowplayer.now.com/nowplayer.now.com.config.js +++ b/sites/nowplayer.now.com/nowplayer.now.com.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { site: 'nowplayer.now.com', + days: 2, url: function ({ channel, date }) { const diff = date.diff(dayjs.utc().startOf('d'), 'd') + 1 diff --git a/sites/ontvtonight.com/ontvtonight.com.config.js b/sites/ontvtonight.com/ontvtonight.com.config.js index a9d5e233..3c8c06fb 100644 --- a/sites/ontvtonight.com/ontvtonight.com.config.js +++ b/sites/ontvtonight.com/ontvtonight.com.config.js @@ -17,6 +17,7 @@ const tz = { module.exports = { site: 'ontvtonight.com', + days: 2, url: function ({ date, channel }) { const [region, id] = channel.site_id.split('#') let url = `https://www.ontvtonight.com` diff --git a/sites/osn.com/osn.com.config.js b/sites/osn.com/osn.com.config.js index faa60ce3..4d60f7cb 100644 --- a/sites/osn.com/osn.com.config.js +++ b/sites/osn.com/osn.com.config.js @@ -7,6 +7,7 @@ dayjs.extend(timezone) module.exports = { site: 'osn.com', + days: 2, url: `https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable`, request: { method: 'POST', diff --git a/sites/pbsguam.org/pbsguam.org.config.js b/sites/pbsguam.org/pbsguam.org.config.js index 59d1411a..e4392f0d 100644 --- a/sites/pbsguam.org/pbsguam.org.config.js +++ b/sites/pbsguam.org/pbsguam.org.config.js @@ -4,7 +4,8 @@ const isBetween = require('dayjs/plugin/isBetween') dayjs.extend(isBetween) module.exports = { - site: 'pbsguam.org', // the program is only available Thursday through Sunday + site: 'pbsguam.org', + days: 2, // the program is only available Thursday through Sunday url: 'https://pbsguam.org/calendar/', parser: function ({ content, date }) { let programs = [] diff --git a/sites/plex.tv/plex.tv.config.js b/sites/plex.tv/plex.tv.config.js index fb8ec623..29c19a67 100644 --- a/sites/plex.tv/plex.tv.config.js +++ b/sites/plex.tv/plex.tv.config.js @@ -5,6 +5,7 @@ const API_ENDPOINT = 'https://epg.provider.plex.tv' module.exports = { site: 'plex.tv', + days: 2, request: { headers: { 'x-plex-provider-version': '5.1' diff --git a/sites/programacion-tv.elpais.com/programacion-tv.elpais.com.config.js b/sites/programacion-tv.elpais.com/programacion-tv.elpais.com.config.js index e369dd5d..8aadfb62 100644 --- a/sites/programacion-tv.elpais.com/programacion-tv.elpais.com.config.js +++ b/sites/programacion-tv.elpais.com/programacion-tv.elpais.com.config.js @@ -8,6 +8,7 @@ dayjs.extend(timezone) module.exports = { site: 'programacion-tv.elpais.com', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/programetv.ro/programetv.ro.config.js b/sites/programetv.ro/programetv.ro.config.js index 4e07c26e..b93cbc80 100644 --- a/sites/programetv.ro/programetv.ro.config.js +++ b/sites/programetv.ro/programetv.ro.config.js @@ -5,6 +5,7 @@ dayjs.extend(utc) module.exports = { site: 'programetv.ro', + days: 2, url: function ({ date, channel }) { const daysOfWeek = { 0: 'duminica', diff --git a/sites/programme-tv.net/programme-tv.net.config.js b/sites/programme-tv.net/programme-tv.net.config.js index 181d89cc..a566e9c6 100644 --- a/sites/programme-tv.net/programme-tv.net.config.js +++ b/sites/programme-tv.net/programme-tv.net.config.js @@ -12,6 +12,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'programme-tv.net', + days: 2, url: function ({ date, channel }) { return `https://www.programme-tv.net/programme/chaine/${date.format('YYYY-MM-DD')}/programme-${ channel.site_id diff --git a/sites/programme-tv.vini.pf/programme-tv.vini.pf.config.js b/sites/programme-tv.vini.pf/programme-tv.vini.pf.config.js index 12eb7bf0..606a9bea 100644 --- a/sites/programme-tv.vini.pf/programme-tv.vini.pf.config.js +++ b/sites/programme-tv.vini.pf/programme-tv.vini.pf.config.js @@ -5,6 +5,7 @@ const apiUrl = `https://programme-tv.vini.pf/programmesJSON` module.exports = { site: 'programme-tv.vini.pf', + days: 2, url: apiUrl, request: { method: 'POST', diff --git a/sites/programme.tvb.com/programme.tvb.com.config.js b/sites/programme.tvb.com/programme.tvb.com.config.js index a5b4d240..7fa1d4fe 100644 --- a/sites/programme.tvb.com/programme.tvb.com.config.js +++ b/sites/programme.tvb.com/programme.tvb.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'programme.tvb.com', + days: 2, url: function ({ channel, date }) { return `https://programme.tvb.com/ajax.php?action=channellist&code=${ channel.site_id diff --git a/sites/programtv.onet.pl/programtv.onet.pl.config.js b/sites/programtv.onet.pl/programtv.onet.pl.config.js index 352321f2..02757357 100644 --- a/sites/programtv.onet.pl/programtv.onet.pl.config.js +++ b/sites/programtv.onet.pl/programtv.onet.pl.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { delay: 5000, site: 'programtv.onet.pl', + days: 2, url: function ({ date, channel }) { const currDate = dayjs.utc().startOf('d') const day = date.diff(currDate, 'd') diff --git a/sites/proximusmwc.be/proximusmwc.be.config.js b/sites/proximusmwc.be/proximusmwc.be.config.js index f94f8ac5..dd60ecf0 100644 --- a/sites/proximusmwc.be/proximusmwc.be.config.js +++ b/sites/proximusmwc.be/proximusmwc.be.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'proximusmwc.be', + days: 2, skip: true, // site is not working (https://github.com/iptv-org/epg/runs/5505070902?check_suite_focus=true) url: 'https://api.proximusmwc.be/v2/graphql', request: { diff --git a/sites/raiplay.it/raiplay.it.config.js b/sites/raiplay.it/raiplay.it.config.js index cc9d2e57..803c68b7 100644 --- a/sites/raiplay.it/raiplay.it.config.js +++ b/sites/raiplay.it/raiplay.it.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'raiplay.it', + days: 2, url: function ({ date, channel }) { return `https://www.raiplay.it/palinsesto/app/${channel.site_id}/${date.format( 'DD-MM-YYYY' diff --git a/sites/reportv.com.ar/reportv.com.ar.config.js b/sites/reportv.com.ar/reportv.com.ar.config.js index 4836492d..70adb8e2 100644 --- a/sites/reportv.com.ar/reportv.com.ar.config.js +++ b/sites/reportv.com.ar/reportv.com.ar.config.js @@ -13,6 +13,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'reportv.com.ar', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/rev.bs/rev.bs.config.js b/sites/rev.bs/rev.bs.config.js index 2298b946..a2997e04 100644 --- a/sites/rev.bs/rev.bs.config.js +++ b/sites/rev.bs/rev.bs.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'rev.bs', + days: 2, url: function ({ date }) { return `https://www.rev.bs/wp-content/uploads/tv-guide/${date.format('YYYY-MM-DD')}_0.json` }, diff --git a/sites/rotana.net/rotana.net.config.js b/sites/rotana.net/rotana.net.config.js index 5208f61a..70ffe8c9 100644 --- a/sites/rotana.net/rotana.net.config.js +++ b/sites/rotana.net/rotana.net.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'rotana.net', + days: 2, skip: true, // NOTE: there is no program for the current date on the site url({ channel, date }) { return `https://rotana.net/triAssets/uploads/2020/11/${channel.site_id}.csv` diff --git a/sites/rtb.gov.bn/rtb.gov.bn.config.js b/sites/rtb.gov.bn/rtb.gov.bn.config.js index f25cbcd2..e6071fbd 100644 --- a/sites/rtb.gov.bn/rtb.gov.bn.config.js +++ b/sites/rtb.gov.bn/rtb.gov.bn.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { skip: true, // INFO: guide is not available on the site site: 'rtb.gov.bn', + days: 2, url: function ({ channel, date }) { const [position] = channel.site_id.split('#') diff --git a/sites/rthk.hk/rthk.hk.config.js b/sites/rthk.hk/rthk.hk.config.js index c39de94d..bc95b263 100644 --- a/sites/rthk.hk/rthk.hk.config.js +++ b/sites/rthk.hk/rthk.hk.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'rthk.hk', + days: 2, request: { headers({ channel }) { return { diff --git a/sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js b/sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js index 9e07596d..d3cc83b6 100644 --- a/sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js +++ b/sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'rtmklik.rtm.gov.my', + days: 2, url: function ({ date, channel }) { return `https://rtm.glueapi.io/v3/epg/${ channel.site_id diff --git a/sites/rtp.pt/rtp.pt.config.js b/sites/rtp.pt/rtp.pt.config.js index 3185274c..12e552cf 100644 --- a/sites/rtp.pt/rtp.pt.config.js +++ b/sites/rtp.pt/rtp.pt.config.js @@ -10,16 +10,19 @@ dayjs.extend(timezone) dayjs.extend(customParseFormat) const tz = { - lis: 'Europe/Lisbon', - per: 'Asia/Macau', - rja: 'America/Sao_Paulo' + lis: 'Europe/Lisbon', + per: 'Asia/Macau', + rja: 'America/Sao_Paulo' } module.exports = { site: 'rtp.pt', + days: 2, url({ channel, date }) { let [region, channelCode] = channel.site_id.split('#') - return `https://www.rtp.pt/EPG/json/rtp-channels-page/list-grid/tv/${channelCode}/${date.format('D-M-YYYY')}/${region}` + return `https://www.rtp.pt/EPG/json/rtp-channels-page/list-grid/tv/${channelCode}/${date.format( + 'D-M-YYYY' + )}/${region}` }, parser({ content, channel }) { let programs = [] @@ -61,7 +64,7 @@ module.exports = { function parseIcon(item) { const last = item.image.pop() - if(!last) return null + if (!last) return null return last.src } diff --git a/sites/ruv.is/ruv.is.config.js b/sites/ruv.is/ruv.is.config.js index 25d66391..2ef9125f 100644 --- a/sites/ruv.is/ruv.is.config.js +++ b/sites/ruv.is/ruv.is.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'ruv.is', + days: 2, url({ channel, date }) { return `https://www.ruv.is/sjonvarp/dagskra/${channel.site_id}/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/seezntv.com/seezntv.com.config.js b/sites/seezntv.com/seezntv.com.config.js index c1470b45..5c023350 100644 --- a/sites/seezntv.com/seezntv.com.config.js +++ b/sites/seezntv.com/seezntv.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'seezntv.com', + days: 2, url: function ({ channel }) { return `https://api.seezntv.com/svc/menu/app6/api/epg_proglist?ch_no=${channel.site_id}&search_day=1` }, diff --git a/sites/siba.com.co/siba.com.co.config.js b/sites/siba.com.co/siba.com.co.config.js index fe81e892..d1ef37d2 100644 --- a/sites/siba.com.co/siba.com.co.config.js +++ b/sites/siba.com.co/siba.com.co.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'siba.com.co', + days: 2, url: 'http://devportal.siba.com.co/index.php?action=grilla', request: { method: 'POST', diff --git a/sites/sjonvarp.is/sjonvarp.is.config.js b/sites/sjonvarp.is/sjonvarp.is.config.js index e4321b50..d9b15946 100644 --- a/sites/sjonvarp.is/sjonvarp.is.config.js +++ b/sites/sjonvarp.is/sjonvarp.is.config.js @@ -8,6 +8,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'sjonvarp.is', + days: 2, url: function ({ channel, date }) { return `http://www.sjonvarp.is/index.php?Tm=%3F&p=idag&c=${channel.site_id}&y=${date.format( 'YYYY' diff --git a/sites/sky.com/sky.com.config.js b/sites/sky.com/sky.com.config.js index bdd8b58e..1f9b6fdd 100644 --- a/sites/sky.com/sky.com.config.js +++ b/sites/sky.com/sky.com.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'sky.com', + days: 2, url: function ({ date, channel }) { return `https://epgservices.sky.com/5.2.2/api/2.0/channel/json/${ channel.site_id diff --git a/sites/sky.de/sky.de.config.js b/sites/sky.de/sky.de.config.js index aa24869d..6771dc7b 100644 --- a/sites/sky.de/sky.de.config.js +++ b/sites/sky.de/sky.de.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'sky.de', + days: 2, skip: true, // server returns error 403 (https://github.com/iptv-org/epg/runs/5435899744?check_suite_focus=true) url: `https://www.sky.de/sgtvg/service/getBroadcastsForGrid`, request: { diff --git a/sites/sportsnet.ca/sportsnet.ca.config.js b/sites/sportsnet.ca/sportsnet.ca.config.js index 5a73609f..247902b1 100644 --- a/sites/sportsnet.ca/sportsnet.ca.config.js +++ b/sites/sportsnet.ca/sportsnet.ca.config.js @@ -5,6 +5,7 @@ dayjs.extend(utc) module.exports = { site: 'sportsnet.ca', + days: 2, url: function ({ channel, date }) { return `https://production-cdn.sportsnet.ca/api/schedules?channels=${ channel.site_id diff --git a/sites/starhubtvplus.com/starhubtvplus.com.config.js b/sites/starhubtvplus.com/starhubtvplus.com.config.js index 673256f7..b593afed 100644 --- a/sites/starhubtvplus.com/starhubtvplus.com.config.js +++ b/sites/starhubtvplus.com/starhubtvplus.com.config.js @@ -6,6 +6,7 @@ const SESSION_KEY = '01G2QG0N3RWDNCBA1S5MK1MD2K17CE4431A2' module.exports = { site: 'starhubtvplus.com', + days: 2, request: { headers: { 'x-application-key': APP_KEY, diff --git a/sites/startimestv.com/startimestv.com.config.js b/sites/startimestv.com/startimestv.com.config.js index 1a6f6a81..446a65c4 100644 --- a/sites/startimestv.com/startimestv.com.config.js +++ b/sites/startimestv.com/startimestv.com.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'startimestv.com', + days: 2, url: function ({ channel, date }) { return `https://www.startimestv.com/channeldetail/${channel.site_id}/${date.format( 'YYYY-MM-DD' diff --git a/sites/startv.com/startv.com.config.js b/sites/startv.com/startv.com.config.js index 32119e37..697d7230 100644 --- a/sites/startv.com/startv.com.config.js +++ b/sites/startv.com/startv.com.config.js @@ -12,6 +12,7 @@ const API_ENDPOINT = 'https://www.startv.com/umbraco/api/startvguideproxy' module.exports = { site: 'startv.com', + days: 2, skip: true, // REASON: Request failed with status code 405 url: `${API_ENDPOINT}/GetTvGuideSchedule`, request: { diff --git a/sites/tapdmv.com/tapdmv.com.config.js b/sites/tapdmv.com/tapdmv.com.config.js index 9d1c3c1f..569a86b6 100644 --- a/sites/tapdmv.com/tapdmv.com.config.js +++ b/sites/tapdmv.com/tapdmv.com.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tapdmv.com', + days: 2, url({ channel, date }) { return `https://epg.tapdmv.com/calendar/${ channel.site_id diff --git a/sites/telecablesat.fr/telecablesat.fr.config.js b/sites/telecablesat.fr/telecablesat.fr.config.js index 1157c08b..abfa3dd0 100644 --- a/sites/telecablesat.fr/telecablesat.fr.config.js +++ b/sites/telecablesat.fr/telecablesat.fr.config.js @@ -14,6 +14,7 @@ const API_ENDPOINT = 'https://tv-programme.telecablesat.fr/chaine' module.exports = { site: 'telecablesat.fr', + days: 2, url: function ({ channel, date }) { return `${API_ENDPOINT}/${channel.site_id}/index.html?date=${date.format('YYYY-MM-DD')}` }, diff --git a/sites/telenet.tv/telenet.tv.config.js b/sites/telenet.tv/telenet.tv.config.js index d17288fd..e9dde5d3 100644 --- a/sites/telenet.tv/telenet.tv.config.js +++ b/sites/telenet.tv/telenet.tv.config.js @@ -6,6 +6,7 @@ const API_PROD_ENDPOINT = 'https://prod.spark.telenet.tv/eng/web/linear-service/ module.exports = { site: 'telenet.tv', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/teliatv.ee/teliatv.ee.config.js b/sites/teliatv.ee/teliatv.ee.config.js index 5bd4ab70..2f1569f2 100644 --- a/sites/teliatv.ee/teliatv.ee.config.js +++ b/sites/teliatv.ee/teliatv.ee.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'teliatv.ee', + days: 2, url({ date, channel }) { return `https://api.teliatv.ee/dtv-api/3.2/${channel.lang}/epg/guide?channelIds=${ channel.site_id diff --git a/sites/telkku.com/telkku.com.config.js b/sites/telkku.com/telkku.com.config.js index 78531ee9..37292ad6 100644 --- a/sites/telkku.com/telkku.com.config.js +++ b/sites/telkku.com/telkku.com.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'telkku.com', + days: 2, url: function ({ channel, date }) { const [group] = channel.site_id.split('#') diff --git a/sites/telkussa.fi/telkussa.fi.config.js b/sites/telkussa.fi/telkussa.fi.config.js index fa51a360..87baba16 100644 --- a/sites/telkussa.fi/telkussa.fi.config.js +++ b/sites/telkussa.fi/telkussa.fi.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'telkussa.fi', + days: 2, url: function ({ date, channel }) { return `https://telkussa.fi/API/Channel/${channel.site_id}/${date.format('YYYYMMDD')}` }, diff --git a/sites/telsu.fi/telsu.fi.config.js b/sites/telsu.fi/telsu.fi.config.js index 475e7e2f..8e80be70 100644 --- a/sites/telsu.fi/telsu.fi.config.js +++ b/sites/telsu.fi/telsu.fi.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'telsu.fi', + days: 2, url: function ({ date, channel }) { return `https://www.telsu.fi/${date.format('YYYYMMDD')}/${channel.site_id}` }, diff --git a/sites/tivu.tv/tivu.tv.config.js b/sites/tivu.tv/tivu.tv.config.js index 1a758708..37ac9db3 100644 --- a/sites/tivu.tv/tivu.tv.config.js +++ b/sites/tivu.tv/tivu.tv.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tivu.tv', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/toonamiaftermath.com/toonamiaftermath.com.config.js b/sites/toonamiaftermath.com/toonamiaftermath.com.config.js index 2de581a2..bcb44a8a 100644 --- a/sites/toonamiaftermath.com/toonamiaftermath.com.config.js +++ b/sites/toonamiaftermath.com/toonamiaftermath.com.config.js @@ -7,6 +7,7 @@ const API_ENDPOINT = `https://api.toonamiaftermath.com` module.exports = { site: 'toonamiaftermath.com', + days: 2, async url({ channel, date }) { const playlists = await axios .get( diff --git a/sites/transvision.co.id/transvision.co.id.config.js b/sites/transvision.co.id/transvision.co.id.config.js index bd642041..f49861d1 100644 --- a/sites/transvision.co.id/transvision.co.id.config.js +++ b/sites/transvision.co.id/transvision.co.id.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'transvision.co.id', + days: 2, url: `https://www.transvision.co.id/jadwalacara/epg`, request: { method: 'POST', diff --git a/sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js b/sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js index a46edda1..025d4f06 100644 --- a/sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js +++ b/sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { skip: true, // Error: Connection timeout site: 'turksatkablo.com.tr', + days: 2, url: function ({ date }) { return `https://www.turksatkablo.com.tr/userUpload/EPG/y.json?_=${date.valueOf()}` }, diff --git a/sites/tv.blue.ch/tv.blue.ch.config.js b/sites/tv.blue.ch/tv.blue.ch.config.js index acf291dc..7fe5117a 100644 --- a/sites/tv.blue.ch/tv.blue.ch.config.js +++ b/sites/tv.blue.ch/tv.blue.ch.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { site: 'tv.blue.ch', + days: 2, url: function ({ channel, date }) { return `https://services.sg101.prd.sctv.ch/catalog/tv/channels/list/(ids=${ channel.site_id diff --git a/sites/tv.cctv.com/tv.cctv.com.config.js b/sites/tv.cctv.com/tv.cctv.com.config.js index 1d5cda3b..8f2aa3b4 100644 --- a/sites/tv.cctv.com/tv.cctv.com.config.js +++ b/sites/tv.cctv.com/tv.cctv.com.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tv.cctv.com', + days: 2, url({ channel, date }) { return `https://api.cntv.cn/epg/getEpgInfoByChannelNew?serviceId=tvcctv&c=${ channel.site_id diff --git a/sites/tv.dir.bg/tv.dir.bg.config.js b/sites/tv.dir.bg/tv.dir.bg.config.js index c40096f7..0005e620 100644 --- a/sites/tv.dir.bg/tv.dir.bg.config.js +++ b/sites/tv.dir.bg/tv.dir.bg.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tv.dir.bg', + days: 2, url({ channel, date }) { return `https://tv.dir.bg/tv_channel.php?id=${channel.site_id}&dd=${date.format('DD.MM')}` }, diff --git a/sites/tv.lv/tv.lv.config.js b/sites/tv.lv/tv.lv.config.js index feee6f9f..985c8270 100644 --- a/sites/tv.lv/tv.lv.config.js +++ b/sites/tv.lv/tv.lv.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tv.lv', + days: 2, url: function ({ date, channel }) { return `https://www.tv.lv/programme/listing/none/${date.format( 'DD-MM-YYYY' diff --git a/sites/tv.mail.ru/tv.mail.ru.config.js b/sites/tv.mail.ru/tv.mail.ru.config.js index 4d86b928..e19b989f 100644 --- a/sites/tv.mail.ru/tv.mail.ru.config.js +++ b/sites/tv.mail.ru/tv.mail.ru.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tv.mail.ru', + days: 2, url({ channel, date }) { return `https://tv.mail.ru/ajax/channel/?region_id=70&channel_id=${ channel.site_id diff --git a/sites/tv.movistar.com.pe/tv.movistar.com.pe.config.js b/sites/tv.movistar.com.pe/tv.movistar.com.pe.config.js index 2e3d52eb..039b891f 100644 --- a/sites/tv.movistar.com.pe/tv.movistar.com.pe.config.js +++ b/sites/tv.movistar.com.pe/tv.movistar.com.pe.config.js @@ -3,6 +3,7 @@ const axios = require('axios') module.exports = { site: 'tv.movistar.com.pe', + days: 2, url({ channel, date }) { return `https://contentapi-pe.cdn.telefonica.com/28/default/es-PE/schedules?fields=Pid,Title,Description,ChannelName,LiveChannelPid,Start,End,images.videoFrame,AgeRatingPid&orderBy=START_TIME%3Aa&filteravailability=false&starttime=${date.unix()}&endtime=${date .add(1, 'd') diff --git a/sites/tv.nu/tv.nu.config.js b/sites/tv.nu/tv.nu.config.js index 5f2c06d6..2469fe22 100644 --- a/sites/tv.nu/tv.nu.config.js +++ b/sites/tv.nu/tv.nu.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tv.nu', + days: 2, url: function ({ channel, date }) { return `https://web-api.tv.nu/channels/${channel.site_id}/schedule?date=${date.format( 'YYYY-MM-DD' diff --git a/sites/tv.trueid.net/tv.trueid.net.config.js b/sites/tv.trueid.net/tv.trueid.net.config.js index 68c623fa..a1dbbb5d 100644 --- a/sites/tv.trueid.net/tv.trueid.net.config.js +++ b/sites/tv.trueid.net/tv.trueid.net.config.js @@ -7,6 +7,7 @@ dayjs.extend(utc) module.exports = { delay: 5000, site: 'tv.trueid.net', + days: 2, url: function ({ channel, date }) { return `https://tv.trueid.net/tvguide/all/${channel.site_id}/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/tv.yandex.ru/tv.yandex.ru.config.js b/sites/tv.yandex.ru/tv.yandex.ru.config.js index 79603d4a..f76371d9 100644 --- a/sites/tv.yandex.ru/tv.yandex.ru.config.js +++ b/sites/tv.yandex.ru/tv.yandex.ru.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tv.yandex.ru', + days: 2, url: function ({ date, channel }) { const [region, id] = channel.site_id.split('#') diff --git a/sites/tv.yettel.hu/tv.yettel.hu.config.js b/sites/tv.yettel.hu/tv.yettel.hu.config.js index 7d2447ec..cacbad45 100644 --- a/sites/tv.yettel.hu/tv.yettel.hu.config.js +++ b/sites/tv.yettel.hu/tv.yettel.hu.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tv.yettel.hu', + days: 2, url: function ({ channel, date }) { return `https://dev.mytvback.com/api/19/default/hu-HU/schedules?livechannelpids=${ channel.site_id diff --git a/sites/tv24.co.uk/tv24.co.uk.config.js b/sites/tv24.co.uk/tv24.co.uk.config.js index 993ea2cf..2f01769e 100644 --- a/sites/tv24.co.uk/tv24.co.uk.config.js +++ b/sites/tv24.co.uk/tv24.co.uk.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tv24.co.uk', + days: 2, url: function ({ channel, date }) { return `https://tv24.co.uk/x/channel/${channel.site_id}/0/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/tv24.se/tv24.se.config.js b/sites/tv24.se/tv24.se.config.js index 495e8369..9b2c4f3f 100644 --- a/sites/tv24.se/tv24.se.config.js +++ b/sites/tv24.se/tv24.se.config.js @@ -9,6 +9,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tv24.se', + days: 2, url: function ({ channel, date }) { return `https://tv24.se/x/channel/${channel.site_id}/0/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/tv2go.t-2.net/tv2go.t-2.net.config.js b/sites/tv2go.t-2.net/tv2go.t-2.net.config.js index 10d7b035..53300e5f 100644 --- a/sites/tv2go.t-2.net/tv2go.t-2.net.config.js +++ b/sites/tv2go.t-2.net/tv2go.t-2.net.config.js @@ -12,6 +12,7 @@ const API = { const config = { site: 'tv2go.t-2.net', + days: 2, url({ date, channel }) { const data = config.request.data({ date, channel }) const endpoint = 'client/tv/getEpg' diff --git a/sites/tva.tv/tva.tv.config.js b/sites/tva.tv/tva.tv.config.js index ef341919..46850a48 100644 --- a/sites/tva.tv/tva.tv.config.js +++ b/sites/tva.tv/tva.tv.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tva.tv', + days: 2, url: function ({ date, channel }) { return `https://api.ott.tva.tv/v2/epg/program_events.json?channel_id=${ channel.site_id diff --git a/sites/tvarenasport.com/tvarenasport.com.config.js b/sites/tvarenasport.com/tvarenasport.com.config.js index 8787a6f1..afc71981 100644 --- a/sites/tvarenasport.com/tvarenasport.com.config.js +++ b/sites/tvarenasport.com/tvarenasport.com.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tvarenasport.com', + days: 2, url: function ({ channel, date }) { return `https://www.tvarenasport.com/api/schedule?date=${date.format('DD-MM-YYYY')}` }, diff --git a/sites/tvarenasport.hr/tvarenasport.hr.config.js b/sites/tvarenasport.hr/tvarenasport.hr.config.js index cfcdf83e..464cde62 100644 --- a/sites/tvarenasport.hr/tvarenasport.hr.config.js +++ b/sites/tvarenasport.hr/tvarenasport.hr.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tvarenasport.hr', + days: 2, skip: true, // there is no current program on the website url: function ({ channel, date }) { return `https://www.tvarenasport.hr/api/schedule?date=${date.format('DD-MM-YYYY')}` diff --git a/sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js b/sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js index 33a0d067..a420c5ca 100644 --- a/sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js +++ b/sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js @@ -5,6 +5,7 @@ dayjs.extend(timezone) module.exports = { site: 'tvcubana.icrt.cu', + days: 2, url({ channel, date }) { const daysOfWeek = ['domingo', 'lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado'] diff --git a/sites/tvgid.ua/tvgid.ua.config.js b/sites/tvgid.ua/tvgid.ua.config.js index 70448136..a8e123d5 100644 --- a/sites/tvgid.ua/tvgid.ua.config.js +++ b/sites/tvgid.ua/tvgid.ua.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tvgid.ua', + days: 2, skip: true, // NOTE: the current program is not currently available on the website url: function ({ date, channel }) { return `https://tvgid.ua/channels/${channel.site_id}/${date.format('DDMMYYYY')}/tmall/` diff --git a/sites/tvgids.nl/tvgids.nl.config.js b/sites/tvgids.nl/tvgids.nl.config.js index ef1d18bf..3e5f1b8d 100644 --- a/sites/tvgids.nl/tvgids.nl.config.js +++ b/sites/tvgids.nl/tvgids.nl.config.js @@ -9,6 +9,7 @@ dayjs.extend(timezone) module.exports = { site: 'tvgids.nl', + days: 2, url: function ({ date, channel }) { const path = dayjs.utc().isSame(date, 'd') ? '' : `${date.format('DD-MM-YYYY')}/` diff --git a/sites/tvguide.com/tvguide.com.config.js b/sites/tvguide.com/tvguide.com.config.js index 271bac6e..25206b7d 100644 --- a/sites/tvguide.com/tvguide.com.config.js +++ b/sites/tvguide.com/tvguide.com.config.js @@ -8,6 +8,7 @@ dayjs.extend(timezone) module.exports = { site: 'tvguide.com', + days: 2, url: function ({ date, channel }) { const [providerId, channelSourceIds] = channel.site_id.split('#') const url = `https://cmg-prod.apigee.net/v1/xapi/tvschedules/tvguide/${providerId}/web?start=${date diff --git a/sites/tvguide.myjcom.jp/tvguide.myjcom.jp.config.js b/sites/tvguide.myjcom.jp/tvguide.myjcom.jp.config.js index 94f0601c..ef0174d9 100644 --- a/sites/tvguide.myjcom.jp/tvguide.myjcom.jp.config.js +++ b/sites/tvguide.myjcom.jp/tvguide.myjcom.jp.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tvguide.myjcom.jp', + days: 2, url: function ({ date, channel }) { const id = `${channel.site_id}_${date.format('YYYYMMDD')}` diff --git a/sites/tvhebdo.com/tvhebdo.com.config.js b/sites/tvhebdo.com/tvhebdo.com.config.js index f29d54af..19be5a76 100644 --- a/sites/tvhebdo.com/tvhebdo.com.config.js +++ b/sites/tvhebdo.com/tvhebdo.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tvhebdo.com', + days: 2, url: function ({ channel, date }) { return `https://www.tvhebdo.com/horaire-tele/${channel.site_id}/date/${date.format( 'YYYY-MM-DD' diff --git a/sites/tvheute.at/tvheute.at.config.js b/sites/tvheute.at/tvheute.at.config.js index 17b30680..f9021b14 100644 --- a/sites/tvheute.at/tvheute.at.config.js +++ b/sites/tvheute.at/tvheute.at.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tvheute.at', + days: 2, url({ channel, date }) { return `https://tvheute.at/part/channel-shows/partial/${channel.site_id}/${date.format( 'DD-MM-YYYY' diff --git a/sites/tvim.tv/tvim.tv.config.js b/sites/tvim.tv/tvim.tv.config.js index 8a8c0244..30f12a6a 100644 --- a/sites/tvim.tv/tvim.tv.config.js +++ b/sites/tvim.tv/tvim.tv.config.js @@ -2,6 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tvim.tv', + days: 2, url: function ({ date, channel }) { return `https://www.tvim.tv/script/program_epg?date=${date.format('DD.MM.YYYY')}&prog=${ channel.site_id diff --git a/sites/tvmi.mt/tvmi.mt.config.js b/sites/tvmi.mt/tvmi.mt.config.js index ce32316f..f527ccae 100644 --- a/sites/tvmi.mt/tvmi.mt.config.js +++ b/sites/tvmi.mt/tvmi.mt.config.js @@ -8,6 +8,7 @@ dayjs.extend(timezone) module.exports = { site: 'tvmi.mt', + days: 2, url: function ({ date, channel }) { return `https://tvmi.mt/schedule/${channel.site_id}/${date.format('YYYY-MM-DD')}` }, diff --git a/sites/tvmusor.hu/tvmusor.hu.config.js b/sites/tvmusor.hu/tvmusor.hu.config.js index a489dbdc..475e7b87 100644 --- a/sites/tvmusor.hu/tvmusor.hu.config.js +++ b/sites/tvmusor.hu/tvmusor.hu.config.js @@ -4,6 +4,7 @@ const _ = require('lodash') module.exports = { site: 'tvmusor.hu', + days: 2, url: 'http://www.tvmusor.hu/a/get-events/', request: { method: 'POST', diff --git a/sites/tvpassport.com/tvpassport.com.config.js b/sites/tvpassport.com/tvpassport.com.config.js index 0ee8eb75..3bf9e5e1 100644 --- a/sites/tvpassport.com/tvpassport.com.config.js +++ b/sites/tvpassport.com/tvpassport.com.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tvpassport.com', + days: 2, url({ channel, date }) { return `https://www.tvpassport.com/tv-listings/stations/${channel.site_id}/${date.format( 'YYYY-MM-DD' diff --git a/sites/tvplus.com.tr/tvplus.com.tr.config.js b/sites/tvplus.com.tr/tvplus.com.tr.config.js index c2e79709..39e78a75 100644 --- a/sites/tvplus.com.tr/tvplus.com.tr.config.js +++ b/sites/tvplus.com.tr/tvplus.com.tr.config.js @@ -8,6 +8,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'tvplus.com.tr', + days: 2, url: 'https://izmottvsc23.tvplus.com.tr:33207/EPG/JSON/PlayBillList', request: { method: 'POST', diff --git a/sites/tvprofil.com/tvprofil.com.config.js b/sites/tvprofil.com/tvprofil.com.config.js index 0a65055d..41a4d9f6 100644 --- a/sites/tvprofil.com/tvprofil.com.config.js +++ b/sites/tvprofil.com/tvprofil.com.config.js @@ -3,6 +3,7 @@ const dayjs = require('dayjs') module.exports = { site: 'tvprofil.com', + days: 2, skip: true, // NOTE: server is not stable url: function ({ channel, date }) { const parts = channel.site_id.split('#') diff --git a/sites/tvtv.us/tvtv.us.config.js b/sites/tvtv.us/tvtv.us.config.js index 9eeb500d..b89715d3 100644 --- a/sites/tvtv.us/tvtv.us.config.js +++ b/sites/tvtv.us/tvtv.us.config.js @@ -6,6 +6,7 @@ dayjs.extend(utc) module.exports = { skip: true, // NOTE: return an HTTP error 503 (Service Unavailable) on every request from GitHub server only (https://github.com/iptv-org/epg/issues/1172#issuecomment-1284261669) site: 'tvtv.us', + days: 2, url: function ({ date, channel }) { return `https://www.tvtv.us/api/v1/lineup/USA-NY71652-DEFAULT/grid/${date.toJSON()}/${date .add(1, 'd') diff --git a/sites/useetv.com/useetv.com.config.js b/sites/useetv.com/useetv.com.config.js index 26ab90b1..30c558ef 100644 --- a/sites/useetv.com/useetv.com.config.js +++ b/sites/useetv.com/useetv.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'useetv.com', + days: 2, url({ channel }) { return `https://www.useetv.com/tvod/${channel.site_id}` }, diff --git a/sites/vidio.com/vidio.com.config.js b/sites/vidio.com/vidio.com.config.js index 725a30cd..91984fdf 100644 --- a/sites/vidio.com/vidio.com.config.js +++ b/sites/vidio.com/vidio.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'vidio.com', + days: 2, url({ channel }) { return `https://www.vidio.com/live/${channel.site_id}/schedules` }, diff --git a/sites/virginmedia.com/virginmedia.com.config.js b/sites/virginmedia.com/virginmedia.com.config.js index 8d385a31..54aba9c3 100644 --- a/sites/virginmedia.com/virginmedia.com.config.js +++ b/sites/virginmedia.com/virginmedia.com.config.js @@ -5,6 +5,7 @@ const API_ENDPOINT = `https://prod.oesp.virginmedia.com/oesp/v4/GB/eng/web` module.exports = { site: 'virginmedia.com', + days: 2, url: function ({ date }) { return `${API_ENDPOINT}/programschedules/${date.format('YYYYMMDD')}/1` }, diff --git a/sites/vivacom.bg/vivacom.bg.config.js b/sites/vivacom.bg/vivacom.bg.config.js index c729d6aa..73c9f722 100644 --- a/sites/vivacom.bg/vivacom.bg.config.js +++ b/sites/vivacom.bg/vivacom.bg.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'vivacom.bg', + days: 2, skip: true, // INFO: no longer available url({ date, channel }) { const [page] = channel.site_id.split('#') diff --git a/sites/vtm.be/vtm.be.config.js b/sites/vtm.be/vtm.be.config.js index bb9c0a1d..e9a0db80 100644 --- a/sites/vtm.be/vtm.be.config.js +++ b/sites/vtm.be/vtm.be.config.js @@ -5,6 +5,7 @@ dayjs.extend(isBetween) module.exports = { site: 'vtm.be', + days: 2, url: function ({ channel }) { return `https://vtm.be/tv-gids/${channel.site_id}` }, diff --git a/sites/walesi.com.fj/walesi.com.fj.config.js b/sites/walesi.com.fj/walesi.com.fj.config.js index 9e419eee..04609548 100644 --- a/sites/walesi.com.fj/walesi.com.fj.config.js +++ b/sites/walesi.com.fj/walesi.com.fj.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'walesi.com.fj', + days: 2, skip: true, // the program is no longer available on the website url: 'https://www.walesi.com.fj/wp-admin/admin-ajax.php', request: { diff --git a/sites/watchyour.tv/watchyour.tv.config.js b/sites/watchyour.tv/watchyour.tv.config.js index 6a0afc29..378cf249 100644 --- a/sites/watchyour.tv/watchyour.tv.config.js +++ b/sites/watchyour.tv/watchyour.tv.config.js @@ -3,6 +3,7 @@ const axios = require('axios') module.exports = { site: 'watchyour.tv', + days: 2, url: `https://www.watchyour.tv/guide.json`, request: { cache: { diff --git a/sites/wavve.com/wavve.com.config.js b/sites/wavve.com/wavve.com.config.js index e27e941c..ee5c769c 100644 --- a/sites/wavve.com/wavve.com.config.js +++ b/sites/wavve.com/wavve.com.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'wavve.com', + days: 2, url: function ({ channel, date }) { return `https://apis.pooq.co.kr/live/epgs/channels/${channel.site_id}?startdatetime=${date .tz('Asia/Seoul') diff --git a/sites/xumo.tv/xumo.tv.config.js b/sites/xumo.tv/xumo.tv.config.js index e523770a..1c40304d 100644 --- a/sites/xumo.tv/xumo.tv.config.js +++ b/sites/xumo.tv/xumo.tv.config.js @@ -10,6 +10,7 @@ const client = axios.create({ module.exports = { site: 'xumo.tv', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/zap.co.ao/zap.co.ao.config.js b/sites/zap.co.ao/zap.co.ao.config.js index 54eb9e2a..3495e574 100644 --- a/sites/zap.co.ao/zap.co.ao.config.js +++ b/sites/zap.co.ao/zap.co.ao.config.js @@ -10,6 +10,7 @@ dayjs.extend(customParseFormat) module.exports = { skip: true, // NOTE: Connection timeout site: 'zap.co.ao', + days: 2, url: function ({ date, channel }) { return `https://www.zap.co.ao/_api/channels/${date.format('YYYY-M-D')}/epg.json` }, diff --git a/sites/ziggogo.tv/ziggogo.tv.config.js b/sites/ziggogo.tv/ziggogo.tv.config.js index 2c5c92f6..99589e86 100644 --- a/sites/ziggogo.tv/ziggogo.tv.config.js +++ b/sites/ziggogo.tv/ziggogo.tv.config.js @@ -5,6 +5,7 @@ const API_ENDPOINT = `https://static.spark.ziggogo.tv/eng/web/epg-service-lite` module.exports = { site: 'ziggogo.tv', + days: 2, request: { cache: { ttl: 60 * 60 * 1000 // 1 hour diff --git a/sites/znbc.co.zm/znbc.co.zm.config.js b/sites/znbc.co.zm/znbc.co.zm.config.js index 9973ce61..bde46b48 100644 --- a/sites/znbc.co.zm/znbc.co.zm.config.js +++ b/sites/znbc.co.zm/znbc.co.zm.config.js @@ -11,6 +11,7 @@ dayjs.extend(customParseFormat) module.exports = { site: 'znbc.co.zm', + days: 2, url({ channel }) { return `https://www.znbc.co.zm/${channel.site_id}/` }, From c8dafe20243ea807943cf3096170dad82372c844 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:00 +0300 Subject: [PATCH 32/39] Update update.test.js --- tests/commands/guides/update.test.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/commands/guides/update.test.js b/tests/commands/guides/update.test.js index cd46b4e2..0f335c01 100644 --- a/tests/commands/guides/update.test.js +++ b/tests/commands/guides/update.test.js @@ -26,22 +26,25 @@ starting... loading data/channels.json... loading database/programs.db... found 6 programs -creating tests/__data__/output/guides/allente.se.xml... -creating tests/__data__/output/guides/allente.se.xml.gz... -creating tests/__data__/output/guides/allente.se.json... -creating tests/__data__/output/guides/virginmedia.com.xml... -creating tests/__data__/output/guides/virginmedia.com.xml.gz... -creating tests/__data__/output/guides/virginmedia.com.json... -creating tests/__data__/output/guides/sky.com.xml... -creating tests/__data__/output/guides/sky.com.xml.gz... -creating tests/__data__/output/guides/sky.com.json... +creating tests/__data__/output/guides/da/allente.se.xml... +creating tests/__data__/output/guides/da/allente.se.xml.gz... +creating tests/__data__/output/guides/da/allente.se.json... +creating tests/__data__/output/guides/en/virginmedia.com.xml... +creating tests/__data__/output/guides/en/virginmedia.com.xml.gz... +creating tests/__data__/output/guides/en/virginmedia.com.json... +creating tests/__data__/output/guides/fr/sky.com.xml... +creating tests/__data__/output/guides/fr/sky.com.xml.gz... +creating tests/__data__/output/guides/fr/sky.com.json... +creating tests/__data__/output/guides/en/sky.com.xml... +creating tests/__data__/output/guides/en/sky.com.xml.gz... +creating tests/__data__/output/guides/en/sky.com.json... creating tests/__data__/output/logs/guides/update.log... finished ` ) const uncompressed = glob - .sync('tests/__data__/expected/guides/*.xml') + .sync('tests/__data__/expected/guides/**/*.xml') .map(f => f.replace('tests/__data__/expected/', '')) uncompressed.forEach(filepath => { @@ -49,7 +52,7 @@ finished }) const compressed = glob - .sync('tests/__data__/expected/guides/*.xml.gz') + .sync('tests/__data__/expected/guides/**/*.xml.gz') .map(f => f.replace('tests/__data__/expected/', '')) compressed.forEach(filepath => { @@ -57,7 +60,7 @@ finished }) const json = glob - .sync('tests/__data__/expected/guides/*.json') + .sync('tests/__data__/expected/guides/**/*.json') .map(f => f.replace('tests/__data__/expected/', '')) json.forEach(filepath => { From 2e13a1906af6c71c738bc8fd5aac5d9b24f5b7bd Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:19 +0300 Subject: [PATCH 33/39] Update update.js --- scripts/commands/guides/update.js | 106 ++++++++++++++---------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index caea0871..624c7bb5 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -8,7 +8,7 @@ const CURR_DATE = process.env.CURR_DATE || new Date() const logPath = `${LOGS_DIR}/guides/update.log` -let channels_dic = {} +let api_channels = {} let db_programs = [] let guides = [] @@ -18,9 +18,8 @@ async function main() { logger.info('loading data/channels.json...') await api.channels.load() - let api_channels = await api.channels.all() - api_channels.forEach(channel => { - channels_dic[channel.id] = channel + api.channels.all().forEach(channel => { + api_channels[channel.id] = channel }) logger.info('loading database/programs.db...') @@ -39,26 +38,23 @@ async function main() { main() async function generate() { - let sites = _.groupBy(db_programs, 'site') + let programs = _.groupBy(db_programs, p => + p.titles.length ? `${p.titles[0].lang}/${p.site}` : `_` + ) - for (let site in sites) { - let programs = {} - for (let prog of sites[site]) { - let key = prog.channel + prog.start - if (!programs[key]) { - programs[key] = prog - } else { - programs[key] = merge(programs[key], prog) - } - } + delete programs['_'] - let filename = `${site}` - let { channels } = await save(filename, Object.values(programs)) + for (let filename in programs) { + let { channels } = await save(filename, programs[filename]) for (let channel of channels) { + const configPath = `sites/${channel.site}/${channel.site}.config.js` + const config = require(file.resolve(configPath)) + guides.push({ - lang: channel.lang, site: channel.site, + lang: channel.lang, + days: config.days, channel: channel.id, filename }) @@ -66,58 +62,56 @@ async function generate() { } } -function merge(p1, p2) { - for (let prop in p1) { - if (Array.isArray(p1[prop])) { - p1[prop] = _.orderBy( - _.uniqWith(p1[prop].concat(p2[prop]), _.isEqual), - v => (v.lang === 'en' ? Infinity : 1), - 'desc' - ) - } +async function save(filepath, programs) { + let output = { + channels: [], + programs: [], + date: CURR_DATE } - return p1 -} + for (let programData of programs) { + let channelData = api_channels[programData.channel] + channelData.site = programData.site + channelData.lang = programData.titles[0].lang -async function save(filepath, programs) { - let all_channels = {} - programs.forEach(p => { - p.titles.forEach(t => { - let c = channels_dic[p.channel] - c.site = p.site - c.lang = t.lang - if (!all_channels[p.channel + t.lang]) { - all_channels[p.channel + t.lang] = new Channel(c) - } - }) - }) + let channel = new Channel(channelData) + let program = new Program(programData, channel) - let channels = _.sortBy(Object.values(all_channels), 'id') - channels = _.uniqBy(channels, 'id') + output.channels.push(channel) + output.programs.push(program) + } - programs = _.sortBy(programs, ['channel', 'start']) - programs = programs.map(p => new Program(p, new Channel(channels_dic[p.channel]))) - programs = _.uniqBy(programs, p => p.channel + p.start) + output.channels = _.sortBy(output.channels, 'id') + output.channels = _.uniqBy(output.channels, 'id') + + output.programs = _.sortBy(output.programs, ['channel', 'start']) + output.programs = _.uniqBy(output.programs, p => p.channel + p.start) const xmlFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml` const gzFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml.gz` const jsonFilepath = `${PUBLIC_DIR}/guides/${filepath}.json` logger.info(`creating ${xmlFilepath}...`) - const xmltv = generateXMLTV({ - channels, - programs, - date: CURR_DATE - }) + const xmltv = generateXMLTV(output) await file.create(xmlFilepath, xmltv) logger.info(`creating ${gzFilepath}...`) const compressed = await zip.compress(xmltv) await file.create(gzFilepath, compressed) logger.info(`creating ${jsonFilepath}...`) - await file.create(jsonFilepath, JSON.stringify({ channels, programs })) + await file.create(jsonFilepath, JSON.stringify(output)) - return { - channels: Object.values(all_channels), - programs - } + return output } + +// function merge(p1, p2) { +// for (let prop in p1) { +// if (Array.isArray(p1[prop])) { +// p1[prop] = _.orderBy( +// _.uniqWith(p1[prop].concat(p2[prop]), _.isEqual), +// v => (v.lang === 'en' ? Infinity : 1), +// 'desc' +// ) +// } +// } + +// return p1 +// } From 5217540426714881cb7f07671ba9a475e7fbfea0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:22 +0300 Subject: [PATCH 34/39] Update create.test.js --- tests/commands/queue/create.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/commands/queue/create.test.js b/tests/commands/queue/create.test.js index 6376d5af..efaba63f 100644 --- a/tests/commands/queue/create.test.js +++ b/tests/commands/queue/create.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database CHANNELS_PATH=tests/__data__/input/sites/example.com_*.channels.xml DATA_DIR=tests/__data__/input/data npm run queue:create -- --max-clusters=1 --days=2', + 'DB_DIR=tests/__data__/output/database CHANNELS_PATH=tests/__data__/input/sites/example.com_*.channels.xml DATA_DIR=tests/__data__/input/data CURR_DATE=2022-12-29 npm run queue:create -- --max-clusters=1', { encoding: 'utf8' } ) }) @@ -17,19 +17,19 @@ it('can create queue', () => { output = output.map(i => { i._id = null - i.date = null return i }) expected = expected.map(i => { i._id = null - i.date = null return i }) expect(output).toEqual( expect.arrayContaining([ expect.objectContaining(expected[0]), - expect.objectContaining(expected[1]) + expect.objectContaining(expected[1]), + expect.objectContaining(expected[2]), + expect.objectContaining(expected[3]) ]) ) }) From 76a67e3c10294305a45e20cff6cd4497da6b8319 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:26 +0300 Subject: [PATCH 35/39] Update create.js --- scripts/commands/queue/create.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/commands/queue/create.js b/scripts/commands/queue/create.js index 892fbc16..dd2ae06a 100644 --- a/scripts/commands/queue/create.js +++ b/scripts/commands/queue/create.js @@ -9,11 +9,11 @@ const options = program parser.parseNumber, 256 ) - .option('--days ', 'Number of days for which to grab the program', parser.parseNumber, 1) .parse(process.argv) .opts() const CHANNELS_PATH = process.env.CHANNELS_PATH || 'sites/**/*.channels.xml' +const CURR_DATE = process.env.CURR_DATE || new Date() async function main() { logger.info('Starting...') @@ -33,8 +33,7 @@ async function createQueue() { await api.channels.load().catch(console.error) const files = await file.list(CHANNELS_PATH).catch(console.error) - const utcDate = date.getUTC() - const dates = Array.from({ length: options.days }, (_, i) => utcDate.add(i, 'd')) + const utcDate = date.getUTC(CURR_DATE) for (const filepath of files) { try { const dir = file.dirname(filepath) @@ -44,6 +43,8 @@ async function createQueue() { const config = require(file.resolve(configPath)) if (config.skip) continue const filename = file.basename(filepath) + const days = config.days || 1 + const dates = Array.from({ length: days }, (_, i) => utcDate.add(i, 'd')) for (const channel of channels) { if (!channel.site || !channel.id) continue const found = api.channels.find({ id: channel.id }) From a4bb10c35e07db75a249ef8385a2e68db0e07f00 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:34 +0300 Subject: [PATCH 36/39] Update readme.md --- .readme/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.readme/readme.md b/.readme/readme.md index 216839c7..52e02ac8 100644 --- a/.readme/readme.md +++ b/.readme/readme.md @@ -10,10 +10,10 @@ To load a program guide, all you need to do is copy the link to one or more of t ## Guides - -#include "./.readme/_sites.md" +All guides also have a compressed and JSON version. To load them just change the extension from `.xml` to `.xml.gz` or `.json` respectively. -All guides also have a compressed and JSON version. To download them, simply change the extension from `.xml` to `.xml.gz` or `.json` respectively. + +#include "./.readme/_guides.md" ## Contribution From e8125004c5204320de6bd6e22bb78c5299adb96b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:36 +0300 Subject: [PATCH 37/39] Update .gitignore --- .readme/.gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.readme/.gitignore b/.readme/.gitignore index 9f1700ca..534ce766 100644 --- a/.readme/.gitignore +++ b/.readme/.gitignore @@ -1,3 +1 @@ -_countries.md -_sites.md -_sources.md \ No newline at end of file +_guides.md \ No newline at end of file From 79612eb8464eb9710ba9e39ac97a7f31d33e3fc5 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:38 +0300 Subject: [PATCH 38/39] Update update.js --- scripts/commands/readme/update.js | 52 +++++++++++++++++-------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index 59388b60..fb9a8196 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -1,5 +1,6 @@ const { file, markdown, parser, logger, api, table } = require('../../core') const { program } = require('commander') +const langs = require('langs') const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' @@ -22,7 +23,7 @@ async function main() { main() async function createTable(log) { - let files = _.uniqBy(log, i => i.site + i.channel).reduce((acc, curr) => { + let files = log.reduce((acc, curr) => { if (!acc[curr.filename]) { acc[curr.filename] = { site: curr.site, @@ -37,38 +38,43 @@ async function createTable(log) { return acc }, {}) - let data = [] + let groups = {} for (const filename in files) { const item = files[filename] + const lang = langs.where('1', item.lang) - data.push([ - item.site, - item.lang, + if (!lang) continue + + if (!groups[lang.name]) groups[lang.name] = { lang: lang.name, data: [] } + + groups[lang.name].data.push([ + `${item.site}`, item.channels, `https://iptv-org.github.io/epg/guides/${filename}.xml`, - `${filename}` + `${item.site}` ]) } - data = _.orderBy( - data, - [item => item[0], item => (item[1] === 'en' ? Infinity : item[2])], - ['asc', 'desc'] - ) - data = data.map(i => { - i.splice(1, 1) - return i - }) - data = Object.values(_.groupBy(data, item => item[0])) + groups = _.sortBy(Object.values(groups), 'lang') - const output = table.create(data, [ - 'Site', - 'Channels', - 'EPG', - 'Status                                                   ' - ]) + let guides = '' + for (let group of groups) { + let lang = group.lang + let data = group.data - await file.create('./.readme/_sites.md', output) + data = _.orderBy(data, [item => item[0], item => item[1]], ['asc', 'desc']) + data = Object.values(_.groupBy(data, item => item[0])) + + guides += `### ${lang}\r\n\r\n` + guides += table.create(data, [ + 'Site', + 'Channels', + 'EPG', + 'Status                                                   ' + ]) + guides += `\r\n\r\n` + } + await file.create('./.readme/_guides.md', guides) } async function updateReadme() { From c2ff49c1aaae00873a85c098291c83dfababff17 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 12:41:41 +0300 Subject: [PATCH 39/39] Update update.js --- scripts/commands/api/update.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/commands/api/update.js b/scripts/commands/api/update.js index d4161446..98219680 100644 --- a/scripts/commands/api/update.js +++ b/scripts/commands/api/update.js @@ -16,6 +16,7 @@ async function main() { channel: result.channel, site: result.site, lang: result.lang, + days: result.days, url: `https://iptv-org.github.io/epg/guides/${result.filename}.xml` }) }