Update directv.com

This commit is contained in:
freearhey 2023-12-03 00:35:59 +03:00
parent 4eed315589
commit 54c0adaa44
4 changed files with 619 additions and 596 deletions

File diff suppressed because it is too large Load diff

View file

@ -46,11 +46,15 @@ module.exports = {
return programs
},
async channels({ zip }) {
async channels() {
const codes = [10001]
let channels = []
for (let code of codes) {
const html = await axios
.get('https://www.directv.com/guide', {
headers: {
cookie: `dtve-prospect-zip=${zip}`
cookie: `dtve-prospect-zip=${code}`
}
})
.then(r => r.data)
@ -61,15 +65,16 @@ module.exports = {
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
const data = JSON.parse(json)
let items = data.guideData.channels
return items.map(item => {
return {
data.guideData.channels.forEach(item => {
channels.push({
lang: 'en',
site_id: item.chNum,
name: item.chName
}
})
})
}
return channels
}
}

View file

@ -1,6 +1,3 @@
// [Geo-blocked] npm run channels:parse -- --config=./sites/directv.com/directv.com.config.js --output=./sites/directv.com/directv.com.channels.xml --set=zip:10001
// [Geo-blocked] npm run grab -- --site=directv.com
const { parser, url } = require('./directv.com.config.js')
const fs = require('fs')
const path = require('path')

View file

@ -0,0 +1,21 @@
# directv.com
https://www.directv.com/ _[Geo-blocked]_
### Download the guide
```sh
npm run grab -- --site=directv.com
```
### Update channel list
```sh
npm run channels:parse -- --config=./sites/directv.com/directv.com.config.js --output=./sites/directv.com/directv.com.channels.xml
```
### Test
```sh
npm test -- directv.com
```