mirror of
https://github.com/iptv-org/epg
synced 2026-05-03 07:56:58 -04:00
Update tests/__data__
This commit is contained in:
9
tests/__data__/input/epg_grab/custom.channels.xml
Normal file
9
tests/__data__/input/epg_grab/custom.channels.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channels>
|
||||
<channel site="example.com" lang="en" xmltv_id="Channel1.us" site_id="140">Custom Channel 1</channel>
|
||||
<channel site="example.com" lang="en" xmltv_id="Channel2.us" site_id="142" logo="https://i.imgur.com/qmRnD0M.png">Custom Channel 2</channel>
|
||||
<channel site="example.com" lang="fr" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
|
||||
<channel site="example2.com" lang="en" xmltv_id="Channel3.us" site_id="150">Channel 3</channel>
|
||||
<channel site="example2.com" lang="en" xmltv_id="Channel4.us" site_id="152">Channel 4</channel>
|
||||
<channel site="example2.com" lang="fr" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
|
||||
</channels>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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>
|
||||
</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`
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channels site="example2.com">
|
||||
<channel lang="en" xmltv_id="Channel3.us" site_id="150">Channel 3</channel>
|
||||
<channel lang="en" xmltv_id="Channel4.us" site_id="152">Channel 4</channel>
|
||||
<channel lang="fr" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
|
||||
</channels>
|
||||
@@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
site: 'example2.com',
|
||||
url: 'https://example2.com',
|
||||
parser({ channel, date }) {
|
||||
if (channel.lang === 'fr') {
|
||||
return [
|
||||
{
|
||||
title: 'Programme1 (example2.com)',
|
||||
start: `${date.format('YYYY-MM-DD')}T04:40:00.000Z`,
|
||||
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
title: 'Program1 (example2.com)',
|
||||
start: `${date.format('YYYY-MM-DD')}T04:30:00.000Z`,
|
||||
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user