diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 71cfc179..38d81239 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -32,6 +32,7 @@ jobs: programme-tv.net, programtv.onet.pl, telkussa.fi, + tv.cctv.com, tv.lv, tv.yandex.ru, tvgid.ua, diff --git a/README.md b/README.md index 79f676ca..59a6259f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇧🇬 Bulgariahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇨🇦 Canadahttps://iptv-org.github.io/epg/guides/tvtv.us.guide.xml 🇨🇱 Chilehttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml + 🇨🇳 Chinahttps://iptv-org.github.io/epg/guides/tv.cctv.com.guide.xml 🇨🇴 Colombiahttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇭🇷 Croatiahttps://iptv-org.github.io/epg/guides/maxtv.hrvatskitelekom.hr.guide.xml 🇨🇿 Czechiahttps://iptv-org.github.io/epg/guides/m.tv.sms.cz.guide.xml diff --git a/package-lock.json b/package-lock.json index e847a029..7d9a3824 100644 --- a/package-lock.json +++ b/package-lock.json @@ -503,9 +503,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "engines": [ - "node >=0.6.0" - ] + "engines": ["node >=0.6.0"] }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -776,9 +774,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "engines": [ - "node >=0.6.0" - ], + "engines": ["node >=0.6.0"], "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -1206,9 +1202,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "engines": [ - "node >=0.6.0" - ], + "engines": ["node >=0.6.0"], "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", diff --git a/sites/tv.cctv.com.channels.xml b/sites/tv.cctv.com.channels.xml new file mode 100755 index 00000000..afa3a886 --- /dev/null +++ b/sites/tv.cctv.com.channels.xml @@ -0,0 +1,118 @@ + + + + BTV体育 + BTV卡酷少儿 + BTV国际 + BTV影视 + BTV文艺 + BTV新闻 + BTV生活 + BTV科教 + BTV纪实 + BTV财经 + BTV青少 + CCTV-10科教 + CCTV-11戏曲 + CCTV-12社会与法 + CCTV-13新闻 + CCTV-14少儿 + CCTV-15音乐 + CCTV-1综合 + CCTV-2财经 + CCTV-3文艺 + CCTV-4亚洲 + CCTV-4欧洲 + CCTV-4美洲 + CCTV-5体育 + CCTV-6电影 + CCTV-7军事农业 + CCTV-8电视剧 + CCTV-9纪录 + CCTV世界地理 + CCTV中视购物 + CCTV体育赛事 + CCTV国防军事 + CCTV央视台球 + CCTV央视文化精品 + CCTV女性时尚 + CCTV娱乐 + CCTV怀旧剧场 + CCTV戏曲 + CCTV新科动漫 + CCTV气象 + CCTV电视指南 + CCTV第一剧场 + CCTV老故事 + CCTV风云剧场 + CCTV风云足球 + CCTV风云音乐 + CCTV高尔夫网球 + CETV-1 + CETV-2 + CETV-3 + 东南卫视 + 东方卫视 + 书画 + 云南卫视 + 兵团卫视 + 内蒙古卫视 + 北京卫视 + 卫生健康 + 厦门卫视 + 吉林卫视 + 四川卫视 + 国学(说文解字) + 天元围棋 + 天津1套 + 天津2套 + 天津卫视 + 宁夏卫视 + 宁波一套 + 宁波三套 + 宁波二套 + 宁波五套 + 宁波四套 + 安徽卫视 + 山东卫视 + 山东教育台 + 山西卫视 + 广东卫视 + 广西卫视 + 延边卫视 + 成都新闻综合 + 成都经济资讯服务 + 摄影 + 文物宝库 + 新疆卫视 + 旅游卫视 + 早期教育 + 梨园 + 武术世界 + 江苏卫视 + 江西卫视 + 汽摩 + 河北卫视 + 河南卫视 + 浙江卫视 + 深圳卫视 + 游戏竞技 + 湖北卫视 + 湖南卫视 + 滨海新闻综合 + 滨海综艺频道 + 环球奇观 + 现代女性 + 珠海一套 + 珠海二套 + 甘肃卫视 + 西藏卫视 + 证券资讯 + 贵州卫视 + 辽宁卫视 + 重庆卫视 + 青海卫视 + 靓妆 + 黑龙江卫视 + + \ No newline at end of file diff --git a/sites/tv.cctv.com.config.js b/sites/tv.cctv.com.config.js new file mode 100644 index 00000000..a7f5b328 --- /dev/null +++ b/sites/tv.cctv.com.config.js @@ -0,0 +1,47 @@ +const dayjs = require('dayjs') + +module.exports = { + lang: 'cn', + days: 3, + request: { + timeout: 10000 + }, + site: 'tv.cctv.com', + channels: 'tv.cctv.com.channels.xml', + output: '.gh-pages/guides/tv.cctv.com.guide.xml', + url({ channel, date }) { + return `https://api.cntv.cn/epg/getEpgInfoByChannelNew?serviceId=tvcctv&c=${ + channel.site_id + }&d=${date.format('YYYYMMDD')}` + }, + parser({ content, channel }) { + const programs = [] + const items = parseItems(content, channel) + items.forEach(item => { + const title = item.title + const start = parseStart(item) + const stop = parseStop(item) + programs.push({ + title, + start, + stop + }) + }) + + return programs + } +} + +function parseStop(item) { + return dayjs.unix(item.endTime) +} + +function parseStart(item) { + return dayjs.unix(item.startTime) +} + +function parseItems(content, channel) { + const data = JSON.parse(content) + + return data.data[channel.site_id].list || [] +}