mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 00:20:08 -04:00
Update tests/__data__
This commit is contained in:
parent
9f93a30988
commit
e54dfb4042
10 changed files with 68 additions and 1 deletions
8
tests/__data__/expected/epg_grab/guide_4.xml
Normal file
8
tests/__data__/expected/epg_grab/guide_4.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?><tv date="20221020">
|
||||
<channel id="Channel1.us"><display-name>Channel 1</display-name><url>https://example.com</url></channel>
|
||||
<channel id="Channel3.us"><display-name>Channel 3</display-name><icon src="https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png"/><url>https://example.com</url></channel>
|
||||
<programme start="20221019043000 +0000" stop="20221019071000 +0000" channel="Channel1.us"><title lang="fr">Programme1 (example.com)</title></programme>
|
||||
<programme start="20221020043000 +0000" stop="20221020071000 +0000" channel="Channel1.us"><title lang="fr">Programme1 (example.com)</title></programme>
|
||||
<programme start="20221019043000 +0000" stop="20221019071000 +0000" channel="Channel3.us"><title lang="it">Program1 (example.com)</title></programme>
|
||||
<programme start="20221020043000 +0000" stop="20221020071000 +0000" channel="Channel3.us"><title lang="it">Program1 (example.com)</title></programme>
|
||||
</tv>
|
1
tests/__data__/input/__data__/blocklist.json
Normal file
1
tests/__data__/input/__data__/blocklist.json
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
1
tests/__data__/input/__data__/categories.json
Normal file
1
tests/__data__/input/__data__/categories.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"id":"auto","name":"Auto"},{"id":"animation","name":"Animation"},{"id":"business","name":"Business"},{"id":"classic","name":"Classic"},{"id":"comedy","name":"Comedy"},{"id":"cooking","name":"Cooking"},{"id":"culture","name":"Culture"},{"id":"documentary","name":"Documentary"},{"id":"education","name":"Education"},{"id":"entertainment","name":"Entertainment"},{"id":"family","name":"Family"},{"id":"general","name":"General"},{"id":"kids","name":"Kids"},{"id":"legislative","name":"Legislative"},{"id":"lifestyle","name":"Lifestyle"},{"id":"movies","name":"Movies"},{"id":"music","name":"Music"},{"id":"news","name":"News"},{"id":"outdoor","name":"Outdoor"},{"id":"relax","name":"Relax"},{"id":"religious","name":"Religious"},{"id":"series","name":"Series"},{"id":"science","name":"Science"},{"id":"shop","name":"Shop"},{"id":"sports","name":"Sports"},{"id":"travel","name":"Travel"},{"id":"weather","name":"Weather"},{"id":"xxx","name":"XXX"}]
|
10
tests/__data__/input/__data__/guides.json
Normal file
10
tests/__data__/input/__data__/guides.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
{
|
||||
"channel": "CNNInternational.us",
|
||||
"feed": "SD",
|
||||
"site": "9tv.co.il",
|
||||
"site_id": "#",
|
||||
"site_name": "CNN (guide)",
|
||||
"lang": "en"
|
||||
}
|
||||
]
|
1
tests/__data__/input/__data__/languages.json
Normal file
1
tests/__data__/input/__data__/languages.json
Normal file
File diff suppressed because one or more lines are too long
10
tests/__data__/input/__data__/streams.json
Normal file
10
tests/__data__/input/__data__/streams.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
{
|
||||
"channel": "CNNInternational.us",
|
||||
"feed": "SD",
|
||||
"url": "https://live.relentlessinnovations.net:1936/imantv/imantv/playlist.m3u8",
|
||||
"referrer": null,
|
||||
"user_agent": null,
|
||||
"quality": "480p"
|
||||
}
|
||||
]
|
1
tests/__data__/input/__data__/timezones.json
Normal file
1
tests/__data__/input/__data__/timezones.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channels>
|
||||
<channel site="example.com" lang="" xmltv_id="" site_id="140">CNN International</channel>
|
||||
<channel site="example.com" lang="" xmltv_id="" site_id="140">CNN International Europe</channel>
|
||||
<channel site="example.com" lang="" xmltv_id="" site_id="141">CNN International</channel>
|
||||
<channel site="example.com" lang="" xmltv_id="" site_id="142">Bravo</channel>
|
||||
</channels>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channels site="example.com">
|
||||
<channel lang="en" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
|
||||
<channel lang="en" xmltv_id="Channel2.us" site_id="142" logo="https://i.imgur.com/qmRnD0M.png">Channel 2</channel>
|
||||
<channel lang="fr" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
|
||||
<channel lang="it" xmltv_id="Channel3.us" site_id="143">Channel 3</channel>
|
||||
</channels>
|
|
@ -0,0 +1,28 @@
|
|||
module.exports = {
|
||||
site: 'example.com',
|
||||
days: 2,
|
||||
request: {
|
||||
timeout: 1000
|
||||
},
|
||||
url: 'https://example.com',
|
||||
parser({ channel, date }) {
|
||||
if (channel.xmltv_id === 'Channel2.us') return []
|
||||
else if (channel.xmltv_id === 'Channel1.us' && channel.lang === 'fr') {
|
||||
return [
|
||||
{
|
||||
title: 'Programme1 (example.com)',
|
||||
start: `${date.format('YYYY-MM-DD')}T04:30:00.000Z`,
|
||||
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
title: 'Program1 (example.com)',
|
||||
start: `${date.format('YYYY-MM-DD')}T04:30:00.000Z`,
|
||||
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue