Merge pull request #2524 from iptv-org/bellezaemporium/fixes/i24news

[Fix] i24news.tv
This commit is contained in:
PopeyeTheSai10r 2024-12-19 15:44:28 -08:00 committed by GitHub
commit f7eefb173e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<channels> <channels>
<channel site="i24news.tv" lang="ar" xmltv_id="i24NEWSArabic.il" site_id="ar#world">I24NEWS عربى</channel> <channel site="i24news.tv" lang="ar" xmltv_id="i24NEWSArabic.il" site_id="ar">I24NEWS عربى</channel>
<channel site="i24news.tv" lang="en" xmltv_id="i24NEWSEnglishUSA.il" site_id="en#usa">I24NEWS English (USA)</channel> <channel site="i24news.tv" lang="en" xmltv_id="i24NEWSEnglishUSA.il" site_id="en">I24NEWS English (USA)</channel>
<channel site="i24news.tv" lang="en" xmltv_id="i24NEWSEnglishWorld.il" site_id="en#world">I24NEWS English (World)</channel> <channel site="i24news.tv" lang="fr" xmltv_id="i24NEWSFrench.il" site_id="fr">I24NEWS Français</channel>
<channel site="i24news.tv" lang="fr" xmltv_id="i24NEWSFrench.il" site_id="fr#world">I24NEWS Français</channel> <channel site="i24news.tv" lang="he" xmltv_id="i24NEWSHebrew.il" site_id="he">I24NEWS עברית</channel>
</channels> </channels>

View file

@ -11,9 +11,7 @@ module.exports = {
site: 'i24news.tv', site: 'i24news.tv',
days: 2, days: 2,
url: function ({ channel }) { url: function ({ channel }) {
const [lang, region] = channel.site_id.split('#') return `https://api.i24news.tv/v2/${channel.site_id}/schedules`
return `https://api.i24news.tv/v2/${lang}/schedules/${region}`
}, },
parser: function ({ content, date }) { parser: function ({ content, date }) {
let programs = [] let programs = []

View file

@ -7,12 +7,12 @@ dayjs.extend(utc)
const date = dayjs.utc('2022-03-06', 'YYYY-MM-DD').startOf('d') const date = dayjs.utc('2022-03-06', 'YYYY-MM-DD').startOf('d')
const channel = { const channel = {
site_id: 'ar#', site_id: 'ar',
xmltv_id: 'I24NewsArabic.il' xmltv_id: 'I24NewsArabic.il'
} }
it('can generate valid url', () => { it('can generate valid url', () => {
expect(url({ channel })).toBe('https://api.i24news.tv/v2/ar/schedules/world') expect(url({ channel })).toBe('https://api.i24news.tv/v2/ar/schedules')
}) })
it('can parse response', () => { it('can parse response', () => {