Update /sites

This commit is contained in:
freearhey
2023-10-02 06:35:33 +03:00
parent ca254a6df0
commit c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions

View File

@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="mediagenie.co.kr">
<channels>
<channel lang="ko" xmltv_id="CHING.kr" site_id="CHING">CHING</channel>
<channel lang="ko" xmltv_id="ENADRAMA.kr" site_id="ENA_DRAMA">ENA DRAMA</channel>
<channel lang="ko" xmltv_id="ENASTORY.kr" site_id="ENA_STORY">ENA STORY</channel>
<channel lang="ko" xmltv_id="Healthmedi.kr" site_id="Healthmedi">Healthmedi</channel>
<channel lang="ko" xmltv_id="ONT.kr" site_id="ONT">ONT</channel>
</channels>
</site>
<channels>
<channel site="mediagenie.co.kr" lang="ko" xmltv_id="CHING.kr" site_id="CHING">CHING</channel>
<channel site="mediagenie.co.kr" lang="ko" xmltv_id="ENADRAMA.kr" site_id="ENA_DRAMA">ENA DRAMA</channel>
<channel site="mediagenie.co.kr" lang="ko" xmltv_id="ENASTORY.kr" site_id="ENA_STORY">ENA STORY</channel>
<channel site="mediagenie.co.kr" lang="ko" xmltv_id="Healthmedi.kr" site_id="Healthmedi">Healthmedi</channel>
<channel site="mediagenie.co.kr" lang="ko" xmltv_id="ONT.kr" site_id="ONT">ONT</channel>
</channels>

View File

@@ -11,7 +11,6 @@ dayjs.extend(customParseFormat)
module.exports = {
site: 'mediagenie.co.kr',
days: 1,
skip: true, // NOTE: the guide appears on the site after the end of the daily update (https://github.com/iptv-org/epg/actions/workflows/mediagenie.co.kr.yml)
url({ channel, date }) {
return `https://mediagenie.co.kr/${channel.site_id}/?qd=${date.format('YYYYMMDD')}`
},
@@ -22,11 +21,11 @@ module.exports = {
},
parser({ content, date }) {
const programs = []
const items = parseItems(content, date)
const items = parseItems(content)
items.forEach(item => {
const $item = cheerio.load(item)
const prev = programs[programs.length - 1]
const start = parseStart($item, date)
let start = parseStart($item, date)
if (!start) return
if (prev) {
if (start.isBefore(prev.start)) {
@@ -71,7 +70,7 @@ function parseStart($item, date) {
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm', 'Asia/Seoul')
}
function parseItems(content, channel, date) {
function parseItems(content) {
const $ = cheerio.load(content)
return $('.tbl > tbody > tr').toArray()

View File

@@ -1,4 +1,4 @@
// npx epg-grabber --config=sites/mediagenie.co.kr/mediagenie.co.kr.config.js --channels=sites/mediagenie.co.kr/mediagenie.co.kr.channels.xml --output=guide.xml --days=2
// npm run grab -- --site=mediagenie.co.kr
const { parser, url, request } = require('./mediagenie.co.kr.config.js')
const fs = require('fs')
@@ -37,7 +37,7 @@ it('can parse response', () => {
expect(results[0]).toMatchObject({
start: '2023-01-24T15:20:00.000Z',
stop: '2023-01-24T16:34:00.000Z',
title: `대행사`,
title: '대행사',
rating: {
system: 'KMRB',
value: '15'
@@ -47,7 +47,7 @@ it('can parse response', () => {
expect(results[16]).toMatchObject({
start: '2023-01-25T14:27:00.000Z',
stop: '2023-01-25T14:57:00.000Z',
title: `법쩐`,
title: '법쩐',
rating: {
system: 'KMRB',
value: '15'