JimmyLaurent / cloudflare-scraper

A package to bypass Cloudflare's protection
MIT License
290 stars 30 forks source link

Error: timeout on just a moment #20

Open coinproduct opened 4 years ago

coinproduct commented 4 years ago

any ideas?

tpartee commented 4 years ago

Can confirm this issue.

ec2-user@canisminor:/www/imgur/script/maint$ node cf-test.js
Error: timeout on just a moment
    at fillCookiesJar (/www/imgur/script/maint/node_modules/cloudflare-scraper/src/fillCookiesJar.js:48:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async handleError (/www/imgur/script/maint/node_modules/cloudflare-scraper/index.js:18:5)
    at async cloudflareScraper (/www/imgur/script/maint/node_modules/cloudflare-scraper/index.js:37:20)
    at async /www/imgur/script/maint/cf-test.js:5:22

NOTE: According to NPM when installing this package (v1.0.7) the request package is deprecated, which may be the cause of this issue to begin with, perhaps?

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
aat-antoine commented 3 years ago

I got same error. Is there a workaround ?

coinproduct commented 3 years ago

Contact me on telegram teledeniz i might be able to help

On Sat, 9 Jan 2021 at 21:09, Antoine Arnoult notifications@github.com wrote:

I got same error. Is there a workaround ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JimmyLaurent/cloudflare-scraper/issues/20#issuecomment-757360564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQUUHJHTKVAWKEOQEE6724LSZCZXRANCNFSM4T6KNVFA .

thiagomorello commented 3 years ago

got same error, any ideas?

RamBoFe commented 3 years ago

Perhaps this would come from the user agent used. Are you doing your tests from linux ? If so, I would advise you to use the windows user agent by commenting out the lines of the getUserAgent() function in the utils.js file as follows and testing again :

function getUserAgent() {
  // const { platform } = process;
  // if (platform === 'darwin') {
  //   return USER_AGENT_MAC;
  // }
  // if (platform === 'win32') {
    return USER_AGENT_WINDOWS;
  // }
  // return USER_AGENT_LINUX;
}

Edit : more explications here

Edit 2 : a better way to implement your own User Agent here

johann-taberlet commented 3 years ago

https://github.com/JimmyLaurent/torrent-search-api/issues/117#issuecomment-812590408

juliodlcz3 commented 3 years ago

Hi everyone, I am having the same error after using cloudflare-scrape around thrree-four months:

2021-05-07T22:25:49.624567+00:00 app[worker.1]: Error: timeout on just a moment 2021-05-07T22:25:49.624591+00:00 app[worker.1]: at fillCookiesJar (/app/node_modules/cloudflare-scraper/src/fillCookiesJar.js:48:17) 2021-05-07T22:25:49.624596+00:00 app[worker.1]: at runMicrotasks () 2021-05-07T22:25:49.624597+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:93:5) 2021-05-07T22:25:49.624597+00:00 app[worker.1]: at async handleError (/app/node_modules/cloudflare-scraper/index.js:18:5) 2021-05-07T22:25:49.624597+00:00 app[worker.1]: at async cloudflareScraper (/app/node_modules/cloudflare-scraper/index.js:37:20) 2021-05-07T22:25:49.624598+00:00 app[worker.1]: at async Timeout.init2 [as _onTimeout] (/app/mybot.js:2412:30)

Anyone else is getting this error nowdays?