mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update m.tv.sms.cz.config.js
Fixes wrong encoding
This commit is contained in:
parent
a80fd17c15
commit
c9cebf2371
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
const jsdom = require('jsdom')
|
const jsdom = require('jsdom')
|
||||||
|
const iconv = require('iconv-lite')
|
||||||
const { JSDOM } = jsdom
|
const { JSDOM } = jsdom
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
@ -25,9 +26,10 @@ module.exports = {
|
||||||
|
|
||||||
return img ? img.src : null
|
return img ? img.src : null
|
||||||
},
|
},
|
||||||
parser: function ({ content, date }) {
|
parser: function ({ buffer, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const dom = new JSDOM(content)
|
const string = iconv.decode(buffer, 'win1250')
|
||||||
|
const dom = new JSDOM(string)
|
||||||
const items = dom.window.document.querySelectorAll('#obsah > div > div.porady > div.porad')
|
const items = dom.window.document.querySelectorAll('#obsah > div > div.porady > div.porad')
|
||||||
items.forEach((item, i) => {
|
items.forEach((item, i) => {
|
||||||
const time = (item.querySelector('div > span') || { textContent: '' }).textContent
|
const time = (item.querySelector('div > span') || { textContent: '' }).textContent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue