mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update m.tv.sms.cz.config.js
Fixes wrong encoding
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user