diff --git a/sites/ipko.com/ipko.com.channels.xml b/sites/ipko.com/ipko.com.channels.xml deleted file mode 100644 index 6dc8ea31..00000000 --- a/sites/ipko.com/ipko.com.channels.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - Radio Televizioni 21 HD - Rrokum TV - Rrokum HD - Plus HD - Fox Life - National Geographic - musicAL - Fashion TV - Digi Gold - Albanian Screen - E TV - ON TV - TV Festina - RTL - RTL 2 - N-TV - Al Jazeera - EuroNews - B92 Info - DW TV - Animal Planet HD - Tribuna - First Channel - RTK 1 HD - Top Channel HD - Nickelodeon HD - Fox - Travel Channel - Fine Living - ID Xtra HD - Rai News - Wedding Channel - TVSH - 21 Junior - 21 Popullore - 24 Kitchen - ABC News - Alsat M - Baby TV - Bang Bang - BBC World - Boomerang - CNN int - Cufo TV - Discovery Channel - Discovery Science HD - EuroSport - EXP Histori - EXP Natyra - EXP Shkence - Film Aksion - Film Autor - Film Drame - Film Dy HD - Film Hits - Film Komedi - Film Nje HD - Film Thriller - Hayat TV - Junior TV - Klan Kosova - Kohavision - MTV Live HD - My Music - Nat Geo HD - News 24 - Ora News - Peace TV - Rai 1 - Rai 2 - Rai 3 - Radio Televizioni i Kosoves - Radio Televizioni 21 - TV Dukagjini - Stinet - STV Folk - SuperSonic TV - Top Channel - Top News - TV Arta - Klan TV - Klan TV HD - TV Prizren - \ No newline at end of file diff --git a/sites/ipko.com/ipko.com.config.js b/sites/ipko.com/ipko.com.config.js deleted file mode 100644 index 3d351e3c..00000000 --- a/sites/ipko.com/ipko.com.config.js +++ /dev/null @@ -1,65 +0,0 @@ -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') - -dayjs.extend(utc) - -module.exports = { - site: 'ipko.com', - days: 2, - url: function ({ date }) { - return `https://www.ipko.com/epg/admin/programs.php?date=${date.format('YYYY-MM-DD')}` - }, - parser: function ({ content, channel, date }) { - let programs = [] - const items = parseItems(content, channel) - items.forEach(item => { - const start = parseStart(item, date) - const stop = start.add(item.duration / 3, 'm') - - programs.push({ - title: item.program_name, - description: item.description, - category: item.category, - start: start.toString(), - stop: stop.toString() - }) - }) - - return programs - }, - async channels() { - const axios = require('axios') - - const data = await axios - .get(`https://www.ipko.com/epg/admin/channels.php`) - .then(r => r.data) - .catch(console.log) - - let channels = [] - data.element.forEach(item => { - channels.push({ - lang: 'sq', - site_id: item.channel_id, - name: item.channel_name - }) - }) - - return channels - } -} - -function parseStart(item, date) { - const time = `${date.format('YYYY-MM-DD')} ${item.date}` - - return dayjs.utc(time, 'YYYY-MM-DD HH:mm:ss') -} - -function parseItems(content, channel) { - const data = JSON.parse(content) - const arr = Object.values(data.element) - const items = arr.find(el => { - return el[0] && el[0].channel_id == channel.site_id - }) - - return Array.isArray(items) ? items : [] -} diff --git a/sites/ipko.com/ipko.com.test.js b/sites/ipko.com/ipko.com.test.js deleted file mode 100644 index f1eb5fbc..00000000 --- a/sites/ipko.com/ipko.com.test.js +++ /dev/null @@ -1,38 +0,0 @@ -const { parser, url } = require('./ipko.com.config.js') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const customParseFormat = require('dayjs/plugin/customParseFormat') -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.xk' -} -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', () => { - const result = url({ date }) - expect(result).toBe('https://www.ipko.com/epg/admin/programs.php?date=2021-10-24') -}) - -it('can parse response', () => { - const result = parser({ date, channel, content }) - expect(result).toMatchObject([ - { - start: 'Sun, 24 Oct 2021 00:55:00 GMT', - stop: 'Sun, 24 Oct 2021 01:45:00 GMT', - title: 'Beautiful People 13', - 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' - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ date, channel, content: '{"element":{"1":[{"no":"no"}]}}' }) - expect(result).toMatchObject([]) -}) diff --git a/sites/ipko.com/readme.md b/sites/ipko.com/readme.md deleted file mode 100644 index fa54e122..00000000 --- a/sites/ipko.com/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# ipko.com - -https://www.ipko.com/epg/ - -### Download the guide - -```sh -npm run grab --- --site=ipko.com -``` - -### Update channel list - -```sh -npm run channels:parse --- --config=./sites/ipko.com/ipko.com.config.js --output=./sites/ipko.com/ipko.com.channels.xml -``` - -### Test - -```sh -npm test --- ipko.com -```