How to use the cloudscraper.__init__.CloudScraper function in cloudscraper

To help you get started, we’ve selected a few cloudscraper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VeNoMouS / cloudscraper / cloudscraper / __init__.py View on Github external
# ------------------------------------------------------------------------------- #

if ssl.OPENSSL_VERSION_INFO < (1, 1, 1):
    sys.tracebacklimit = 0
    raise RuntimeError(
        "Sorry but the OpenSSL being used by this python install ({}) does not meet the minimum "
        "version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare.".format(
            ssl.OPENSSL_VERSION
        )
    )

# ------------------------------------------------------------------------------- #

create_scraper = CloudScraper.create_scraper
get_tokens = CloudScraper.get_tokens
get_cookie_string = CloudScraper.get_cookie_string
github VeNoMouS / cloudscraper / cloudscraper / __init__.py View on Github external
def request(self, method, url, *args, **kwargs):
        # pylint: disable=E0203
        if kwargs.get('proxies') and kwargs.get('proxies') != self.proxies:
            self.proxies = kwargs.get('proxies')

        resp = self.decodeBrotli(
            super(CloudScraper, self).request(method, url, *args, **kwargs)
        )

        # ------------------------------------------------------------------------------- #
        # Debug request
        # ------------------------------------------------------------------------------- #

        if self.debug:
            self.debugRequest(resp)

        # Check if Cloudflare anti-bot is on
        if self.is_Challenge_Request(resp):
            # ------------------------------------------------------------------------------- #
            # Try to solve the challenge and send it back
            # ------------------------------------------------------------------------------- #

            if self._solveDepthCnt >= self.solveDepth:
github VeNoMouS / cloudscraper / cloudscraper / __init__.py View on Github external
# ------------------------------------------------------------------------------- #

if ssl.OPENSSL_VERSION_INFO < (1, 1, 1):
    sys.tracebacklimit = 0
    raise RuntimeError(
        "Sorry but the OpenSSL being used by this python install ({}) does not meet the minimum "
        "version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare.".format(
            ssl.OPENSSL_VERSION
        )
    )

# ------------------------------------------------------------------------------- #

create_scraper = CloudScraper.create_scraper
get_tokens = CloudScraper.get_tokens
get_cookie_string = CloudScraper.get_cookie_string
github VeNoMouS / cloudscraper / cloudscraper / __init__.py View on Github external
# ------------------------------------------------------------------------------- #

if ssl.OPENSSL_VERSION_INFO < (1, 1, 1):
    sys.tracebacklimit = 0
    raise RuntimeError(
        "Sorry but the OpenSSL being used by this python install ({}) does not meet the minimum "
        "version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare.".format(
            ssl.OPENSSL_VERSION
        )
    )

# ------------------------------------------------------------------------------- #

create_scraper = CloudScraper.create_scraper
get_tokens = CloudScraper.get_tokens
get_cookie_string = CloudScraper.get_cookie_string