diff --git a/sites/hd-plus.de/hd-plus.de.channels.xml b/sites/hd-plus.de/hd-plus.de.channels.xml deleted file mode 100644 index 071ddece..00000000 --- a/sites/hd-plus.de/hd-plus.de.channels.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - 1-2-3 TV - 13th Street Deutschland - 3sat - Anixe HD Serie - ARD Alpha - ARTE Deutsch - AstroTV - ATV - ATV 2 - Augsburg TV - Bibel TV - Bloomberg TV Europe - Boomerang Deutschland - Bayerisches Fernsehen Nord - Cartoon Network Deutschland - Channel 21 - Comedy Central Deutschland - Das Erste - Deluxe Music - Deutsches Musik Fernsehen - Die Neue Zeit TV - Discovery Channel Deutschland - Disney Channel Deutschland - DMAX Deutschland - E! Europe - EuroNews Deutsch - Eurosport 1 Germany - EWTN auf Deutsch - Franken Fernsehen - GoTV - Heimatkanal - History Deutschland - Hope TV Deutsch - HR Fernsehen - HSE - HSE Extra - JML Direct - Junior - Juwelo - Kabel Eins Deutschland - Kabel Eins Classics - KIKA - Kinowelt TV - K-TV - L TV - Motorvision TV - MTV Germany - MTV Hits Europe - MTV Live HD - München TV - National Geographic Deutschland - National Geographic Wild Deutschland - Nitro Deutschland - NPO 1 - NPO 2 - N-TV - One - ORF 1 - ORF 2 - ORF III - ORF Sport + - Pearl TV - Phoenix - ProSieben Deutschland - ProSieben Maxx Deutschland - Puls 4 - QVC Zwei - QVC Deutschland - RFO - RheinMain TV - RiC - Romance TV Deutschland - RTL Crime Deutschland - RTL Deutschland - RTL Living Deutschland - RTL Zwei Deutschland - Sat. 1 Deutschland - Sat. 1 Emotions - Sat. 1 Gold Deutschland - Servus TV Deutschland - Sixx Deutschland - Sky Atlantic - Sky Cinema Action - Sky Cinema Hits - Sky Cinema Nostalgie - Sky Comedy - Sky Krimi - Sky Sport 1 - Sky Sport 2 - Sky Sport Austria 1 - Sky Sport Bundesliga 1 - Sky Sport Bundesliga 2 - Sky Sport Bundesliga 3 - Sky Sport Bundesliga 4 - Sky Sport News - Sonnenklar TV - Sony AXN - Sport 1 - Sport 1+ - Sportdigital Fussball - SRF 1 - SR Fernsehen - SRF Zwei - Stingray Classica - Super RTL Deutschland - Syfy Deutschland - Tagesschau 24 - Tele 5 - TLC Germany - TNT Film - TNT Serie - TVA Ostbayern - TV Oberfranken - Universal TV Deutschland - Vox Deutschland - Welt - Welt der Wunder TV - ZDF - ZDF Info - ZDF Neo - diff --git a/sites/hd-plus.de/hd-plus.de.config.js b/sites/hd-plus.de/hd-plus.de.config.js deleted file mode 100644 index dd113878..00000000 --- a/sites/hd-plus.de/hd-plus.de.config.js +++ /dev/null @@ -1,57 +0,0 @@ -const cheerio = require('cheerio') -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) - -module.exports = { - site: 'hd-plus.de', - days: 2, - url({ date, channel }) { - const today = dayjs().utc().startOf('d') - const day = date.diff(today, 'd') - - return `https://www.hd-plus.de/epg/channel/${channel.site_id}?d=${day}` - }, - parser({ content, date }) { - const programs = [] - const items = parseItems(content) - items.forEach(item => { - const prev = programs[programs.length - 1] - const $item = cheerio.load(item) - let start = parseStart($item, date) - if (prev) { - if (start.isBefore(prev.start)) { - start = start.add(1, 'd') - date = date.add(1, 'd') - } - prev.stop = start - } - const stop = start.add(1, 'h') - programs.push({ title: parseTitle($item), start, stop }) - }) - - return programs - } -} - -function parseStart($item, date) { - const timeString = $item('td:nth-child(2)').text().split(' ').pop() - const dateString = `${date.format('YYYY-MM-DD')} ${timeString}` - - return dayjs.tz(dateString, 'YYYY-MM-DD HH:mm', 'Europe/Berlin') -} - -function parseTitle($item) { - return $item('td:nth-child(1) > a').text() -} - -function parseItems(content) { - const $ = cheerio.load(content) - - return $('table > tbody > tr').toArray() -} diff --git a/sites/hd-plus.de/hd-plus.de.test.js b/sites/hd-plus.de/hd-plus.de.test.js deleted file mode 100644 index ff3a4c51..00000000 --- a/sites/hd-plus.de/hd-plus.de.test.js +++ /dev/null @@ -1,54 +0,0 @@ -const { parser, url } = require('./hd-plus.de.config.js') -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('2021-11-25', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '1-2-3-tv-hd', - xmltv_id: '123tv.de' -} -const content = - '
1-2-3.tv HD

1-2-3.tv HD

Titel Ausstrahlungszeit
Ihre Lieblingsuhren Do 25.11 00:00
Ihre Lieblingsuhren Do 25.11 01:00
Flash DealsDo 25.11 06:00
' - -it('can generate valid url', () => { - const today = dayjs.utc().startOf('d') - expect(url({ channel, date: today })).toBe('https://www.hd-plus.de/epg/channel/1-2-3-tv-hd?d=0') -}) - -it('can parse response', () => { - const result = parser({ content, channel, date }).map(p => { - p.start = p.start.toJSON() - p.stop = p.stop.toJSON() - return p - }) - - expect(result).toMatchObject([ - { - start: '2021-11-24T23:00:00.000Z', - stop: '2021-11-25T00:00:00.000Z', - title: 'Ihre Lieblingsuhren' - }, - { - start: '2021-11-25T00:00:00.000Z', - stop: '2021-11-25T05:00:00.000Z', - title: 'Ihre Lieblingsuhren' - }, - { - start: '2021-11-25T05:00:00.000Z', - stop: '2021-11-25T06:00:00.000Z', - title: 'Flash Deals' - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ - date, - channel, - content: '' - }) - expect(result).toMatchObject([]) -}) diff --git a/sites/hd-plus.de/readme.md b/sites/hd-plus.de/readme.md deleted file mode 100644 index e2092854..00000000 --- a/sites/hd-plus.de/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# hd-plus.de - -https://hd-plus.de/ - -### Download the guide - -```sh -npm run grab --- --site=hd-plus.de -``` - -### Test - -```sh -npm test --- hd-plus.de -```