mirror of
https://github.com/iptv-org/epg
synced 2026-05-07 01:46:59 -04:00
Merge pull request #3068 from iptv-org/delete-kan.org.il
Delete kan.org.il
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
[{"title":"ארץ מולדת - בין תורכיה לבריטניה","start_time":"2022-03-06T00:05:37","end_time":"2022-03-06T00:27:12","id":"2598","age_category_desc":"0","epg_name":"ארץ מולדת","title1":"ארץ מולדת - בין תורכיה לבריטניה","chapter_number":"9","live_desc":"קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.","Station_Radio":"0","Station_Id":"20","stationUrlScheme":"kan11://plugin/?type=player&plugin_identifier=kan_player&ds=general-provider%3A%2F%2FfetchData%3Ftype%3DFEED_JSON%26url%3DaHR0cHM6Ly93d3cua2FuLm9yZy5pbC9hcHBLYW4vbGl2ZVN0YXRpb25zLmFzaHg%3D&id=4","program_code":"3671","picture_code":"https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg","program_image":"","station_image":"Logo_Image_Logo20_img__8.jpg","program_id":"","timezone":"2"}]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<channels>
|
|
||||||
<channel site="kan.org.il" site_id="1" lang="he" xmltv_id="Kan11.il@SD">כאן 11</channel>
|
|
||||||
<channel site="kan.org.il" site_id="2" lang="ar" xmltv_id="Makan33.il@SD">مكان</channel>
|
|
||||||
<channel site="kan.org.il" site_id="19" lang="he" xmltv_id="KanEducational.il@SD">חינוכית</channel>
|
|
||||||
</channels>
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
const dayjs = require('dayjs')
|
|
||||||
const utc = require('dayjs/plugin/utc')
|
|
||||||
const timezone = require('dayjs/plugin/timezone')
|
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
|
||||||
|
|
||||||
dayjs.extend(utc)
|
|
||||||
dayjs.extend(timezone)
|
|
||||||
dayjs.extend(customParseFormat)
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
site: 'kan.org.il',
|
|
||||||
days: 2,
|
|
||||||
url: function ({ channel, date }) {
|
|
||||||
return `https://www.kan.org.il/tv-guide/tv_guidePrograms.ashx?stationID=${
|
|
||||||
channel.site_id
|
|
||||||
}&day=${date.format('DD/MM/YYYY')}`
|
|
||||||
},
|
|
||||||
parser: function ({ content }) {
|
|
||||||
let programs = []
|
|
||||||
const items = parseItems(content)
|
|
||||||
items.forEach(item => {
|
|
||||||
programs.push({
|
|
||||||
title: item.title,
|
|
||||||
description: item.live_desc,
|
|
||||||
image: item.picture_code,
|
|
||||||
start: parseStart(item),
|
|
||||||
stop: parseStop(item)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
return programs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseStart(item) {
|
|
||||||
if (!item.start_time) return null
|
|
||||||
|
|
||||||
return dayjs.tz(item.start_time, 'YYYY-MM-DDTHH:mm:ss', 'Asia/Jerusalem')
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseStop(item) {
|
|
||||||
if (!item.end_time) return null
|
|
||||||
|
|
||||||
return dayjs.tz(item.end_time, 'YYYY-MM-DDTHH:mm:ss', 'Asia/Jerusalem')
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseItems(content) {
|
|
||||||
const data = JSON.parse(content)
|
|
||||||
if (!Array.isArray(data)) return []
|
|
||||||
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
const { parser, url } = require('./kan.org.il.config.js')
|
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
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('2022-03-06', 'YYYY-MM-DD').startOf('d')
|
|
||||||
const channel = {
|
|
||||||
site_id: '19',
|
|
||||||
xmltv_id: 'KANEducational.il'
|
|
||||||
}
|
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
|
||||||
expect(url({ channel, date })).toBe(
|
|
||||||
'https://www.kan.org.il/tv-guide/tv_guidePrograms.ashx?stationID=19&day=06/03/2022'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can parse response', () => {
|
|
||||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
|
|
||||||
const result = parser({ content }).map(p => {
|
|
||||||
p.start = p.start.toJSON()
|
|
||||||
p.stop = p.stop.toJSON()
|
|
||||||
return p
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(result).toMatchObject([
|
|
||||||
{
|
|
||||||
start: '2022-03-05T22:05:37.000Z',
|
|
||||||
stop: '2022-03-05T22:27:12.000Z',
|
|
||||||
title: 'ארץ מולדת - בין תורכיה לבריטניה',
|
|
||||||
description:
|
|
||||||
"קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.",
|
|
||||||
image: 'https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can handle empty guide', () => {
|
|
||||||
const result = parser({
|
|
||||||
content: '[]'
|
|
||||||
})
|
|
||||||
expect(result).toMatchObject([])
|
|
||||||
})
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# kan.org.il
|
|
||||||
|
|
||||||
https://kan.org.il/ _[Geo-blocked]_
|
|
||||||
|
|
||||||
### Download the guide
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm run grab --- --sites=kan.org.il
|
|
||||||
```
|
|
||||||
|
|
||||||
### Test
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm test --- kan.org.il
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user