mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Fix tvtv.us issue. adding headers
Fix tvtv.us issue. adding headers
This commit is contained in:
parent
7610f7b9f5
commit
ea02e243c6
1 changed files with 19 additions and 3 deletions
|
@ -8,17 +8,33 @@ module.exports = {
|
|||
delay: 1500, // 1500 ms (otherwise the server returns error 429: https://github.com/iptv-org/epg/issues/2176)
|
||||
days: 2,
|
||||
url: function ({ date, channel }) {
|
||||
if (!dayjs.isDayjs(date)) {
|
||||
throw new Error('Invalid date object passed to url function')
|
||||
}
|
||||
|
||||
return `https://www.tvtv.us/api/v1/lineup/USA-NY71652-X/grid/${date.toJSON()}/${date
|
||||
.add(1, 'd')
|
||||
.add(1, 'day')
|
||||
.toJSON()}/${channel.site_id}`
|
||||
},
|
||||
request: {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: '*/*',
|
||||
Connection: 'keep-alive',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
|
||||
'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"'
|
||||
}
|
||||
},
|
||||
parser: function ({ content }) {
|
||||
let programs = []
|
||||
|
||||
const items = parseItems(content)
|
||||
items.forEach(item => {
|
||||
const start = dayjs.utc(item.startTime)
|
||||
const stop = start.add(item.runTime, 'm')
|
||||
const stop = start.add(item.runTime, 'minute')
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.subtitle,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue