mirror of
https://github.com/iptv-org/epg
synced 2026-04-29 22:16:59 -04:00
Update /sites
This commit is contained in:
@@ -13,17 +13,13 @@ module.exports = {
|
||||
ttl: 60 * 60 * 1000 // 1 hour
|
||||
},
|
||||
headers: {
|
||||
'Accept-Language':'en-US,en;q=0.5',
|
||||
'Connection':'keep-alive',
|
||||
},
|
||||
'Accept-Language': 'en-US,en;q=0.5',
|
||||
Connection: 'keep-alive'
|
||||
}
|
||||
},
|
||||
url({ date, channel }) {
|
||||
const [channelId, childId] = channel.site_id.split('#')
|
||||
return `https://www.directv.com/json/channelschedule?channels=${
|
||||
channelId
|
||||
}&startTime=${date.format()}&hours=24&chId=${
|
||||
childId
|
||||
}`
|
||||
return `https://www.directv.com/json/channelschedule?channels=${channelId}&startTime=${date.format()}&hours=24&chId=${childId}`
|
||||
},
|
||||
async parser({ content, channel }) {
|
||||
const programs = []
|
||||
@@ -52,7 +48,7 @@ module.exports = {
|
||||
},
|
||||
async channels({ zip }) {
|
||||
const html = await axios
|
||||
.get(`https://www.directv.com/guide`, {
|
||||
.get('https://www.directv.com/guide', {
|
||||
headers: {
|
||||
cookie: `dtve-prospect-zip=${zip}`
|
||||
}
|
||||
@@ -62,7 +58,7 @@ module.exports = {
|
||||
|
||||
const $ = cheerio.load(html)
|
||||
const script = $('#dtvClientData').html()
|
||||
const [_, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
||||
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
||||
const data = JSON.parse(json)
|
||||
|
||||
let items = data.guideData.channels
|
||||
|
||||
Reference in New Issue
Block a user