mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
commit
02cc01202f
3 changed files with 45 additions and 52 deletions
|
@ -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 = []
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="ipko.com">
|
||||
<channels>
|
||||
<channel lang="hr" xmltv_id="24KitchenSrbija.us" site_id="418">24 Kitchen Srbija</channel>
|
||||
<channel lang="hr" xmltv_id="ABCNews.al" site_id="269">ABC News</channel>
|
||||
<channel lang="hr" xmltv_id="AnimalPlanetEurope.us" site_id="403">Animal Planet Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Arta.rs" site_id="423">Arta</channel>
|
||||
<channel lang="hr" xmltv_id="BabyTVEurope.uk" site_id="413">Baby TV Europe</channel>
|
||||
<channel lang="hr" xmltv_id="BangBang.al" site_id="274">Bang Bang</channel>
|
||||
<channel lang="hr" xmltv_id="BBCWorldNewsEurope.uk" site_id="386">BBC World News Europe</channel>
|
||||
<channel lang="hr" xmltv_id="BoomerangCentralEasternEurope.us" site_id="279">Boomerang Central & Eastern Europe</channel>
|
||||
<channel lang="hr" xmltv_id="CNNInternationalEurope.us" site_id="385">CNN International Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Cufo.al" site_id="275">Çufo</channel>
|
||||
<channel lang="hr" xmltv_id="DiscoveryChannelBulgaria.us" site_id="417">Discovery Channel Bulgaria</channel>
|
||||
<channel lang="hr" xmltv_id="DiscoveryScience.us" site_id="421">Discovery Science</channel>
|
||||
<channel lang="hr" xmltv_id="DTXEastEurope.us" site_id="422">DTX East Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Eurosport1.fr" site_id="351">Eurosport 1</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerHistori.al" site_id="296">Explorer Histori</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerNatyra.al" site_id="298">Explorer Natyra</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerShkence.al" site_id="295">Explorer Shkencë</channel>
|
||||
<channel lang="hr" xmltv_id="FilmAksion.al" site_id="291">Film Aksion</channel>
|
||||
<channel lang="hr" xmltv_id="FilmDrame.al" site_id="290">Film Dramë</channel>
|
||||
<channel lang="hr" xmltv_id="FilmHits.al" site_id="415">Film Hits</channel>
|
||||
<channel lang="hr" xmltv_id="FilmKomedi.al" site_id="285">Film Komedi</channel>
|
||||
<channel lang="hr" xmltv_id="FilmThriller.al" site_id="289">Film Thriller</channel>
|
||||
<channel lang="hr" xmltv_id="Hayat.ba" site_id="352">Hayat</channel>
|
||||
<channel lang="hr" xmltv_id="JuniorTV.al" site_id="276">Junior TV</channel>
|
||||
<channel lang="hr" xmltv_id="Kohavision.rs" site_id="312">Kohavision</channel>
|
||||
<channel lang="hr" xmltv_id="MTVLive.us" site_id="303">MTV Live</channel>
|
||||
<channel lang="hr" xmltv_id="MyMusic.al" site_id="273">My Music</channel>
|
||||
<channel lang="hr" xmltv_id="NationalGeographicUK.us" site_id="299">National Geographic UK</channel>
|
||||
<channel lang="hr" xmltv_id="News24.al" site_id="316">News 24</channel>
|
||||
<channel lang="hr" xmltv_id="PeaceTVEnglish.ae" site_id="383">Peace TV English</channel>
|
||||
<channel lang="hr" xmltv_id="Rai1.it" site_id="378">Rai 1</channel>
|
||||
<channel lang="hr" xmltv_id="Rai2.it" site_id="379">Rai 2</channel>
|
||||
<channel lang="hr" xmltv_id="Rai3.it" site_id="380">Rai 3</channel>
|
||||
<channel lang="hr" xmltv_id="RTK1.rs" site_id="402">RTK 1</channel>
|
||||
<channel lang="hr" xmltv_id="RTV21.rs" site_id="255">RTV 21</channel>
|
||||
<channel lang="hr" xmltv_id="Stinet.al" site_id="406">Stinët</channel>
|
||||
<channel lang="hr" xmltv_id="24KitchenSrbija.us" site_id="418" logo="https://www.ipko.com/epg/logo/24kitchen.png">24 Kitchen Srbija</channel>
|
||||
<channel lang="hr" xmltv_id="ABCNews.al" site_id="269" logo="https://www.ipko.com/epg/logo/abc.png">ABC News</channel>
|
||||
<channel lang="hr" xmltv_id="AnimalPlanetEurope.us" site_id="403" logo="https://www.ipko.com/epg/logo/Animal_Planet.png">Animal Planet Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Arta.rs" site_id="423" logo="https://www.ipko.com/epg/logo/arta.png">Arta</channel>
|
||||
<channel lang="hr" xmltv_id="BabyTVEurope.uk" site_id="413" logo="https://www.ipko.com/epg/logo/BabyTV.png">Baby TV Europe</channel>
|
||||
<channel lang="hr" xmltv_id="BangBang.al" site_id="274" logo="https://www.ipko.com/epg/logo/bankbang.png">Bang Bang</channel>
|
||||
<channel lang="hr" xmltv_id="BBCWorldNewsEurope.uk" site_id="386" logo="https://www.ipko.com/epg/logo/BBC_logo.png">BBC World News Europe</channel>
|
||||
<channel lang="hr" xmltv_id="BoomerangCentralEasternEurope.us" site_id="279" logo="https://www.ipko.com/epg/logo/boomerang.png">Boomerang Central & Eastern Europe</channel>
|
||||
<channel lang="hr" xmltv_id="CNNInternationalEurope.us" site_id="385" logo="https://www.ipko.com/epg/logo/cnn.png">CNN International Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Cufo.al" site_id="275" logo="https://www.ipko.com/epg/logo/cufo.png">Çufo</channel>
|
||||
<channel lang="hr" xmltv_id="DiscoveryChannelBulgaria.us" site_id="417" logo="https://www.ipko.com/epg/logo/DSC_pos.png">Discovery Channel Bulgaria</channel>
|
||||
<channel lang="hr" xmltv_id="DiscoveryScience.us" site_id="421" logo="https://www.ipko.com/epg/logo/discoveryscience.png">Discovery Science</channel>
|
||||
<channel lang="hr" xmltv_id="DTXEastEurope.us" site_id="422" logo="https://www.ipko.com/epg/logo/id-xtra-hd.png">DTX East Europe</channel>
|
||||
<channel lang="hr" xmltv_id="Eurosport1.fr" site_id="351" logo="https://www.ipko.com/epg/logo/Eurosport.png">Eurosport 1</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerHistori.al" site_id="296" logo="https://www.ipko.com/epg/logo/histori.png">Explorer Histori</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerNatyra.al" site_id="298" logo="https://www.ipko.com/epg/logo/natyra.png">Explorer Natyra</channel>
|
||||
<channel lang="hr" xmltv_id="ExplorerShkence.al" site_id="295" logo="https://www.ipko.com/epg/logo/shkence.png">Explorer Shkencë</channel>
|
||||
<channel lang="hr" xmltv_id="FilmAksion.al" site_id="291" logo="https://www.ipko.com/epg/logo/aksion.png">Film Aksion</channel>
|
||||
<channel lang="hr" xmltv_id="FilmDrame.al" site_id="290" logo="https://www.ipko.com/epg/logo/drame.png">Film Dramë</channel>
|
||||
<channel lang="hr" xmltv_id="FilmHits.al" site_id="415" logo="https://www.ipko.com/epg/logo/digit_alb_hits.jpg">Film Hits</channel>
|
||||
<channel lang="hr" xmltv_id="FilmKomedi.al" site_id="285" logo="https://www.ipko.com/epg/logo/komedi.png">Film Komedi</channel>
|
||||
<channel lang="hr" xmltv_id="FilmThriller.al" site_id="289" logo="https://www.ipko.com/epg/logo/thriller.png">Film Thriller</channel>
|
||||
<channel lang="hr" xmltv_id="Hayat.ba" site_id="352" logo="https://www.ipko.com/epg/logo/hayattv.png">Hayat</channel>
|
||||
<channel lang="hr" xmltv_id="JuniorTV.al" site_id="276" logo="https://www.ipko.com/epg/logo/Junior_TV_Logo.png">Junior TV</channel>
|
||||
<channel lang="hr" xmltv_id="Kohavision.rs" site_id="312" logo="https://www.ipko.com/epg/logo/ktv.png">Kohavision</channel>
|
||||
<channel lang="hr" xmltv_id="MTVLive.us" site_id="303" logo="https://www.ipko.com/epg/logo/MTV_Live_HD_Logo.png">MTV Live</channel>
|
||||
<channel lang="hr" xmltv_id="MyMusic.al" site_id="273" logo="https://www.ipko.com/epg/logo/My-Music.png">My Music</channel>
|
||||
<channel lang="hr" xmltv_id="NationalGeographicUK.us" site_id="299" logo="https://www.ipko.com/epg/logo/Nat_Geo_HD.png">National Geographic UK</channel>
|
||||
<channel lang="hr" xmltv_id="News24.al" site_id="316" logo="https://www.ipko.com/epg/logo/news24.png">News 24</channel>
|
||||
<channel lang="hr" xmltv_id="PeaceTVEnglish.ae" site_id="383" logo="https://www.ipko.com/epg/logo/Peace_TV_logo.png">Peace TV English</channel>
|
||||
<channel lang="hr" xmltv_id="Rai1.it" site_id="378" logo="https://www.ipko.com/epg/logo/rai1.png">Rai 1</channel>
|
||||
<channel lang="hr" xmltv_id="Rai2.it" site_id="379" logo="https://www.ipko.com/epg/logo/rai2.png">Rai 2</channel>
|
||||
<channel lang="hr" xmltv_id="Rai3.it" site_id="380" logo="https://www.ipko.com/epg/logo/rai3.png">Rai 3</channel>
|
||||
<channel lang="hr" xmltv_id="RTK1.rs" site_id="402" logo="https://www.ipko.com/epg/logo/rtk_1.png">RTK 1</channel>
|
||||
<channel lang="hr" xmltv_id="RTV21.rs" site_id="255" logo="https://www.ipko.com/epg/logo/rtv21.png">RTV 21</channel>
|
||||
<channel lang="hr" xmltv_id="Stinet.al" site_id="406" logo="https://www.ipko.com/epg/logo/stinet.png">Stinët</channel>
|
||||
</channels>
|
||||
</site>
|
Loading…
Add table
Add a link
Reference in a new issue