mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
commit
9443468cae
2 changed files with 5470 additions and 23 deletions
5447
sites/musor.tv/__data__/content.html
Normal file
5447
sites/musor.tv/__data__/content.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -2,47 +2,47 @@
|
||||||
// npx epg-grabber --config=sites/musor.tv/musor.tv.config.js --channels=sites/musor.tv/musor.tv_hu.channels.xml --output=guide.xml --days=2
|
// npx epg-grabber --config=sites/musor.tv/musor.tv.config.js --channels=sites/musor.tv/musor.tv_hu.channels.xml --output=guide.xml --days=2
|
||||||
|
|
||||||
const { parser, url } = require('./musor.tv.config.js')
|
const { parser, url } = require('./musor.tv.config.js')
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
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')
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
const date = dayjs.utc('2022-03-07', 'YYYY-MM-DD').startOf('d')
|
const date = dayjs.utc('2022-11-20', 'YYYY-MM-DD').startOf('d')
|
||||||
const channel = {
|
const channel = {
|
||||||
site_id: 'DUNA',
|
site_id: 'HATOS_CSATORNA',
|
||||||
xmltv_id: 'DunaTV.hu'
|
xmltv_id: 'Hatoscsatorna.hu'
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
expect(url({ channel, date })).toBe('https://musor.tv/napi/tvmusor/DUNA/2022.03.07')
|
expect(url({ channel, date })).toBe('https://musor.tv/napi/tvmusor/HATOS_CSATORNA/2022.11.20')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can parse response', () => {
|
it('can parse response', () => {
|
||||||
const content = `<!DOCTYPE html><html><head></head><body> <div class="big_content"> <div class="content"> <div class="content_container"> <section> <div class="striped_table striped_table_min_height"> <div class="striped_table_row"> <div class="striped_table_cell_right striped_table_cell_right_padding"> <div class="multicolumn multicolumndayprogarea"> <div class="smartpe_progentry" itemscope itemtype="https://schema.org/BroadcastEvent" title="Tovább a részletes műsorinformációhoz" onclick="clickOn(event,'a_36861422');"> <div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progentry_intable top5"> <div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <time class="smartpe_time" itemprop="startDate" content="2022-03-06GMT23:35:00">00:35</time> </div></div></div></div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <h3 class="smartpe_progtitle_common smartpe_progtitle" itemprop="name"><a id="a_36861422" href="/tvmusor/Havannai_ejszaka/36861422" target="_blank">Havannai éjszaka</a></h3> </div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progshortdesc" itemprop="description"> kubai-francia filmdráma,2014 </div></div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell smartpe_screenshot"> <img src="//musor.tv/img/small/143/14373/Labadrugas.jpg" width="174" height="116" class="" alt="tv-műsor kép: Labadrúgás" title="tv-műsor: Labadrúgás"> </div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progentrylong"> A Havannai éjszaka az első film, amely teljes egészében Kubában forgott és kendőzetlen őszinteséggel beszél egy elveszett generáció minden illúziójáról és csalódottságáról. Amadeo 16 évig nem találkozott legjobb barátaival, fe </div></div></div></div><div class="smartpe_progentry" itemscope itemtype="https://schema.org/BroadcastEvent" title="Tovább a részletes műsorinformációhoz" onclick="clickOn(event,'a_36861419');"> <div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progentry_intable top5"> <div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <time class="smartpe_time" itemprop="startDate" content="2022-03-07GMT01:15:00">02:15</time> </div></div></div></div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <h3 class="smartpe_progtitle_common smartpe_progtitle" itemprop="name"><a id="a_36861419" href="/tvmusor/A_tengeralattjaro_2018_I_1_/36861419" target="_blank">A tengeralattjáró 2018 I./1.</a></h3> </div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progshortdesc" itemprop="description"> német tévéfilmsorozat,2018 </div></div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <img src="/images/etc/pg_16.svg" class="smartpe_rating" width="22" height="22" alt="TV műsor 16 év felettieknek!" title="A TV műsor megtekintése 16 év felettieknek ajánlott!"> <span class="smartpe_hd"><img src="/images/etc/hd_30.png" alt="HD adás" title="A műsor HD minőségben is elérhető!" width="30" height="22"></span> </div></div><div class="smartpe_progentryrow"> <div class="smartpe_progentrycell"> <div class="smartpe_progentrylong"> 8/1.: Új utakonUlrich Wrangel tengeralattjáró-kapitány és emberei összecsapásba keverednek egy amerikai fregatt-tal. Eközben a megszállt Franciaországban az ifjú Klaus Hoffmann kapitány azon igyekszik, hogy méltó legyen apja hírnevé </div></div></div></div></div></div></div></div></section> </div></div></div></body></html>`
|
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'))
|
||||||
const result = parser({ content, date }).map(p => {
|
let results = parser({ content, date })
|
||||||
|
results = results.map(p => {
|
||||||
p.start = p.start.toJSON()
|
p.start = p.start.toJSON()
|
||||||
p.stop = p.stop.toJSON()
|
p.stop = p.stop.toJSON()
|
||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(result).toMatchObject([
|
expect(results[0]).toMatchObject({
|
||||||
{
|
start: '2022-11-19T23:00:00.000Z',
|
||||||
start: '2022-03-06T23:35:00.000Z',
|
stop: '2022-11-19T23:30:00.000Z',
|
||||||
stop: '2022-03-07T01:15:00.000Z',
|
title: `Egészségtér`,
|
||||||
title: `Havannai éjszaka`,
|
description:
|
||||||
icon: 'https://musor.tv/img/small/143/14373/Labadrugas.jpg',
|
'Egészségtér címmel új természetgyógyászattal foglalkozó magazinműsor indult hetente fél órás időtartamban a hatoscsatornán. A műsor derűs, objektív hangvételével és szakmailag magas színvonalú ismeretterjesztő jellegével az e'
|
||||||
description:
|
})
|
||||||
'A Havannai éjszaka az első film, amely teljes egészében Kubában forgott és kendőzetlen őszinteséggel beszél egy elveszett generáció minden illúziójáról és csalódottságáról. Amadeo 16 évig nem találkozott legjobb barátaival, fe'
|
|
||||||
},
|
expect(results[1]).toMatchObject({
|
||||||
{
|
start: '2022-11-19T23:30:00.000Z',
|
||||||
start: '2022-03-07T01:15:00.000Z',
|
stop: '2022-11-20T00:00:00.000Z',
|
||||||
stop: '2022-03-07T01:45:00.000Z',
|
title: `Tradíció Klipek`,
|
||||||
title: `A tengeralattjáró 2018 I./1.`,
|
description: 'Tradíció Klipek Birinyi József néprajzi, vallási, népzenei, népszokás filmjeiből.'
|
||||||
description:
|
})
|
||||||
'8/1.: Új utakonUlrich Wrangel tengeralattjáró-kapitány és emberei összecsapásba keverednek egy amerikai fregatt-tal. Eközben a megszállt Franciaországban az ifjú Klaus Hoffmann kapitány azon igyekszik, hogy méltó legyen apja hírnevé'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can handle empty guide', () => {
|
it('can handle empty guide', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue