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,30 +46,35 @@ module.exports = {
|
|||
|
||||
return programs
|
||||
},
|
||||
async channels({ zip }) {
|
||||
const html = await axios
|
||||
.get('https://www.directv.com/guide', {
|
||||
headers: {
|
||||
cookie: `dtve-prospect-zip=${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=${code}`
|
||||
}
|
||||
})
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
|
||||
const $ = cheerio.load(html)
|
||||
const script = $('#dtvClientData').html()
|
||||
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
||||
const data = JSON.parse(json)
|
||||
|
||||
data.guideData.channels.forEach(item => {
|
||||
channels.push({
|
||||
lang: 'en',
|
||||
site_id: item.chNum,
|
||||
name: item.chName
|
||||
})
|
||||
})
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
}
|
||||
|
||||
const $ = cheerio.load(html)
|
||||
const script = $('#dtvClientData').html()
|
||||
const [, json] = script.match(/var dtvClientData = (.*);/) || [null, null]
|
||||
const data = JSON.parse(json)
|
||||
|
||||
let items = data.guideData.channels
|
||||
|
||||
return items.map(item => {
|
||||
return {
|
||||
lang: 'en',
|
||||
site_id: item.chNum,
|
||||
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 fs = require('fs')
|
||||
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