mirror of
https://github.com/iptv-org/epg
synced 2026-05-08 10:27:06 -04:00
Update directv.com
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -46,30 +46,35 @@ module.exports = {
|
|||||||
|
|
||||||
return programs
|
return programs
|
||||||
},
|
},
|
||||||
async channels({ zip }) {
|
async channels() {
|
||||||
const html = await axios
|
const codes = [10001]
|
||||||
.get('https://www.directv.com/guide', {
|
|
||||||
headers: {
|
let channels = []
|
||||||
cookie: `dtve-prospect-zip=${zip}`
|
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)
|
return channels
|
||||||
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
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user