Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What did I do?
This PR is related to issue #88, I made a research about the follow-redirects module implemented in this project to solve the following bug:
"When running the scraper locally, one of the newer sources triggered an Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded."
How to solve it:
After reading the follow-redirects documentation and testing locally the project I found out that the module provides default options for different scenarios while making requests, in this case, the two options that are involved in the bug are:
Default values:
maxRedirects = 21.
maxBodyLength = 10MB (10 * 1024 * 1024).
To solve the bug it's necessary to edit the default values of the options on the
./node_modules/follow-redirects/index.js
.First I added the source that triggered the bug:
Then, I changed the values of the options to be able to have more redirects and avoid these kinds of bugs while scrapping sites.
Changed values:
maxRedirects = 84.
maxBodyLength = 20MB (20 * 1024 * 1024).