Good day to all.
I have a problem since 1 week where I get headaches from this error.
Error: getaddrinfo ENOTFOUND api.twitch.tv
Before this I had no problems at all (Very rarely do I get one back then)
What did I do.
- Complete server reboot.
- Code cleaned up.
- Searched the internet which was of no use to me unfortunately.
What exactly am I doing?
Daily, I check over 2,250 streamer every so many minutes. To check if clips have been made on a channel, because unfortunately there is no PubSub available for this. (Made the system so that it goes quietly and does not abuse the Twitch API.) When a clip is made, I post it to Discord where my users receive their clips in their Discord Channels.
My Code
try {
var options = {
method: 'GET',
url: 'https://api.twitch.tv/helix/clips',
params: { broadcaster_id: broadcaster_id, started_at: started_at, ended_at: ended_at, first: "20" },
headers: {
authorization: 'Bearer ' + process.env.TWITCH_CLIENT_AUTH,
'client-id': process.env.TWITCH_CLIENT_ID,
"Accept": "application/vnd.twitchtv.v5+json"
}
};
const promise = axios.request(options).then((response) => response).catch(e => logger('error', 'twitch.js [getClipData]', e));
return promise;
} catch (error) {
console.log('twitch.clips -> getClips' + error);
}
Although I don’t think there is anything wrong with my code. But how do I solve this problem?
Or should I request a whitelist for Twitch API? So I have no idea, if anyone has a solution, tips & whatever. Would this help me tremendously.
Greetings on my behalf