diff --git a/sites/ipko.com/ipko.com.config.js b/sites/ipko.com/ipko.com.config.js index a2f7e2bb..e640983f 100644 --- a/sites/ipko.com/ipko.com.config.js +++ b/sites/ipko.com/ipko.com.config.js @@ -9,14 +9,8 @@ module.exports = { url: function ({ date }) { return `https://www.ipko.com/epg/admin/programs.php?date=${date.format('YYYY-MM-DD')}` }, - async logo({ channel }) { - const data = await axios - .post('https://www.ipko.com/epg/admin/channels.php') - .then(r => r.data) - .catch(console.log) - const item = Object.values(data.element).find(c => c.channel_id == channel.site_id) - - return item ? `https://www.ipko.com/epg/logo/${item.icon}` : null + logo({ channel }) { + return channel.logo }, parser: function ({ content, channel, date }) { let programs = [] diff --git a/sites/ipko.com/ipko.com.test.js b/sites/ipko.com/ipko.com.test.js index 4deddb08..168bf79a 100644 --- a/sites/ipko.com/ipko.com.test.js +++ b/sites/ipko.com/ipko.com.test.js @@ -8,7 +8,11 @@ dayjs.extend(customParseFormat) dayjs.extend(utc) const date = dayjs.utc('2021-10-24', 'YYYY-MM-DD').startOf('d') -const channel = { site_id: '406', xmltv_id: 'RTK1.rs' } +const channel = { + site_id: '406', + xmltv_id: 'RTK1.rs', + logo: 'https://www.ipko.com/epg/logo/stinet.png' +} const content = `{"element":{"1":[{"id":6367,"channel_id":406,"program_name":"Beautiful People 13","name_short":"","description":"Lin largohet nga Nju Meksiko për t'u vendosur në Nju Jork e për t'ia nisur nga fillimi: një punë të re, shtëpi të re dhe njohje të reja. Bashkë me të janë vajzat e saj, Sofia, një 16 vjeçare që shkëlqen në shkollë, dhe Kareni, 20 vjeçare, që do të bë","category":"Sezoni I","duration":150,"day":"Sun","left_distanc":165,"date":"00:55:00"}]}}` it('can generate valid url', () => { @@ -16,13 +20,8 @@ it('can generate valid url', () => { expect(result).toBe('https://www.ipko.com/epg/admin/programs.php?date=2021-10-24') }) -it('can get logo url', done => { - logo({ channel }) - .then(result => { - expect(result).toBe('https://www.ipko.com/epg/logo/stinet.png') - done() - }) - .catch(error => done(error)) +it('can get logo url', () => { + expect(logo({ channel })).toBe('https://www.ipko.com/epg/logo/stinet.png') }) it('can parse response', () => { diff --git a/sites/ipko.com/ipko.com_al.channels.xml b/sites/ipko.com/ipko.com_al.channels.xml index 5dd6bd85..499180c2 100644 --- a/sites/ipko.com/ipko.com_al.channels.xml +++ b/sites/ipko.com/ipko.com_al.channels.xml @@ -1,41 +1,41 @@ - 24 Kitchen Srbija - ABC News - Animal Planet Europe - Arta - Baby TV Europe - Bang Bang - BBC World News Europe - Boomerang Central & Eastern Europe - CNN International Europe - Çufo - Discovery Channel Bulgaria - Discovery Science - DTX East Europe - Eurosport 1 - Explorer Histori - Explorer Natyra - Explorer Shkencë - Film Aksion - Film Dramë - Film Hits - Film Komedi - Film Thriller - Hayat - Junior TV - Kohavision - MTV Live - My Music - National Geographic UK - News 24 - Peace TV English - Rai 1 - Rai 2 - Rai 3 - RTK 1 - RTV 21 - Stinët + 24 Kitchen Srbija + ABC News + Animal Planet Europe + Arta + Baby TV Europe + Bang Bang + BBC World News Europe + Boomerang Central & Eastern Europe + CNN International Europe + Çufo + Discovery Channel Bulgaria + Discovery Science + DTX East Europe + Eurosport 1 + Explorer Histori + Explorer Natyra + Explorer Shkencë + Film Aksion + Film Dramë + Film Hits + Film Komedi + Film Thriller + Hayat + Junior TV + Kohavision + MTV Live + My Music + National Geographic UK + News 24 + Peace TV English + Rai 1 + Rai 2 + Rai 3 + RTK 1 + RTV 21 + Stinët \ No newline at end of file