Added array buffer to response
This commit is contained in:
		
							parent
							
								
									e38ffb1040
								
							
						
					
					
						commit
						20a7c80b55
					
				| 
						 | 
				
			
			@ -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 })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue