Added array buffer to response

This commit is contained in:
freearhey 2021-03-31 21:47:53 +03:00
parent e38ffb1040
commit 20a7c80b55
2 changed files with 9 additions and 3 deletions

View File

@ -39,7 +39,11 @@ async function main() {
.get(url)
.then(response => {
item.channel.logo = config.logo
? config.logo({ channel: item.channel, content: response.data })
? config.logo({
channel: item.channel,
content: response.data.toString(),
buffer: response.data
})
: null
const programs = utils.parsePrograms({ response, item, config })

View File

@ -155,7 +155,8 @@ utils.convertToXMLTV = function ({ config, channels, programs }) {
utils.parsePrograms = function ({ response, item, config }) {
const options = Object.assign({}, item, config, {
content: response.data
content: response.data.toString(),
buffer: response.data
})
return config
@ -184,7 +185,8 @@ utils.createHttpClient = function (config) {
},
timeout: config.timeout,
withCredentials: true,
jar: new tough.CookieJar()
jar: new tough.CookieJar(),
responseType: 'arraybuffer'
})
}