diff --git a/sites/seezntv.com/seezntv.com.channels.xml b/sites/seezntv.com/seezntv.com.channels.xml deleted file mode 100644 index 4a578a25..00000000 --- a/sites/seezntv.com/seezntv.com.channels.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - All the K-POP - 애니박스 - 애니맥스 - 애니원티비 - 애니플러스 - Asia N - 바둑TV - BBC WN - billiards tv - 캐리TV - 채널A - 채널차이나 - 채널 olleh tv - 채널 seezn - 중화TV - 시네마천국 - CJ ONSTYLE - CJ ONSTYLE+ - CNN Int'l - 스페인 국왕컵 축구 - 어린이TV - 디스커버리채널 - 드림웍스 채널 - EBS English(중학3) - EBS kids - EBS플러스1(고등) - EBS플러스2(초등1,2) - FTV - GOLF&PBA - 공영쇼핑 - GS MY SHOP - GS SHOP - 홈&쇼핑 - 허니TV - 현대홈쇼핑 - 현대홈쇼핑+샵 - IB SPORTS - iHQ drama - 인디필름 - JTBC - JTBC2 - JTBC4 - JTBC Golf - JTBC GOLF&SPORTS - K바둑 - 한국경제TV - K쇼핑 - 롯데홈쇼핑 - 롯데OneTV - MBN - Miao Mi - 미드나잇 채널 - Mnet - NAT GEO WILD - NS홈쇼핑 - NS SHOP+ - OBS - OCN - OGN - OLIFE - Olive - 핑크퐁 - 플레이보이 TV - PLAYY 액션 영화 - PLAYY 힐링 영화 - PLAYY 프리미엄 - PLAYY 웰메이드 - 뽀요TV - 프로야구 1 - 프로야구 2 - 프로야구 3 - 프로야구 4 - 프로야구 5 - SBS F!L - SBS 골프 - 스크린골프존 - 신세계쇼핑 - 쇼핑엔티 - SK스토아 - skySports - 텔레노벨라 - THE MOVIE - 토마토증권통 - Tooniverse - TV CHOSUN - tvN - tvN DRAMA - tvN SHOW - tvN STORY - VIKI - W쇼핑 - 연합뉴스TV - YTN - 사이언스TV - - diff --git a/sites/seezntv.com/seezntv.com.config.js b/sites/seezntv.com/seezntv.com.config.js deleted file mode 100644 index 26673108..00000000 --- a/sites/seezntv.com/seezntv.com.config.js +++ /dev/null @@ -1,91 +0,0 @@ -const axios = require('axios') -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: 'seezntv.com', - skip: true, // NOTE: the site was closed on December 31, 2022 - days: 2, - url: function ({ channel }) { - return `https://api.seezntv.com/svc/menu/app6/api/epg_proglist?ch_no=${channel.site_id}&search_day=1` - }, - request: { - headers: { - 'X-DEVICE-TYPE': 'PCWEB', - 'X-DEVICE-MODEL': 'Chrome', - 'X-OS-TYPE': 'Windows', - 'X-OS-VERSION': '11', - transactionId: '0' - } - }, - parser: function ({ content, date }) { - let programs = [] - const items = parseItems(content, date) - items.forEach(item => { - const start = parseStart(item) - let stop = parseStop(item) - if (stop.isBefore(start)) { - stop = stop.add(1, 'd') - } - - programs.push({ - title: parseTitle(item), - start, - stop - }) - }) - - return programs - }, - async channels({ country }) { - const channels = [] - - const data = await axios - .get(`https://api.seezntv.com/svc/menu/app6/api/epg_chlist?category_id=1`, { - headers: { - 'X-DEVICE-TYPE': 'PCWEB', - transactionId: '0' - } - }) - .then(r => r.data.data.list[0]) - .catch(console.log) - - data.list_channel.forEach(i => { - channels.push({ - name: i.service_ch_name, - site_id: i.ch_no, - lang: 'ko' - }) - }) - - return channels - } -} - -function parseTitle(item) { - const name = item.program_name.replace(/\+/g, ' ') - - return decodeURIComponent(name) -} - -function parseStart(item) { - return dayjs.tz(`${item.start_ymd} ${item.start_time}`, 'YYYYMMDD HH:mm', 'Asia/Seoul') -} - -function parseStop(item) { - return dayjs.tz(`${item.start_ymd} ${item.end_time}`, 'YYYYMMDD HH:mm', 'Asia/Seoul') -} - -function parseItems(content, date) { - const data = JSON.parse(content) - if (!data || !data.data || !Array.isArray(data.data.list)) return [] - const d = date.format('YYYYMMDD') - - return data.data.list.filter(i => i.start_ymd === d) -} diff --git a/sites/seezntv.com/seezntv.com.test.js b/sites/seezntv.com/seezntv.com.test.js deleted file mode 100644 index 7514426f..00000000 --- a/sites/seezntv.com/seezntv.com.test.js +++ /dev/null @@ -1,56 +0,0 @@ -// npm run channels:parse -- --config=sites/seezntv.com/seezntv.com.config.js --output=sites/seezntv.com/seezntv.com.channels.xml -// npx epg-grabber --config=sites/seezntv.com/seezntv.com.config.js --channels=sites/seezntv.com/seezntv.com.channels.xml --output=guide.xml --days=2 - -const { parser, url, request } = require('./seezntv.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('2022-04-18', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '285', - xmltv_id: 'MNet.kr' -} - -it('can generate valid url', () => { - expect(url({ channel })).toBe( - 'https://api.seezntv.com/svc/menu/app6/api/epg_proglist?ch_no=285&search_day=1' - ) -}) - -it('can generate valid request headers', () => { - expect(request.headers).toMatchObject({ - 'X-DEVICE-TYPE': 'PCWEB', - 'X-DEVICE-MODEL': 'Chrome', - 'X-OS-TYPE': 'Windows', - 'X-OS-VERSION': '11', - transactionId: '0' - }) -}) - -it('can parse response', () => { - const content = `{"data":{"list":[{"rebroad":"Y","onair_yn":"N","program_subname":"","program_name":"%ED%80%B8%EB%8D%A4+2","block_yn":"N","ch_image_list":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","hd":"Y","frequency":"3","ch_image_detail":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","director":"","live_url":"http://menu.megatvdnp.co.kr:38086/app6/api/epg_play?ch_no=27","start_ymd":"20220418","free_yn":"N","service_ch_name":"Mnet","cast":"태연,이용진","ch_image_onair":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","end_time":"00:00","start_time":"21:50","pack_group_id":"MTVBA","rating":"15","program_id":"C315691275285","live":"N"},{"rebroad":"Y","onair_yn":"N","program_subname":"","program_name":"My+Boyfriend+is+Better","block_yn":"N","ch_image_list":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","hd":"Y","frequency":"4","ch_image_detail":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","director":"","live_url":"http://menu.megatvdnp.co.kr:38086/app6/api/epg_play?ch_no=27","start_ymd":"20220419","free_yn":"N","service_ch_name":"Mnet","cast":"","ch_image_onair":"http://img.megatvdnp.co.kr/uploads/images/channel_image/imgurl/20150910/OMSMNG_20150910145634780.png","end_time":"01:50","start_time":"00:00","pack_group_id":"MTVBA","rating":"15","program_id":"C315691277285","live":"N"}]},"meta":{"code":"200"}}` - const result = parser({ content, date }).map(p => { - p.start = p.start.toJSON() - p.stop = p.stop.toJSON() - return p - }) - - expect(result).toMatchObject([ - { - start: '2022-04-18T12:50:00.000Z', - stop: '2022-04-18T15:00:00.000Z', - title: '퀸덤 2' - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ - content: `{"meta":{"error_type":"Non Content","error_message":"클라이언트의 요구를 처리했으나 전송할 데이터가 없음","code":"204"}}`, - date - }) - expect(result).toMatchObject([]) -})