mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #729 from iptv-org/add-wavve.com
Add guide from wavve.com
This commit is contained in:
commit
1ff9a647b6
4 changed files with 213 additions and 0 deletions
17
.github/workflows/wavve.com.yml
vendored
Normal file
17
.github/workflows/wavve.com.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
name: wavve.com
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [_trigger]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
jobs:
|
||||||
|
load:
|
||||||
|
uses: ./.github/workflows/_load.yml
|
||||||
|
with:
|
||||||
|
site: ${{github.workflow}}
|
||||||
|
secrets:
|
||||||
|
APP_ID: ${{ secrets.APP_ID }}
|
||||||
|
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
|
69
sites/wavve.com/wavve.com.config.js
Normal file
69
sites/wavve.com/wavve.com.config.js
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
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: 'wavve.com',
|
||||||
|
url: function ({ channel, date }) {
|
||||||
|
return `https://apis.pooq.co.kr/live/epgs/channels/${channel.site_id}?startdatetime=${date
|
||||||
|
.tz('Asia/Seoul')
|
||||||
|
.format('YYYY-MM-DD')}%2000%3A00&enddatetime=${date
|
||||||
|
.tz('Asia/Seoul')
|
||||||
|
.add(1, 'd')
|
||||||
|
.format('YYYY-MM-DD')}%2000%3A00&apikey=E5F3E0D30947AA5440556471321BB6D9&limit=500`
|
||||||
|
},
|
||||||
|
parser: function ({ content }) {
|
||||||
|
let programs = []
|
||||||
|
const items = parseItems(content)
|
||||||
|
items.forEach(item => {
|
||||||
|
programs.push({
|
||||||
|
title: item.title,
|
||||||
|
start: parseStart(item),
|
||||||
|
stop: parseStop(item)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
return programs
|
||||||
|
},
|
||||||
|
async channels({ country }) {
|
||||||
|
const channels = []
|
||||||
|
|
||||||
|
const data = await axios
|
||||||
|
.get(
|
||||||
|
`https://apis.pooq.co.kr/live/epgs?enddatetime=2022-04-17%2019%3A00&genre=all&limit=500&startdatetime=2022-04-17%2016%3A00&apikey=E5F3E0D30947AA5440556471321BB6D9`
|
||||||
|
)
|
||||||
|
.then(r => r.data)
|
||||||
|
.catch(console.log)
|
||||||
|
|
||||||
|
data.list.forEach(i => {
|
||||||
|
channels.push({
|
||||||
|
name: i.channelname,
|
||||||
|
site_id: i.channelid,
|
||||||
|
lang: 'ko'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
return channels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseStart(item) {
|
||||||
|
return dayjs.tz(item.starttime, 'YYYY-MM-DD HH:mm', 'Asia/Seoul')
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseStop(item) {
|
||||||
|
return dayjs.tz(item.endtime, 'YYYY-MM-DD HH:mm', 'Asia/Seoul')
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseItems(content) {
|
||||||
|
const data = JSON.parse(content)
|
||||||
|
if (!data || !Array.isArray(data.list)) return []
|
||||||
|
|
||||||
|
return data.list
|
||||||
|
}
|
45
sites/wavve.com/wavve.com.test.js
Normal file
45
sites/wavve.com/wavve.com.test.js
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
// npm run channels:parse -- --config=sites/wavve.com/wavve.com.config.js --output=sites/wavve.com/wavve.com_kr.channels.xml
|
||||||
|
// npx epg-grabber --config=sites/wavve.com/wavve.com.config.js --channels=sites/wavve.com/wavve.com_kr.channels.xml --output=guide.xml --days=2
|
||||||
|
|
||||||
|
const { parser, url } = require('./wavve.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-17', 'YYYY-MM-DD').startOf('d')
|
||||||
|
const channel = {
|
||||||
|
site_id: 'K01',
|
||||||
|
xmltv_id: 'KBS1TV.kr'
|
||||||
|
}
|
||||||
|
|
||||||
|
it('can generate valid url', () => {
|
||||||
|
expect(url({ channel, date })).toBe(
|
||||||
|
'https://apis.pooq.co.kr/live/epgs/channels/K01?startdatetime=2022-04-17%2000%3A00&enddatetime=2022-04-18%2000%3A00&apikey=E5F3E0D30947AA5440556471321BB6D9&limit=500'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('can parse response', () => {
|
||||||
|
const content = `{"pagecount":"37","count":"37","list":[{"cpid":"C3","channelid":"K01","channelname":"KBS 1TV","channelimage":"img.pooq.co.kr/BMS/Channelimage30/image/KBS-1TV-1.jpg","scheduleid":"K01_20220416223000","programid":"","title":"특파원 보고 세계는 지금","image":"wchimg.wavve.com/live/thumbnail/K01.jpg","starttime":"2022-04-16 22:30","endtime":"2022-04-16 23:15","timemachine":"Y","license":"y","livemarks":[],"targetage":"0","tvimage":"img.pooq.co.kr/BMS/Channelimage30/image/KBS 1TV-2.png","ispreorder":"n","preorderlink":"n","alarm":"n"}]}`
|
||||||
|
const result = parser({ content }).map(p => {
|
||||||
|
p.start = p.start.toJSON()
|
||||||
|
p.stop = p.stop.toJSON()
|
||||||
|
return p
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result).toMatchObject([
|
||||||
|
{
|
||||||
|
start: '2022-04-16T13:30:00.000Z',
|
||||||
|
stop: '2022-04-16T14:15:00.000Z',
|
||||||
|
title: '특파원 보고 세계는 지금'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('can handle empty guide', () => {
|
||||||
|
const result = parser({
|
||||||
|
content: `{"pagecount":"0","count":"0","list":[]}`
|
||||||
|
})
|
||||||
|
expect(result).toMatchObject([])
|
||||||
|
})
|
82
sites/wavve.com/wavve.com_kr.channels.xml
Normal file
82
sites/wavve.com/wavve.com_kr.channels.xml
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<site site="wavve.com">
|
||||||
|
<channels>
|
||||||
|
<channel lang="ko" xmltv_id="Anibox.kr" site_id="C4401">ANIBOX</channel>
|
||||||
|
<channel lang="ko" xmltv_id="AnimaxKorea.kr" site_id="A01">ANIMAX</channel>
|
||||||
|
<channel lang="ko" xmltv_id="Anione.kr" site_id="C4402">ANIONE</channel>
|
||||||
|
<channel lang="ko" xmltv_id="Aniplus.kr" site_id="C6102">애니플러스</channel>
|
||||||
|
<channel lang="ko" xmltv_id="AsiaM.kr" site_id="C5102">AsiaM</channel>
|
||||||
|
<channel lang="ko" xmltv_id="AsiaN.kr" site_id="C5101">AsiaN</channel>
|
||||||
|
<channel lang="ko" xmltv_id="BravoKids.kr" site_id="C6802">브라보키즈</channel>
|
||||||
|
<channel lang="ko" xmltv_id="BTNTV.kr" site_id="F0501">BTN</channel>
|
||||||
|
<channel lang="ko" xmltv_id="CCTV4Asia.cn" site_id="K12">CCTV4</channel>
|
||||||
|
<channel lang="ko" xmltv_id="CGTN.cn" site_id="K25">CGTN</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ChannelA.kr" site_id="C2501">채널A</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ChannelAPlus.kr" site_id="C2502">채널A 플러스</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ChannelChina.kr" site_id="C8401">채널차이나</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ChannelJ.kr" site_id="C5501">채널J</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ChW.kr" site_id="C3901">채널W</channel>
|
||||||
|
<channel lang="ko" xmltv_id="CPBCTV.kr" site_id="F0701">가톨릭평화방송</channel>
|
||||||
|
<channel lang="ko" xmltv_id="CTSTV.kr" site_id="F0601">CTS기독교TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="DaekyoKidsTV.kr" site_id="F1301">대교어린이TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="DiscoveryAsia.us" site_id="C4001">Discovery</channel>
|
||||||
|
<channel lang="ko" xmltv_id="DongaTV.kr" site_id="C7301">동아TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="EBS1TV.kr" site_id="E01">EBS 1</channel>
|
||||||
|
<channel lang="ko" xmltv_id="EBS2TV.kr" site_id="E07">EBS 2</channel>
|
||||||
|
<channel lang="ko" xmltv_id="EBSKids.kr" site_id="E05">EBS 키즈</channel>
|
||||||
|
<channel lang="ko" xmltv_id="EChannel.kr" site_id="C5702">노는채널 E채널</channel>
|
||||||
|
<channel lang="ko" xmltv_id="EdgeTV.kr" site_id="X01">EDGETV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="FunTV.kr" site_id="X02">FUNTV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="GSMyShop.kr" site_id="C4202">GS MY SHOP</channel>
|
||||||
|
<channel lang="ko" xmltv_id="GSShop.kr" site_id="C4201">GS SHOP</channel>
|
||||||
|
<channel lang="ko" xmltv_id="HistoryKorea.kr" site_id="C5901">HISTORY</channel>
|
||||||
|
<channel lang="ko" xmltv_id="HyundaiHomeShopping.kr" site_id="C4101">현대홈쇼핑</channel>
|
||||||
|
<channel lang="ko" xmltv_id="HyundaiHomeShoppingPlusShop.kr" site_id="C4102">현대홈쇼핑+샵</channel>
|
||||||
|
<channel lang="ko" xmltv_id="IndieFilm.kr" site_id="F2601">인디필름</channel>
|
||||||
|
<channel lang="ko" xmltv_id="JNGKorea.kr" site_id="C8101">JNG</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBS1TV.kr" site_id="K01">KBS 1TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBS2TV.kr" site_id="K02">KBS 2TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBSDrama.kr" site_id="K06">KBS DRAMA</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBSJoy.kr" site_id="K04">KBS JOY</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBSLife.kr" site_id="K05">KBS Life</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KBSStory.kr" site_id="K09">KBS Story</channel>
|
||||||
|
<channel lang="ko" xmltv_id="KShopping.kr" site_id="F1401">K SHOPPING</channel>
|
||||||
|
<channel lang="ko" xmltv_id="LifetimeAsia.us" site_id="C5902">LIFETIME</channel>
|
||||||
|
<channel lang="ko" xmltv_id="LotteHomeShopping.kr" site_id="C5601">롯데홈쇼핑</channel>
|
||||||
|
<channel lang="ko" xmltv_id="LotteOneTV.kr" site_id="C5602">롯데홈쇼핑 ONETV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBCDrama.kr" site_id="M02">MBC Drama</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBCEvery1.kr" site_id="M03">MBC Every1</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBCM.kr" site_id="M06">MBC M</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBCOn.kr" site_id="M14">MBC ON</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBCTV.kr" site_id="M01">MBC</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBN.kr" site_id="C2401">MBN</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MBNPlus.kr" site_id="C2402">MBN 플러스</channel>
|
||||||
|
<channel lang="ko" xmltv_id="Mmoney.kr" site_id="F2001">매일경제TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="MTN.kr" site_id="F4301">머니투데이방송</channel>
|
||||||
|
<channel lang="ko" xmltv_id="NationalAssemblyTV.kr" site_id="F3301">국회방송</channel>
|
||||||
|
<channel lang="ko" xmltv_id="NickelodeonKorea.kr" site_id="S10">SBS Nick</channel>
|
||||||
|
<channel lang="ko" xmltv_id="NSHomeshopping.kr" site_id="C8301">NS홈쇼핑</channel>
|
||||||
|
<channel lang="ko" xmltv_id="NSShopPlus.kr" site_id="C8302">NS SHOP+</channel>
|
||||||
|
<channel lang="ko" xmltv_id="PolarisTV.kr" site_id="C6901">폴라리스TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSBiz.kr" site_id="S06">SBS Biz</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSFL.kr" site_id="S22">SBS Fil</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSfunE.kr" site_id="S04">SBS funE</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSGolf.kr" site_id="S05">SBS Golf</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSMTV.kr" site_id="S09">SBS MTV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSPlus.kr" site_id="S03">SBS Plus</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SBSTV.kr" site_id="S01">SBS</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ShinsegaeTVShopping.kr" site_id="C4801">신세계TV쇼핑</channel>
|
||||||
|
<channel lang="ko" xmltv_id="ShoppingNT.kr" site_id="C4901">쇼핑엔티</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SKStoa.kr" site_id="F2701">SK스토아</channel>
|
||||||
|
<channel lang="ko" xmltv_id="SmileTVPlus.kr" site_id="F5602">SmileTV Plus</channel>
|
||||||
|
<channel lang="ko" xmltv_id="Telenovela.kr" site_id="C8701">텔레노벨라</channel>
|
||||||
|
<channel lang="ko" xmltv_id="TheMovie.kr" site_id="F2501">THE MOVIE</channel>
|
||||||
|
<channel lang="ko" xmltv_id="TVAsiaPlus.kr" site_id="F5601">TVasia Plus</channel>
|
||||||
|
<channel lang="ko" xmltv_id="TVChosun.kr" site_id="C2601">TV CHOSUN</channel>
|
||||||
|
<channel lang="ko" xmltv_id="TVChosun2.kr" site_id="C2602">TV CHOSUN2</channel>
|
||||||
|
<channel lang="ko" xmltv_id="Vlending.kr" site_id="C7801">블렌딩 뮤직비디오</channel>
|
||||||
|
<channel lang="ko" xmltv_id="WowTV.kr" site_id="F2101">한국경제TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="YonhapNewsTV.kr" site_id="Y01">연합뉴스TV</channel>
|
||||||
|
<channel lang="ko" xmltv_id="YTN.kr" site_id="C2101">YTN</channel>
|
||||||
|
</channels>
|
||||||
|
</site>
|
Loading…
Add table
Add a link
Reference in a new issue