origeva / node-sponsorblock-api

Node module wrapper for SponsorBlock web API.
MIT License
10 stars 2 forks source link

connect ETIMEDOUT #3

Closed pooyashahidi closed 2 years ago

pooyashahidi commented 2 years ago

Hi, I started getting timeout issues recently. For example:

request to https://sponsor.ajay.app/api/skipSegments?videoID=GFpKnHpQMU8&service=YouTube&categories=[%22sponsor%22] failed, reason: connect ETIMEDOUT 2606:4700:e0::ac40:6617:443

Rven though I am able to curl the url from the same machine:

curl 'https://sponsor.ajay.app/api/skipSegments?videoID=GFpKnHpQMU8&service=YouTube&categories=[%22sponsor%22]'

This is how I am calling it:

const info = await getInfo(videoURL)
const type = ['intro', 'sponsor', 'selfpromo', 'outro']
var segments = await SPONSORBLOCK.getSegments(info.videoDetails.videoId, type)

I'm not sure if the problem is on my part or is happening because of something else. Please let me know if any more info is required. Thank you.

origeva commented 2 years ago

Hey @pooyashahidi, thanks for reaching out. I just checked and that same snippet seems to be working for me. Do you use a proxy? What node version are you using?

pooyashahidi commented 2 years ago

thank you for the fast reply. No proxy. I am really confused since it is giving timeouts consistently for every request.

Node 17.9.0 Here is everything else I use and their versions: +-- @types/node@16.11.60 +-- child_process@1.0.2 +-- cookiefile@1.0.10 +-- fluent-ffmpeg@2.1.2 +-- npm@8.19.2 +-- request@2.88.2 +-- sponsorblock-api@0.2.2 +-- telegraf@3.40.0 +-- telegram-keyboard@2.3.2 +-- winston@3.8.2 `-- ytdl-core@4.11.2

pooyashahidi commented 2 years ago

I am not that familiar with node js and since you asked about the version I tried v16.17.1 and it is now working. thank you :)

origeva commented 2 years ago

Most likely a bug / incompatibility with the request library the project is using, regardless it will be switched with axios in the future. I'm just glad it's working for you now.

Closed.