mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update tv.mail.ru
This commit is contained in:
parent
b878425413
commit
51f9f99bef
2 changed files with 1 additions and 15 deletions
|
@ -14,14 +14,6 @@ module.exports = {
|
||||||
channel.site_id
|
channel.site_id
|
||||||
}&date=${date.format('YYYY-MM-DD')}`
|
}&date=${date.format('YYYY-MM-DD')}`
|
||||||
},
|
},
|
||||||
logo({ content }) {
|
|
||||||
const json = JSON.parse(content)
|
|
||||||
if (!json || !Array.isArray(json.schedule)) return null
|
|
||||||
|
|
||||||
return json.schedule[0] && json.schedule[0].channel
|
|
||||||
? json.schedule[0].channel.pic_url_128
|
|
||||||
: null
|
|
||||||
},
|
|
||||||
parser({ content, date }) {
|
parser({ content, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const items = parseItems(content)
|
const items = parseItems(content)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// npx epg-grabber --config=sites/tv.mail.ru/tv.mail.ru.config.js --channels=sites/tv.mail.ru/tv.mail.ru_am.channels.xml --output=.gh-pages/guides/am/tv.mail.ru.epg.xml --days=2
|
// npx epg-grabber --config=sites/tv.mail.ru/tv.mail.ru.config.js --channels=sites/tv.mail.ru/tv.mail.ru_am.channels.xml --output=.gh-pages/guides/am/tv.mail.ru.epg.xml --days=2
|
||||||
|
|
||||||
const { parser, url, logo } = require('./tv.mail.ru.config.js')
|
const { parser, url } = require('./tv.mail.ru.config.js')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
@ -20,12 +20,6 @@ it('can generate valid url', () => {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate valid logo url', () => {
|
|
||||||
expect(logo({ content })).toBe(
|
|
||||||
'https://resizer.mail.ru/p/1234c5ac-c19c-5cf2-9c6a-fc0efca920ac/AAACwjJ45j9sTP8fcjPJnJ4xk5e_ILr5iXwjLMhWhzlVnIJkrtT42vEp9walcgpXRKDq9KFoliEPR0xI-LEh96C_izY.png'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can parse response', () => {
|
it('can parse response', () => {
|
||||||
const result = parser({ content, date }).map(p => {
|
const result = parser({ content, date }).map(p => {
|
||||||
p.start = p.start.toJSON()
|
p.start = p.start.toJSON()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue