mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update hd-plus.de
This commit is contained in:
parent
a163c971ff
commit
de1a0711f4
2 changed files with 1 additions and 12 deletions
|
@ -9,7 +9,6 @@ dayjs.extend(timezone)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lang: 'de',
|
|
||||||
site: 'hd-plus.de',
|
site: 'hd-plus.de',
|
||||||
url({ date, channel }) {
|
url({ date, channel }) {
|
||||||
const today = dayjs().utc().startOf('d')
|
const today = dayjs().utc().startOf('d')
|
||||||
|
@ -17,12 +16,6 @@ module.exports = {
|
||||||
|
|
||||||
return `https://www.hd-plus.de/epg/channel/${channel.site_id}?d=${day}`
|
return `https://www.hd-plus.de/epg/channel/${channel.site_id}?d=${day}`
|
||||||
},
|
},
|
||||||
logo({ content }) {
|
|
||||||
const $ = cheerio.load(content)
|
|
||||||
const imgSrc = $('header > img').attr('src')
|
|
||||||
|
|
||||||
return imgSrc ? `https:${imgSrc}` : null
|
|
||||||
},
|
|
||||||
parser({ content, date }) {
|
parser({ content, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const items = parseItems(content)
|
const items = parseItems(content)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// npx epg-grabber --config=sites/hd-plus.de/hd-plus.de.config.js --channels=sites/hd-plus.de/hd-plus.de_de.channels.xml --output=.gh-pages/guides/de/hd-plus.de.epg.xml --days=2
|
// npx epg-grabber --config=sites/hd-plus.de/hd-plus.de.config.js --channels=sites/hd-plus.de/hd-plus.de_de.channels.xml --output=.gh-pages/guides/de/hd-plus.de.epg.xml --days=2
|
||||||
|
|
||||||
const { parser, url, logo } = require('./hd-plus.de.config.js')
|
const { parser, url } = require('./hd-plus.de.config.js')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
@ -19,10 +19,6 @@ it('can generate valid url', () => {
|
||||||
expect(url({ channel, date: today })).toBe('https://www.hd-plus.de/epg/channel/1-2-3-tv-hd?d=0')
|
expect(url({ channel, date: today })).toBe('https://www.hd-plus.de/epg/channel/1-2-3-tv-hd?d=0')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate valid logo url', () => {
|
|
||||||
expect(logo({ content })).toBe('https://cdn.hd-plus.de/senderlogos/bright-cropped/24444-2.png')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can parse response', () => {
|
it('can parse response', () => {
|
||||||
const result = parser({ content, channel, date }).map(p => {
|
const result = parser({ content, channel, date }).map(p => {
|
||||||
p.start = p.start.toJSON()
|
p.start = p.start.toJSON()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue