Update streamingtvguides.com

This commit is contained in:
freearhey 2023-11-28 13:22:39 +03:00
parent 858d1f40b1
commit 7e5258fecc
4 changed files with 3113 additions and 2 deletions

View file

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

File diff suppressed because it is too large Load diff

View file

@ -32,6 +32,33 @@ module.exports = {
programs = _.orderBy(_.uniqBy(programs, 'start'), 'start')
return programs
},
async channels({ country, lang }) {
const axios = require('axios')
const data = await axios
.get(`https://streamingtvguides.com/Preferences`)
.then(r => r.data)
.catch(console.log)
let channels = []
const $ = cheerio.load(data)
$('#channel-group-all > div > div').each((i, el) => {
const site_id = $(el).find('input').attr('value').replace('&', '&')
const label = $(el).text().trim()
const svgTitle = $(el).find('svg').attr('alt')
const name = (label || svgTitle || '').replace(site_id, '').trim()
if (!name || !site_id) return
channels.push({
lang: 'en',
site_id,
name
})
})
return channels
}
}

View file

@ -1,5 +1,3 @@
// npm run grab -- --site=streamingtvguides.com
const { parser, url } = require('./streamingtvguides.com.config.js')
const fs = require('fs')
const path = require('path')