diff --git a/sites/m.tv.sms.cz/__data__/content.html b/sites/m.tv.sms.cz/__data__/content.html new file mode 100644 index 00000000..e4993123 --- /dev/null +++ b/sites/m.tv.sms.cz/__data__/content.html @@ -0,0 +1,241 @@ + + + +tvprogram.cz + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
x
+
+
+
+ + + + + + + +
+
+
+ +
+ + + +
+ +
+ +
+
+
+ +
+ +
+
Cero
+
+
+
+
+ dnes
+ + nyní +
+
+
-
Další den >
< Předchozí den
+
+
+
+ +
+ topZpět nahoru
+ + + +
+
+ Svátek: Bruno
+
+ +
+ logo + sipka dolu +
+ + exitKlasické zobrazení + + +
+
+
+
+
Volba stanice pro zobrazení TVprogramu
+
ČT1
ČT2
Nova
Prima
Prima Cool
Barrandov
Nova Cinema
  + další stanice
+
+
Čas
+
od rána
od 12:00
od 17:00
od 20:00
od nyní
od 22:00
+ + + + + + + + \ No newline at end of file diff --git a/sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml b/sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml index 806d56db..ebff63e3 100644 --- a/sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml +++ b/sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml @@ -3,16 +3,28 @@ BN TV Satelitski AMC Cesko + Animal Planet + Auto Motor und Sport AXN Black AXN AXN White - Animal Planet - Auto Motor und Sport Barrandov Krimi + Canal + Domo + Canal + Séries France + Canal+ Sport 1 + Cartoon Network CBS Reality Europe CGTN Arabic CGTN Russkij + Channel 5 + 5 Kanal + 8 Kanal International + Cinemax 2 + Cinemax CNN Prima News + Cool TV + Credo TV + Crime + Investigation CS Film CS History CS Horror @@ -21,23 +33,9 @@ CT 2 CT 24 CT 3 + CT art CT :D CT Sport - CT art - Canal + Domo - Canal + Séries France - Canal+ Sport 1 - Cartoon Network - Channel 5 - 5 Kanal - 8 Kanal International - Cinemax 2 - Cinemax - Cool TV - Credo TV - Crime + Investigation - DM Sat - DTX Dave UK Deluxe Lounge Deluxe Music @@ -46,9 +44,11 @@ Discovery Channel Discovery Science Disney Channel + DM Sat + Doma Hrvatska Dom Kino Dom Kino Premium International - Doma Hrvatska + DTX Duck TV SD Duck TV Plus Duna TV @@ -61,9 +61,9 @@ EuroNews Russkiy Eurosport 1 Eurosport 2 - Fem 3 FashionBox HD Fast & FunBox HD + Fem 3 FilmBox Action FilmBox Central Europe FilmBox Extra HD Czechia @@ -86,20 +86,20 @@ Gold TV Golf Channel Czechia HaHa TV - HGTV HBO 2 HBO 3 HBO + HGTV + Hír TV + History Channel HNTV + Hobby TV + Home TV HRT 1 HRT 2 HRT 3 HRT 4 HRT International - Hír TV - History Channel - Hobby TV - Home TV H!t Music Channel Hungary Inter Investigation Discovery Europe @@ -107,20 +107,21 @@ Italia 1 Italia 2 Izaura TV + RTVS 1 + JimJam Europe Joj 24 Joj Cinema Joj Family + Jojko Joj Plus Joj Šport Wau TV - RTVS 1 - JimJam Europe - Jojko Jugoton TV Jurnal TV K2 - KHL + Kabel Eins Deutschland Karusel International + KHL Kino Barrandov Kino Polska Kino TV @@ -133,8 +134,6 @@ M2 M4 Sport M5 - MTV 00s - MTV Hungary TV Markíza Dajto TV Doma @@ -142,9 +141,9 @@ Markíza Krimi Mediaset Extra Mezzo Live HD - Mini TV Minimax Czechia Minimax Hungary + Mini TV Mňam TV Mňau TV Movistar Acción @@ -153,6 +152,8 @@ Movistar Drama Movistar Estrenos Movistar Golf + MTV 00s + MTV Hungary Music Box Ukraina Muzika Pervogo Muzsika TV @@ -160,8 +161,8 @@ National Geographic Hrvatska National Geographic National Geographic Wild - Nick Jr Czechia Nickelodeon Czechia + Nick Jr Czechia Nicktoons Czechia Nova Action Nova Cinema @@ -175,6 +176,7 @@ Nova Sport 4 Nova TV Novela TV + N-TV Nuta TV Telekanal O! O2 TV Fotbal @@ -185,20 +187,20 @@ O2 TV Sport 5 O2 TV Sport 6 O2 TV Tenis - ORF 1 - ORF 2 - ORF III Óčko Óčko Black Óčko Expres Óčko Star One + ORF 1 + ORF 2 + ORF III Paramount Network Park TV Pax TV Poehali! International - Polo TV Polonia 1 + Polo TV Polsat Polsat 2 Polsat Café @@ -223,23 +225,6 @@ ProSieben Deutschland Puls 2 Qazaq TV - RBB Berlin - RT Documentary - RTL 2 Hrvatska - RTL 4 - RTL 5 - RTL Crime Hrvatska - RTL Hrvatska - RTL Gold - RTL KETTŐ - RTL HÁROM - RTL - RTL Kockica - RTL Living Hrvatska - RTL Passion Hrvatska - RTL Zwei Deutschland - RTR Planeta - RTVi Europe Racing UK SD Rai 1 Rai 2 @@ -253,12 +238,29 @@ Rai Sport 2 Rai Storia Rai Yoyo + RBB Berlin Rebel Red Carpet Redlight HD Relax Rete 4 Retro Music TV + RT Documentary + RTL 2 Hrvatska + RTL 4 + RTL 5 + RTL Crime Hrvatska + RTL Hrvatska + RTL Gold + RTL HÁROM + RTL + RTL KETTŐ + RTL Kockica + RTL Living Hrvatska + RTL Passion Hrvatska + RTL Zwei Deutschland + RTR Planeta + RTVi Europe Rossiya 24 Sat. 1 Deutschland Sat. 1 Gold Deutschland @@ -289,11 +291,20 @@ Super TV 2 Superyacht TV TA 3 + Tagesschau 24 TBN Polska + Telecafé International + TV Seznam TF 1 + The Fishing & Hunting Channel TLC Pan Regional TMC + Travel Channel Europe + Travelxp HD Europe + RTVS 3 TTV + Tuki TV + Turbo TV TV 1000 Balkan TV 2 TV 2000 @@ -307,8 +318,8 @@ TV Osem TV Barrandov TVC - TVCG Sat TV Central + TVCG Sat Televízia Dolný Kubín TVE Internacional Europa TV Joj @@ -316,65 +327,54 @@ TVN TVN 24 TVN 7 - TVN Turbo TV Natura TV Noe TV Nova + TVN Turbo TVP 1 TVP 2 TVP ABC + TV Paprika Czech Republic + TV Paprika TVP HD TVP Historia TVP Info TVP Kultura + TV Povazie TVP Polonia TVP Rozrywka TVP Seriale TVP Sport - TV Paprika Czech Republic - TV Paprika - TV Povazie TV Puls TV Raj TV Republika Rik TV Romana TVS + TV Severka TV Slovenija 1 TV Slovenija 2 - TV Severka TV TRWAM TV Vega TV Východ - Telecafé International - TV Seznam - The Fishing & Hunting Channel - Travel Channel Europe - Travelxp HD Europe - RTVS 3 - Tuki TV - Turbo TV UA TV Ukraïna 24 Up Network + Viasat Explore + Viasat History + Viasat Nature VTV 1 VTV 2 VTV 3 VTV 4 - Viasat Explore - Viasat History - Viasat Nature - W Polsce PL Water Planet + W Polsce PL Z1 Zoom Zoom TV - Kabel Eins Deutschland - N-TV - Tagesschau 24 3sat - ARD Alpha Anixe HD Serie + ARD Alpha Das Erste Disney Channel Deutschland HR Fernsehen @@ -391,13 +391,13 @@ Aljazeera English Animal Planet UK Arirang World + Babes TV + Baby TV Europe BBC Entertainment Europe BBC Four BBC One BBC Two BBC World News Europe - Babes TV - Baby TV Europe Bloomberg TV Europe Blue Hustler Europe Boomerang Central & Eastern Europe @@ -405,18 +405,17 @@ CBBC CCTV 4 Europe CCTV 9 - CNN International Europe Club MTV + CNN International Europe Crime + Investigation UK - DW Deutsch Desire TV Disney Junior DocuBox HD Dorcel TV Dorcel XXX Dusk + DW Deutsch E4 UK - EWTN Europe Eden English Club TV Erox HD @@ -424,17 +423,18 @@ Eurochannel EuroNews English EuroNews Magyar + EWTN Europe Extasy TV Extreme Sports Channel - Fuel TV FashionTV Europe FightBox HD Film 4 FilmBox Arthouse Worldwide Food Network EMEA France 24 English - Ginx eSports TV International + Fuel TV Gametoon + Ginx eSports TV International Hustler HD Europe Hustler TV Europe ITV London @@ -443,26 +443,26 @@ ITV 4 KBS World Lounge TV + More 4 UK MTV 80s MTV 90s MTV Hits Europe MTV Live MTV UK - More 4 UK MyZen TV MyZen TV 4K NASA TV Public NASA TV UHD Public - NBA TV - NHK World Japan National Geographic HD UK Nautical Channel + NBA TV + NHK World Japan Outdoor Channel Passion XXX Pick UK Playboy TV Europe - RTG TV Reality Kings TV + RTG TV Sky Arts UK Sky Atlantic UK Sky Cinema Action @@ -489,16 +489,16 @@ Sky Sports Premier League UK Sky Witness UK Stars TV - Stingray CMusic Stingray Classica + Stingray CMusic Stingray Djazz SuperOne HD Trace Sport Stars True Amateurs Wild TV #0 - CGTN Español Canal 24 Horas + CGTN Español CGTN Français France 24 Français France 3 @@ -524,14 +524,8 @@ Arcadia TV Arena Sport 1 Arena Sport 2 - CNL Evropa Chuck TV + CNL Evropa Life TV - - - - - - 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 57d2c977..7e01c27a 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 @@ -1,13 +1,6 @@ const cheerio = require('cheerio') const iconv = require('iconv-lite') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const timezone = require('dayjs/plugin/timezone') -const customParseFormat = require('dayjs/plugin/customParseFormat') - -dayjs.extend(utc) -dayjs.extend(timezone) -dayjs.extend(customParseFormat) +const { DateTime } = require('luxon') module.exports = { site: 'm.tv.sms.cz', @@ -25,13 +18,13 @@ module.exports = { const $item = cheerio.load(item) let start = parseStart($item, date) if (prev) { - if (start.isBefore(prev.start)) { - start = start.add(1, 'd') + if (start < prev.start) { + start = start.plus({ days: 1 }) date = date.add(1, 'd') } prev.stop = start } - const stop = start.add(1, 'h') + const stop = start.plus({ hours: 1 }) programs.push({ title: parseTitle($item), description: parseDescription($item), @@ -48,7 +41,7 @@ function parseStart($item, date) { const timeString = $item('div > span').text().trim() const dateString = `${date.format('MM/DD/YYYY')} ${timeString}` - return dayjs.tz(dateString, 'MM/DD/YYYY HH.mm', 'Europe/Prague') + return DateTime.fromFormat(dateString, 'MM/dd/yyyy HH.mm', { zone: 'Europe/Prague' }).toUTC() } function parseDescription($item) { diff --git a/sites/m.tv.sms.cz/m.tv.sms.cz.test.js b/sites/m.tv.sms.cz/m.tv.sms.cz.test.js index 4f98ecc6..49426b41 100644 --- a/sites/m.tv.sms.cz/m.tv.sms.cz.test.js +++ b/sites/m.tv.sms.cz/m.tv.sms.cz.test.js @@ -1,14 +1,16 @@ -// npx epg-grabber --config=sites/m.tv.sms.cz/m.tv.sms.cz.config.js --channels=sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml --output=guide.xml --days=2 +// npx epg-grabber --config=sites/m.tv.sms.cz/m.tv.sms.cz.config.js --channels=sites/m.tv.sms.cz/m.tv.sms.cz.channels.xml --output=guide.xml const { parser, url } = require('./m.tv.sms.cz.config.js') const iconv = require('iconv-lite') +const fs = require('fs') +const path = require('path') const dayjs = require('dayjs') const utc = require('dayjs/plugin/utc') const customParseFormat = require('dayjs/plugin/customParseFormat') dayjs.extend(customParseFormat) dayjs.extend(utc) -const date = dayjs.utc('2022-03-30', 'YYYY-MM-DD').startOf('d') +const date = dayjs.utc('2023-06-11', 'YYYY-MM-DD').startOf('d') const channel = { site_id: 'Cero', xmltv_id: '0.es' @@ -16,54 +18,32 @@ const channel = { it('can generate valid url', () => { expect(url({ channel, date })).toBe( - 'https://m.tv.sms.cz/index.php?stanice=Cero&cas=0&den=2022-03-30' + 'https://m.tv.sms.cz/index.php?stanice=Cero&cas=0&den=2023-06-11' ) }) it('can parse response', () => { - let content = `
` + const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html')) const buffer = iconv.encode(content, 'win1250') - const result = parser({ content, buffer, date }).map(p => { + const results = parser({ buffer, date }).map(p => { p.start = p.start.toJSON() p.stop = p.stop.toJSON() return p }) - expect(result).toMatchObject([ - { - start: '2022-03-30T03:25:00.000Z', - stop: '2022-03-30T04:00:00.000Z', - title: `Před kamerou XIX (8)`, - description: 'Filmový magazín Francie / USA (2022)' - }, - { - start: '2022-03-30T04:00:00.000Z', - stop: '2022-03-30T20:35:00.000Z', - title: `Kubánská spojka`, - description: - 'Na přelomu 80. a 90. let minulého století podnikaly povstalecké skupiny sídlící na Floridě násilné ú...' - }, - { - start: '2022-03-30T20:35:00.000Z', - stop: '2022-03-30T23:15:00.000Z', - title: `Patriot`, - description: - 'Jižní Karolína, 1776. Benjamin Martin, hrdina, který bojoval proti Francouzům a Indiánům, žije v kli...' - }, - { - start: '2022-03-30T23:15:00.000Z', - stop: '2022-03-31T00:25:00.000Z', - title: `Chelsea Handler: Evoluce`, - description: - 'Chelsea Handlerová se po šestileté přestávce vrací ke stand-up comedy ve speciálu HBO Max. Během hod...' - }, - { - start: '2022-03-31T00:25:00.000Z', - stop: '2022-03-31T01:25:00.000Z', - title: `Drápy IV (8)`, - description: 'Kriminální komediální drama USA (2020)' - } - ]) + expect(results[0]).toMatchObject({ + start: '2023-06-11T03:21:00.000Z', + stop: '2023-06-11T04:08:00.000Z', + title: `Conspiraciones al descubierto: La bomba atómica alemana y el hundimiento del Titanic`, + description: 'Documentales' + }) + + expect(results[25]).toMatchObject({ + start: '2023-06-12T02:23:00.000Z', + stop: '2023-06-12T03:23:00.000Z', + title: `Rapa I (6)`, + description: 'Series' + }) }) it('can handle empty guide', () => {