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

File diff suppressed because it is too large Load diff

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

View file

@ -1,5 +1,5 @@
// node ./scripts/commands/parse-channels.js --config=./sites/directv.com/directv.com.config.js --output=./sites/directv.com/directv.com.channels.xml --set=zip:10001
// npx epg-grabber --config=sites/directv.com/directv.com.config.js --channels=sites/directv.com/directv.com.channels.xml --output=guide.xml --days=2
// npm run grab -- --site=directv.com
const { parser, url } = require('./directv.com.config.js')
const fs = require('fs')