Merge pull request #102 from iptv-org/update-tvtv-us

Update tvtv.us.channels.xml
This commit is contained in:
Dum4G
2021-09-23 16:23:32 +03:00
committed by GitHub
8 changed files with 5755 additions and 6206 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +0,0 @@
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
module.exports = {
lang: 'en',
site: 'tvtv.ca',
channels: 'tvtv.ca.channels.xml',
output: '.gh-pages/guides/tvtv.ca.guide.xml',
url: function ({ date, channel }) {
return `https://www.tvtv.ca/tvm/t/tv/v4/stations/${
channel.site_id
}/listings?start=${date.format()}&end=${date.add(1, 'd').format()}`
},
parser: function ({ content }) {
let programs = []
const items = JSON.parse(content)
if (!items.length) return programs
items.forEach(item => {
const start = dayjs.utc(item.listDateTime)
const stop = start.add(item.duration, 'm')
const icon = item.showPicture
? `https://cdn.tvpassport.com/image/show/480x720/${item.showPicture}`
: null
programs.push({
title: item.showName,
description: item.description,
category: item.showType,
start: start.toString(),
stop: stop.toString(),
icon
})
})
return programs
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
@@ -9,10 +10,20 @@ module.exports = {
channels: 'tvtv.us.channels.xml',
output: '.gh-pages/guides/tvtv.us.guide.xml',
url: function ({ date, channel }) {
return `https://www.tvtv.us/tvm/t/tv/v4/stations/${
return `https://tvtv.us/tvm/t/tv/v4/stations/${
channel.site_id
}/listings?start=${date.format()}&end=${date.add(1, 'd').format()}`
},
logo: async function ({ channel }) {
return await axios
.get(`https://tvtv.us/tvm/t/tv/v4/stations/${channel.site_id}`)
.then(r =>
r.data && r.data.logoFilename
? `https://cdn.tvpassport.com/image/station/100x100/${r.data.logoFilename}`
: null
)
.catch(e => console.log)
},
parser: function ({ content }) {
let programs = []
const items = JSON.parse(content)
@@ -24,7 +35,7 @@ module.exports = {
? `https://cdn.tvpassport.com/image/show/480x720/${item.showPicture}`
: null
let title = item.showName
if (title === "Movie") {
if (title === 'Movie') {
title = item.episodeTitle
}
programs.push({