Closed yashkathe closed 2 years ago
I think it has been 2 weeks since the API stopped working
And here I was, trying to refactor my code thinking I was doing something wrong. Well thanks for informing and do update this thread if the api is back up again. Thank you
I did some testing and concluded the problem is that HLTV is blocking all requests because of bot protection. Changing the User-Agent in the source code from node-fetch
to a real User-Agent solved the issue.
Using the user-agents library to generate a User-Agent, instead of using node-fetch
, might be a good solution to this.
Thanks for pointing this out, the fix has been released...closing..
/home/yashkathe/NODEJS-projects/CLONES/csgo-news/node_modules/hltv-api/dist/teams.js:72 throw new Error(error); ^
Error: Error: There are no teams available, something went wrong. Please contact the library maintainer on https://github.com/dajk/hltv-api at Object. (/home/yashkathe/NODEJS-projects/CLONES/csgo-news/node_modules/hltv-api/dist/teams.js:72:19)
at Generator.next ()
at fulfilled (/home/yashkathe/NODEJS-projects/CLONES/csgo-news/node_modules/hltv-api/dist/teams.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)