mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 17:40:07 -04:00
Update tvtv.us.config.js
This commit is contained in:
parent
2ec0da9e2a
commit
7f39b75411
1 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
const axios = require('axios')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
|
||||||
|
@ -9,10 +10,20 @@ module.exports = {
|
||||||
channels: 'tvtv.us.channels.xml',
|
channels: 'tvtv.us.channels.xml',
|
||||||
output: '.gh-pages/guides/tvtv.us.guide.xml',
|
output: '.gh-pages/guides/tvtv.us.guide.xml',
|
||||||
url: function ({ date, channel }) {
|
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
|
channel.site_id
|
||||||
}/listings?start=${date.format()}&end=${date.add(1, 'd').format()}`
|
}/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 }) {
|
parser: function ({ content }) {
|
||||||
let programs = []
|
let programs = []
|
||||||
const items = JSON.parse(content)
|
const items = JSON.parse(content)
|
||||||
|
@ -24,7 +35,7 @@ module.exports = {
|
||||||
? `https://cdn.tvpassport.com/image/show/480x720/${item.showPicture}`
|
? `https://cdn.tvpassport.com/image/show/480x720/${item.showPicture}`
|
||||||
: null
|
: null
|
||||||
let title = item.showName
|
let title = item.showName
|
||||||
if (title === "Movie") {
|
if (title === 'Movie') {
|
||||||
title = item.episodeTitle
|
title = item.episodeTitle
|
||||||
}
|
}
|
||||||
programs.push({
|
programs.push({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue