mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Add site cubmu.com.
Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
parent
babd565098
commit
ed33315fc3
3 changed files with 229 additions and 0 deletions
96
sites/cubmu.com/cubmu.com.channels.xml
Normal file
96
sites/cubmu.com/cubmu.com.channels.xml
Normal file
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channels>
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857f48ecd2017f5e98c9fe13e6">IDCyclist</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060a6dbbb40b8">HowTo</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060a4379740b7">Xtrem Sports</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060aab83c40b9">Travel TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060ae0aa740bb">Movies News</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060afdef540bc">Sports TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6857fe540a1018060b2307340bd">Speed TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858a18e485018a2acb3fb766e2">Ngeri</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858afb4c71018b03cdfe37152e">Smurf TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858afb4c71018b03cfbc2a1530">Camp Spoopy</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858afb4c71018b03d141851531">Crema.TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858afb4c71018b47d7d80c0a40">Trial Channel</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858b8b3621018b9316ce98197c">Vakansi</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c68578b331d80178b98f30f521de">Historical Sports</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c68587f789fe018828ba38c2279e">Golf Premium</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c68587f789fe0188561deef4705f">Blast CS GO 2023</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff0490184616a87db3e62">Series Zone</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff0490184616d5ba53e65">Song TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846163f6883d8f">Gem TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846166f4d93e5e">Cartoon TV Classics</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846167c11f3e5f">Fitness TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846168c0fc3e60">Nature Vision TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846169a38c3e61">Wai Lana</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff0490184616302e33d8e">Lesson Level 1 English US</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c685840ff04901846165390f3e5c">Joke</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b6a98a62be4">Cooking TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b6c3a722be5">Gossip</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b6deaeb2be6">Clubbing TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b64d0742be1">Cartoon TV Premium</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b65fa882be2">Cartoon TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b703a262be7">Football TV</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827b6764522be3">Knowledge+</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858262bb8001827d54aae33d56">BALAP</channel-->
|
||||
<!--channel site="cubmu.com" lang="id" xmltv_id="" site_id="4028c6858119921801816b52686d5e62">Pretty TV</channel-->
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ABCAustralia.au" site_id="4028c68574537fcd0174be3b835358d5">ABC Australia</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="AlJazeeraChannel.qa" site_id="4028c68574537fcd0174bdfe22ee5150">Al Jazeera</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ANTV.id" site_id="4028c68585a0014401863437adf82243">ANTV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ArirangTV.kr" site_id="4028c68574537fcd0174be1c9566571f">Arirang</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="BeritaSatu.id" site_id="4028c68574537fcd0174be56c7d858fd">BTV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="BioskopIndonesia.id" site_id="4028c68574537fcd0174be26e4325724">Bioskop Indonesia</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="BoonieCubsTV.us" site_id="4028c6858afb4c71018b03cd4a0e152d">Boonie Cubs TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CCTV4Asia.cn" site_id="4028c6857f48ecd2017f5e95744613e2">CCTV 4</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CGTN.cn" site_id="4028c68574537fcd0174be13661a571d">CGTN</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CGTNDocumentary.cn" site_id="4028c68574537fcd0174be2463495723">CGTN Documentary</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CNA.sg" site_id="4028c68574537fcd0174bdfa7e13514f">CNA</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CNBCIndonesia.id" site_id="4028c68574537fcd0174be4b82c758dc">CNBC Indonesia</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="CNNIndonesia.id" site_id="4028c68574537fcd0174be4997e958db">CNN Indonesia</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="DAAITV.id" site_id="4028c68574537fcd0174be5a48505902">DAAI TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ducktv.sk" site_id="4028c6858afb4c71018b03ced8f7152f">Duck TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="DuniaAnak.id" site_id="4028c68574537fcd0174be1f09275720">Dunia Anak</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="DuniaLain.id" site_id="4028c68574537fcd0174be2db0a25728">Dunia Lain</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="EatNGo.id" site_id="4028c68574537fcd0174be3daa5c58d6">Eat N Go</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="EnglishClubTV.uk" site_id="4028c685840ff0490184616205703d8d">English Club TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="EuronewsEnglish.fr" site_id="4028c6857e04fca5017f310a21613e4e">Euronews</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="FashionTVAsia.fr" site_id="4028c6857fe540a1018060ac364140ba">Fashion TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="Fight.us" site_id="4028c6857fe540a1018060a0c34340b6">Fight TV Premium</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="France24English.fr" site_id="4028c68574537fcd0174be0c2f975152">France 24</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="GolfPlus.fr" site_id="4028c6857e04fca5017ec40cec31736f">Golf+</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="GTV.id" site_id="4028c68574537fcd0174be52f87b58f2">GTV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="Indosiar.id" site_id="4028c68574537fcd0174be4f342858e9">Indosiar</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="JakTV.id" site_id="4028c68574537fcd0174be55099d58fa">Jak tv</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="JTV.id" site_id="4028c6857e04fca5017ec407d96b7362">jtv</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="Khazanah.id" site_id="4028c68574537fcd0174be3fbd2f58d7">Khazanah</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="KompasTV.id" site_id="4028c68574537fcd0174be58644c5901">Kompas TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="LinguaChannel.id" site_id="4028c68574537fcd0174be21d3755722">Lingua</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="MetroTV.id" site_id="4028c68574537fcd0174be4783ff58da">MetroTV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="MNCTV.id" site_id="4028c68574537fcd0174be5ef52a5904">MNC TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="MusikIndonesia.id" site_id="4028c6857e04fca5017ec528dc550e98">Musik Indonesia</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="NabawiTV.id" site_id="4028c68588e2da5a01892e47e9d64b5e">Nabawi TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="NET.id" site_id="4028c685758bcfff01776c4ea3520a72">NET TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="nsert.id" site_id="4028c68574537fcd0174be292d655725">!nsert</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="NusantaraTV.id" site_id="4028c685758bcfff0175de4453980cf5">Nusantara</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="OneTV.in" site_id="4028c685840ff04901846166123a3e5d">One TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="OutdoorAmerica.us" site_id="4028c6857f48ecd2017f5ea03c5313e9">Outdoor America</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="PijarTV.id" site_id="4028c68574f658b1017506741c665418">Pijar TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="PlutoTVGamingTV.us" site_id="4028c6858119921801816b5359d15e63">Gaming TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ProWrestlingTV.us" site_id="4028c6857f48ecd2017f5ea165a213eb">Pro Wrestling TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="QuranTV.sa" site_id="4028c68574f658b101750641670b540e">Al Quran Al Kareem</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="RajawaliTV.id" site_id="4028c68574537fcd0174be5cd0b15903">rtv</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="RCTI.id" site_id="4028c68574537fcd0174be51092e58f1">RCTI</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="RT.ru" site_id="4028c68574537fcd0174be167d8a571e">Russia Today</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="SCTV.id" site_id="4028c68574537fcd0174be4d55ce58dd">SCTV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="SeruChannel.id" site_id="4028c68574537fcd0174be2b660c5727">Channel Seru!</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="SuperyachtTV.mc" site_id="4028c6857fe540a1018060b4163a40be">SuperYacht TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="ToonGoggles.us" site_id="4028c6857f48ecd2017f5e94be3213e1">Toon Goggles</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="Trans7.id" site_id="4028c68574537fcd0174be45631158d9">Trans 7</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="TransTV.id" site_id="4028c68574537fcd0174be43042758d8">Trans TV</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="TV5MondeAsia.fr" site_id="4028c68574537fcd0174be39494458d4">TV5 Monde</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="TV9Nusantara.id" site_id="4028c68574f658b101750667e76e5415">TV9</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="TVMu.id" site_id="4028c68574f658b1017506651f835414">tv Mu</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="tvOne.id" site_id="4028c68585a001440186343e1a562244">tvOne</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="TVRINasional.id" site_id="4028c68574537fcd0174be6135dc5905">TVRI</channel>
|
||||
<channel site="cubmu.com" lang="id" xmltv_id="WION.in" site_id="4028c6857f48ecd2017f5e9c23f413e8">Wion TV</channel>
|
||||
</channels>
|
98
sites/cubmu.com/cubmu.com.config.js
Normal file
98
sites/cubmu.com/cubmu.com.config.js
Normal file
|
@ -0,0 +1,98 @@
|
|||
const dayjs = require('dayjs')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
|
||||
dayjs.extend(timezone)
|
||||
dayjs.extend(utc)
|
||||
|
||||
module.exports = {
|
||||
site: 'cubmu.com',
|
||||
days: 2,
|
||||
url: function ({ channel, date }) {
|
||||
return `https://servicebuss.transvision.co.id/v2/cms/getEPGData?app_id=cubmu&tvs_platform_id=standalone&schedule_date=${date.format('YYYY-MM-DD')}&channel_id=${channel.site_id}`
|
||||
},
|
||||
parser({ content }) {
|
||||
const programs = []
|
||||
const items = parseItems(content)
|
||||
items.forEach(item => {
|
||||
programs.push({
|
||||
title: parseTitle(item),
|
||||
description: parseDescription(item),
|
||||
episode: parseEpisode(item),
|
||||
start: parseStart(item).toISOString(),
|
||||
stop: parseStop(item).toISOString()
|
||||
})
|
||||
})
|
||||
|
||||
return programs
|
||||
},
|
||||
async channels() {
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
const result = await axios
|
||||
.get('https://cubmu.com/live-tv')
|
||||
.then(response => response.data)
|
||||
.catch(console.error)
|
||||
|
||||
const $ = cheerio.load(result)
|
||||
|
||||
// retrieve service api data
|
||||
const config = JSON.parse($('#__NEXT_DATA__').text()).runtimeConfig || {}
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
Origin: 'https://cubmu.com',
|
||||
Referer: 'https://cubmu.com/live-tv'
|
||||
}
|
||||
}
|
||||
// login to service bus
|
||||
const token = await axios
|
||||
.post(`https://servicebuss.transvision.co.id/tvs/login/external?email=${config.email}&password=${config.password}&deviceId=${config.deviceId}&deviceType=${config.deviceType}&deviceModel=${config.deviceModel}&deviceToken=&serial=&platformId=${config.platformId}`, options)
|
||||
.then(response => response.data)
|
||||
.catch(console.error)
|
||||
// list channels
|
||||
const subscribedChannels = await axios
|
||||
.post(`https://servicebuss.transvision.co.id/tvs/subscribe_product/list?platformId=${config.platformId}`, options)
|
||||
.then(response => response.data)
|
||||
.catch(console.error)
|
||||
|
||||
const channels = []
|
||||
if (Array.isArray(subscribedChannels.channelPackageList)) {
|
||||
subscribedChannels.channelPackageList.forEach(pkg => {
|
||||
channels.push(...pkg.channelList.map(channel => {
|
||||
return {
|
||||
lang: 'id',
|
||||
site_id: channel.id,
|
||||
name: channel.name
|
||||
}
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
function parseItems(content) {
|
||||
return content ? JSON.parse(content.trim()).result || [] : []
|
||||
}
|
||||
|
||||
function parseTitle(item) {
|
||||
return item.scehedule_title
|
||||
}
|
||||
|
||||
function parseDescription(item) {
|
||||
return item.schedule_json.primarySynopsis
|
||||
}
|
||||
|
||||
function parseEpisode(item) {
|
||||
return item.schedule_json.episodeName
|
||||
}
|
||||
|
||||
function parseStart(item) {
|
||||
return dayjs.tz(item.schedule_date, 'YYYY-MM-DD HH:mm:ss', 'Asia/Jakarta')
|
||||
}
|
||||
|
||||
function parseStop(item) {
|
||||
return dayjs.tz([item.schedule_date.split(' ')[0], item.schedule_end_time].join(' '), 'YYYY-MM-DD HH:mm:ss', 'Asia/Jakarta')
|
||||
}
|
35
sites/cubmu.com/cubmu.com.test.js
Normal file
35
sites/cubmu.com/cubmu.com.test.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
const { url, parser } = require('./cubmu.com.config.js')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2023-11-05', 'DD/MM/YYYY').startOf('d')
|
||||
const channel = { site_id: '4028c68574537fcd0174be43042758d8', xmltv_id: 'TransTV.id', lang: 'id' }
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://servicebuss.transvision.co.id/v2/cms/getEPGData?app_id=cubmu&tvs_platform_id=standalone&schedule_date=2023-11-05&channel_id=4028c68574537fcd0174be43042758d8'
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content =
|
||||
'{"result":[{"channel_id":"4028c68574537fcd0174be43042758d8","channel_name":"Trans TV","scehedule_title":"CNN Tech News","schedule_date":"2023-11-05 01:30:00","schedule_end_time":"02:00:00","schedule_json":{"availability":0,"channelId":"4028c68574537fcd0174be43042758d8","channelName":"Trans TV","duration":1800,"editable":true,"episodeName":"","imageUrl":"https://cdnjkt2.transvision.co.id:1001/catchup/schedule/thumbnail/4028c68574537fcd0174be43042758d8/4028c6858b8b3621018b9330e3701a7e/458x640","imageUrlWide":"https://cdnjkt2.transvision.co.id:1001/catchup/schedule/thumbnail/4028c68574537fcd0174be43042758d8/4028c6858b8b3621018b9330e3701a7e/320x180","name":"CNN Tech News","ottImageUrl":"","primarySynopsis":"CNN Indonesia Tech News adalah berita teknologi yang membawa pemirsa ke dunia teknologi yang penuh dengan informasi, pendidikan, hiburan sampai informasi kesehatan terkini.","scheduleId":"4028c6858b8b3621018b9330e3701a7e","scheduleTime":"18:30:00","secondarySynopsis":"CNN Indonesia Tech News is tech news brings viewers into the world of technology that provides information, education, entertainment to the latest health information.","startDt":"20231104183000","url":""},"schedule_start_time":"01:30:00"}]}'
|
||||
const results = parser({ content, channel })
|
||||
|
||||
expect(results).toMatchObject([
|
||||
{
|
||||
start: '2023-11-04T18:30:00.000Z',
|
||||
stop: '2023-11-04T19:00:00.000Z',
|
||||
title: 'CNN Tech News',
|
||||
description:
|
||||
"CNN Indonesia Tech News adalah berita teknologi yang membawa pemirsa ke dunia teknologi yang penuh dengan informasi, pendidikan, hiburan sampai informasi kesehatan terkini."
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const results = parser({ content: '' })
|
||||
|
||||
expect(results).toMatchObject([])
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue