Update /sites

This commit is contained in:
freearhey
2023-10-02 06:35:33 +03:00
parent ca254a6df0
commit c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions

View File

@@ -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