codemanki / cloudscraper

--DEPRECATED -- 🛑 🛑 Node.js library to bypass cloudflare's anti-ddos page
MIT License
602 stars 139 forks source link

Request defaults #58

Closed Revadike closed 5 years ago

Revadike commented 6 years ago

I'd like to see support for request defaults such as jar: true, which remembers cookies for subsequent requests.

https://github.com/request/request#convenience-methods

Revadike commented 6 years ago

Perhaps allow us the pass an instance of the request module in cloudscraper constructor.

dnunes commented 6 years ago

This is a library, not a class/prototype. It doesn't have a constructor. Anyway, it could have provided a helper function to configure the defaults, for sure. I actually forked it locally just because of this requirement. I thought about making a PR, but it doesn't look like it's being actively maintained.

codemanki commented 6 years ago

@dnunes if you make a PR i would be happy to merge and release it :)

mavrick commented 6 years ago

I thought about making a PR, but it doesn't look like it's being actively maintained.

I thought the same until i saw @codemanki reply. Maybe some of the PR's and open issues could be cleaned up so it looks a bit more active mate?

dnunes commented 6 years ago

Hey, @codemanki, good to see it's still being worked on. My solution is a pretty hacky one just to work on my personal needs (cloudscraper.setRequester(<request>)), but I'm sure we can think of something better and more general to make a PR. If I get to it, I'll sure make a PR here. Thanks for the your work.

codemanki commented 6 years ago

@mavrick will do that over the weekend. I really want to merge the promise support PR. @dnunes got it. Hope you'll get to it :) Thank you for contributing!

mavrick commented 6 years ago

@codemanki I like @dnunes idea having more control over the requestjs object so we can set custom headers, http agents etc. Cheers, looking forward to using the library more 🥇

Revadike commented 6 years ago

Perhaps cloudscraper could even substitute it for the request library, so we only need one library to make HTTP requests. Though, it would require detecting cloudflare on sites, otherwise it will always wait 5 seconds for every request.

ghost commented 5 years ago

There is support for this in the v3.0.0 branch. This can be closed.