mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update directv.com
This commit is contained in:
parent
4eed315589
commit
54c0adaa44
4 changed files with 619 additions and 596 deletions
File diff suppressed because it is too large
Load diff
|
@ -46,11 +46,15 @@ module.exports = {
|
||||||
|
|
||||||
return programs
|
return programs
|
||||||
},
|
},
|
||||||
async channels({ zip }) {
|
async channels() {
|
||||||
|
const codes = [10001]
|
||||||
|
|
||||||
|
let channels = []
|
||||||
|
for (let code of codes) {
|
||||||
const html = await axios
|
const html = await axios
|
||||||
.get('https://www.directv.com/guide', {
|
.get('https://www.directv.com/guide', {
|
||||||
headers: {
|
headers: {
|
||||||
cookie: `dtve-prospect-zip=${zip}`
|
cookie: `dtve-prospect-zip=${code}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
|
@ -61,15 +65,16 @@ module.exports = {
|
||||||
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
||||||
const data = JSON.parse(json)
|
const data = JSON.parse(json)
|
||||||
|
|
||||||
let items = data.guideData.channels
|
data.guideData.channels.forEach(item => {
|
||||||
|
channels.push({
|
||||||
return items.map(item => {
|
|
||||||
return {
|
|
||||||
lang: 'en',
|
lang: 'en',
|
||||||
site_id: item.chNum,
|
site_id: item.chNum,
|
||||||
name: item.chName
|
name: item.chName
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return channels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 { parser, url } = require('./directv.com.config.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
21
sites/directv.com/readme.md
Normal file
21
sites/directv.com/readme.md
Normal 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
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue