freearhey / epg-grabber

Node.js CLI tool for grabbing EPG from different websites
46 stars 7 forks source link

Error "ERR: maxContentLength size of 5242880 exceeded" #18

Closed nickleby closed 10 months ago

nickleby commented 10 months ago

Hi, I don't know if this should go here, but I'm trying to create a config.js file for a new EPG site and it's grabbing the content fine, but the data is JSON and for some dates is a big file. I'm having this issue:

  [2/6] example.com (es) - channelexample.us - Oct 20, 2023 (0 programs)
    ERR: maxContentLength size of 5242880 exceeded

Is there a way to increase that "maxContentLength" to avoid the error? Thank you.

freearhey commented 10 months ago

Try to add the maxContentLength option to the config:

module.exports = {
  site: 'example.com',
  request: {
    maxContentLength: 100 * 1024 * 1024 // 100Mb
  },
  ...
}

More info: https://axios-http.com/docs/req_config

nickleby commented 10 months ago
request: {
    maxContentLength: 100 * 1024 * 1024 // 100Mb
  },

Thanks, that did the trick!

nickleby commented 10 months ago

Sorry, don't know what happened, I'm receiving this error now... Any ideas @freearhey ? Thank you!

loading channels...
/home/ubuntu/GitHub/epg/epg/node_modules/epg-grabber/src/parser.js:28
    .map(el => {
     ^
TypeError: Cannot read properties of undefined (reading 'find')
    at /home/ubuntu/GitHub/epg/epg/node_modules/epg-grabber/src/parser.js:30:28
    at Array.map (<anonymous>)
    at parseChannels (/home/ubuntu/GitHub/epg/epg/node_modules/epg-grabber/src/parser.js:28:6)
    at ChannelsParser.parse (/home/ubuntu/GitHub/epg/epg/scripts/core/channelsParser.ts:19:35)
    at async main (/home/ubuntu/GitHub/epg/epg/scripts/commands/epg/grab.ts:71:44)
nickleby commented 10 months ago

Nvm, I forgot some data in the channels.xml and that was causing the issue, so sorry.