Im trying fetch youtube videos thumbnails using following endpoint :https://i.ytimg.com/vi/<Video-ID>/sddefault.jpg
With my nodejs code:
const https = require('https');https .get('https://i.ytimg.com/vi/<Video-ID>/sddefault.jpg', { agent: new https.Agent({ keepAlive: true, keepAliveMsecs: 15000 }), }, (response) => { response.pipe(stream); stream.on('finish', () => { stream.close(); }); } ) .on('error', (err) => { console.error('Error downloading file:', err); });
But im getting this error :
connect ETIMEDOUT 10.10.34.35:443 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -4039, code: 'ETIMEDOUT', syscall: 'connect', address: '10.10.34.35', port: 443}
I am more surprised that the image is loaded in the browser or apps like postman but not with my code.
Maybe its would be helpful to say that im using proxy with my network as error indicates to 10.* ip address which is private one.