cloudscraper-turnstile 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cloudscraper-turnstile
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: cloudscraper drop-in that actually solves Cloudflare Turnstile and the 5s interstitial via the Peak API. Subclasses requests.Session; swap two lines and your existing scraper works.
5
5
  Project-URL: Homepage, https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile
6
6
  Project-URL: Documentation, https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile
@@ -29,12 +29,12 @@ Requires-Dist: requests>=2.25
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  <a href="https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile">
32
- <img src="https://raw.githubusercontent.com/CircuitSavage/cloudscraper-turnstile/main/assets/peak-banner.png" alt="Peak — solve Cloudflare Turnstile & the 5s challenge in ~1s" width="100%">
32
+ <img src="https://raw.githubusercontent.com/CircuitSavage/cloudscraper-turnstile/main/assets/peak-banner.png" alt="Peak: solve Cloudflare Turnstile and the 5s challenge" width="100%">
33
33
  </a>
34
34
 
35
35
  # cloudscraper-turnstile
36
36
 
37
- **cloudscraper-turnstile** is a drop-in replacement for [cloudscraper](https://github.com/VeNoMouS/cloudscraper) that actually solves Cloudflare Turnstile and the 5s "Just a moment..." interstitial. It subclasses `requests.Session` exactly like cloudscraper does, so you change one import line and your existing scraper keeps working, except now the requests that used to return `403` come back with the real page.
37
+ **cloudscraper-turnstile** is a drop-in replacement for [cloudscraper](https://github.com/VeNoMouS/cloudscraper) that solves Cloudflare Turnstile and the 5s "Just a moment..." interstitial. It subclasses `requests.Session` the same way cloudscraper does, so you change one import line and your existing scraper keeps working, except now the requests that used to return `403` come back with the real page.
38
38
 
39
39
  ```python
40
40
  import cloudscraper_turnstile as cloudscraper
@@ -45,24 +45,24 @@ resp = scraper.get("https://protected.example.com/") # Turnstile solved, real
45
45
 
46
46
  ## Why cloudscraper can't do this anymore
47
47
 
48
- cloudscraper is a good tool for the challenge it was built for, but that challenge is mostly gone:
48
+ cloudscraper is a good tool for the challenge it was built for, but that challenge is gone from most sites:
49
49
 
50
50
  - **It only ever solved the legacy IUAM challenge.** cloudscraper works by reading Cloudflare's old "I'm Under Attack Mode" page, extracting the JavaScript math problem, and evaluating it. That is the entire mechanism.
51
51
  - **It has no JS engine and no browser.** Modern Cloudflare managed challenges and Turnstile run real, obfuscated browser JavaScript and collect behavioral and fingerprint signals. There is nothing in the page for a regex-and-eval tool to solve, so the request stays on the challenge page and you get a `403`, a `503`, or an endless "Just a moment..." loop.
52
52
  - **Its own "Turnstile support" is a hand-off.** cloudscraper never solved Turnstile itself. It added hooks to pass the challenge to a third-party paid CAPTCHA API and inject the returned token. Without one of those API keys configured, Turnstile support does nothing.
53
- - **The project is effectively unmaintained.** Its last real release was in 2023. Cloudflare has shipped many detection changes since.
53
+ - **The project is unmaintained.** Its last real release was in 2023. Cloudflare has shipped many detection changes since.
54
54
 
55
- So on any site that switched to Turnstile or the managed 5s challenge (most of them, by now), plain cloudscraper returns the challenge HTML instead of your data. This package fills exactly that gap: it keeps cloudscraper's `create_scraper` / `requests.Session` shape and does the one thing cloudscraper cannot, by sending the challenge to a solver that runs a real browser.
55
+ So on any site that switched to Turnstile or the managed 5s challenge (most of them, by now), plain cloudscraper returns the challenge HTML instead of your data. This package fills that gap: it keeps cloudscraper's `create_scraper` / `requests.Session` shape and does the one thing cloudscraper cannot, by sending the challenge to a solver that runs a real browser.
56
56
 
57
57
  ## Powered by Peak
58
58
 
59
59
  This package uses [Peak](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) to solve Turnstile and the 5s challenge.
60
60
 
61
- - Solve Cloudflare Turnstile & the 5s challenge in about a second
62
- - $0.90 per 1,000 successful Turnstile solves, down to $0.35 at volume
61
+ - [$0.90 per 1,000](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing) successful Turnstile solves, down to $0.35 at volume
62
+ - Pay only for solves that land. A failed solve is not billed.
63
63
  - 1,000 free solves to start, no card.
64
64
 
65
- → [Get your free API key](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Pricing](https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
65
+ → [Get your free API key](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Pricing](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing)
66
66
 
67
67
  ## Install
68
68
 
@@ -117,8 +117,8 @@ import cloudscraper_turnstile as cloudscraper
117
117
 
118
118
  scraper = cloudscraper.create_scraper(api_key=os.environ["PEAK_API_KEY"])
119
119
 
120
- # Use it exactly like requests / cloudscraper. A Turnstile or 5s challenge is
121
- # detected, solved through Peak, and the request is retried transparently.
120
+ # Use it like requests / cloudscraper. A Turnstile or 5s challenge is
121
+ # detected, solved through Peak, and the request is retried for you.
122
122
  resp = scraper.get("https://protected.example.com/")
123
123
  print(resp.status_code) # 200
124
124
  print(resp.text) # the real page, not the challenge
@@ -150,7 +150,7 @@ scraper = cloudscraper.create_scraper(
150
150
  )
151
151
  ```
152
152
 
153
- If you set `scraper.proxies` the requests way instead, that proxy is used for the solve automatically.
153
+ If you set `scraper.proxies` the requests way instead, the solve uses that proxy too.
154
154
 
155
155
  ### Earn with your app ID
156
156
 
@@ -195,10 +195,10 @@ scraper = cloudscraper.create_scraper(
195
195
  Because the site moved to Cloudflare Turnstile or the managed 5s challenge. cloudscraper only solves the old IUAM JavaScript-math page and has no JS engine, so on a modern challenge it returns the challenge HTML (usually `403`, `503`, or a "Just a moment..." page) instead of your data. Its last release was in 2023. cloudscraper-turnstile detects those challenges and solves them through Peak.
196
196
 
197
197
  **What is a good cloudscraper alternative for Turnstile?**
198
- cloudscraper-turnstile is built to be that alternative: same `create_scraper` API, same `requests.Session` object, but it actually solves Turnstile. Change the import, add a Peak API key, and your existing code runs.
198
+ cloudscraper-turnstile is built to be that alternative: same `create_scraper` API, same `requests.Session` object, and it solves Turnstile. Change the import, add a Peak API key, and your existing code runs.
199
199
 
200
200
  **How do I fix cloudscraper 403 Forbidden?**
201
- A `403` from a Cloudflare-protected site usually means you received the challenge page, not a real block. Confirm the body contains `cf-turnstile`, `Just a moment`, or `cf_chl_opt`. If so, switch to `import cloudscraper_turnstile as cloudscraper`, set `PEAK_API_KEY`, and the challenge is solved and the request retried automatically. If the proxy/IP that gets challenged is not your default one, pass `proxy=` so the solve matches.
201
+ A `403` from a Cloudflare-protected site means, in most cases, that you received the challenge page, not a real block. Confirm the body contains `cf-turnstile`, `Just a moment`, or `cf_chl_opt`. If so, switch to `import cloudscraper_turnstile as cloudscraper`, set `PEAK_API_KEY`, and the package solves the challenge and retries the request. If the proxy/IP that gets challenged is not your default one, pass `proxy=` so the solve matches.
202
202
 
203
203
  **Does cloudscraper solve Cloudflare Turnstile?**
204
204
  Not on its own. cloudscraper never solved Turnstile itself; it only added hooks to pass the token from an external paid CAPTCHA service. cloudscraper-turnstile does the solve for you through Peak and injects the `cf-turnstile-response` token, so there is nothing else to wire up.
@@ -212,6 +212,25 @@ Yes. When the response is the interstitial rather than a Turnstile widget, the p
212
212
  **Will it loop forever if a solve fails?**
213
213
  No. Solving is capped by `max_solve_attempts` (default 3). After that the last response is returned as-is so you can inspect it.
214
214
 
215
+ ## Troubleshooting
216
+
217
+ The package raises `PeakError` with a string you can grep for, or hands you back the challenge page when it gives up. Each case, and the two failures that show up after a solve, has a longer write-up on the Peak blog.
218
+
219
+ - **`PeakError: No Peak API key.`** None of the three sources above had a key. Keys start with `pk_`; the free one comes from the [dashboard](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile).
220
+ - **`PeakError: Peak request failed: ...`** The HTTP call to `api.peak.fo` itself failed: a DNS or TLS error, a proxy that refused the connection, or a timeout. The `proxy=` you pass is forwarded to Peak for the solve, not used for this call; check your own network path first.
221
+ - **`PeakError: <error text from Peak>`** Peak answered with `success: false`. The text is Peak's own reason, for example an exhausted balance or a sitekey the solver could not clear. The [Cloudflare Turnstile error codes](https://blog.peak.fo/cloudflare-turnstile-error-codes/) post covers the widget-side codes (110200, 300030, 600010 and friends) that often sit behind a failed solve.
222
+ - **`scraper.get()` returns the challenge HTML with no exception.** The solve ran up to `max_solve_attempts` times (default 3) and the site still served a challenge, so the last response comes back as-is. Pass `debug=True` to `create_scraper` to print each attempt. The usual cause is an egress mismatch: Cloudflare ties `cf_clearance` to the IP and User-Agent that earned it, so a clearance solved from Peak's network and replayed from yours gets refused. Pass `proxy=` (or set `scraper.proxies`) so the solve and the crawl share one IP. [Cloudflare Turnstile 403](https://blog.peak.fo/cloudflare-turnstile-403-scraper-fix/) walks through the fix.
223
+ - **The page had a Turnstile widget but the package took the 5s path.** `_solve_and_retry` goes the Turnstile route only when it finds a `data-sitekey` in the HTML. A widget rendered by script after load has no sitekey in the raw body, so the package treats the response as an interstitial. [How to find a Cloudflare Turnstile sitekey](https://blog.peak.fo/how-to-find-a-cloudflare-turnstile-sitekey/) shows where sites hide it, and [Turnstile token vs cookie](https://blog.peak.fo/cloudflare-turnstile-token-vs-cookie/) explains which of the two artefacts a given page wants.
224
+ - **A later request 403s even though the first one passed.** The `cf_clearance` cookie expired or the site rotated its challenge. The session keeps the cookie, so the next challenged request triggers a fresh solve. [The Cloudflare 5-second challenge explained](https://blog.peak.fo/the-cloudflare-5-second-challenge-explained/) covers how long a clearance lives, and [the cf-turnstile-response token explained](https://blog.peak.fo/the-cf-turnstile-response-token-explained/) covers the token side.
225
+
226
+ Two longer reads for this stack: [How to scrape Cloudflare-protected sites without getting blocked](https://blog.peak.fo/how-to-scrape-cloudflare-protected-sites-without-getting-blocked/) (also on [Hashnode](https://peakfo.hashnode.dev/how-to-scrape-cloudflare-protected-sites-without-getting-blocked)) and the [2026 Turnstile developer guide](https://blog.peak.fo/how-to-solve-cloudflare-turnstile-in-2026-dev-guide/).
227
+
228
+ ## Related
229
+
230
+ Same pattern for other stacks: [turnstile-curl](https://github.com/CircuitSavage/turnstile-curl) (the `curl_cffi` companion, also browserless) · [scrapy-turnstile](https://github.com/CircuitSavage/scrapy-turnstile) · [scrapling-turnstile](https://github.com/CircuitSavage/scrapling-turnstile) · [playwright-turnstile](https://github.com/CircuitSavage/playwright-turnstile) · [patchright-turnstile](https://github.com/CircuitSavage/patchright-turnstile) · [camoufox-turnstile](https://github.com/CircuitSavage/camoufox-turnstile) · [nodriver-turnstile](https://github.com/CircuitSavage/nodriver-turnstile) · [pydoll-turnstile](https://github.com/CircuitSavage/pydoll-turnstile) · [drissionpage-turnstile](https://github.com/CircuitSavage/drissionpage-turnstile) · [selenium-turnstile](https://github.com/CircuitSavage/selenium-turnstile) · [botasaurus-turnstile](https://github.com/CircuitSavage/botasaurus-turnstile) · [crawlee-turnstile](https://github.com/CircuitSavage/crawlee-turnstile) · [puppeteer-extra-plugin-turnstile](https://github.com/CircuitSavage/puppeteer-extra-plugin-turnstile) · [browser-use-turnstile](https://github.com/CircuitSavage/browser-use-turnstile) · [crawl4ai-turnstile](https://github.com/CircuitSavage/crawl4ai-turnstile). Full list in [awesome-turnstile-solvers](https://github.com/CircuitSavage/awesome-turnstile-solvers).
231
+
232
+ If you want to know what the widget does before it hands out a token, [cloudflare-turnstile-reversed](https://github.com/CircuitSavage/cloudflare-turnstile-reversed) documents the challenge flow, the widget parameters and the fingerprinting it runs.
233
+
215
234
  ## Legitimate use
216
235
 
217
236
  Use this for automation, QA, monitoring, and scraping public data you are allowed to access. Respect each target's Terms of Service and `robots.txt`, rate-limit yourself, and do not use it for credential stuffing or to access data you have no right to. You are responsible for how you use it.
@@ -220,7 +239,7 @@ Use this for automation, QA, monitoring, and scraping public data you are allowe
220
239
 
221
240
  - [Peak home](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
222
241
  - [Turnstile docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
223
- - [Pricing](https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
242
+ - [Pricing](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing)
224
243
 
225
244
  ## License
226
245
 
@@ -1,197 +1,216 @@
1
- <a href="https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile">
2
- <img src="https://raw.githubusercontent.com/CircuitSavage/cloudscraper-turnstile/main/assets/peak-banner.png" alt="Peak — solve Cloudflare Turnstile & the 5s challenge in ~1s" width="100%">
3
- </a>
4
-
5
- # cloudscraper-turnstile
6
-
7
- **cloudscraper-turnstile** is a drop-in replacement for [cloudscraper](https://github.com/VeNoMouS/cloudscraper) that actually solves Cloudflare Turnstile and the 5s "Just a moment..." interstitial. It subclasses `requests.Session` exactly like cloudscraper does, so you change one import line and your existing scraper keeps working, except now the requests that used to return `403` come back with the real page.
8
-
9
- ```python
10
- import cloudscraper_turnstile as cloudscraper
11
-
12
- scraper = cloudscraper.create_scraper(api_key="pk_your_api_key")
13
- resp = scraper.get("https://protected.example.com/") # Turnstile solved, real page returned
14
- ```
15
-
16
- ## Why cloudscraper can't do this anymore
17
-
18
- cloudscraper is a good tool for the challenge it was built for, but that challenge is mostly gone:
19
-
20
- - **It only ever solved the legacy IUAM challenge.** cloudscraper works by reading Cloudflare's old "I'm Under Attack Mode" page, extracting the JavaScript math problem, and evaluating it. That is the entire mechanism.
21
- - **It has no JS engine and no browser.** Modern Cloudflare managed challenges and Turnstile run real, obfuscated browser JavaScript and collect behavioral and fingerprint signals. There is nothing in the page for a regex-and-eval tool to solve, so the request stays on the challenge page and you get a `403`, a `503`, or an endless "Just a moment..." loop.
22
- - **Its own "Turnstile support" is a hand-off.** cloudscraper never solved Turnstile itself. It added hooks to pass the challenge to a third-party paid CAPTCHA API and inject the returned token. Without one of those API keys configured, Turnstile support does nothing.
23
- - **The project is effectively unmaintained.** Its last real release was in 2023. Cloudflare has shipped many detection changes since.
24
-
25
- So on any site that switched to Turnstile or the managed 5s challenge (most of them, by now), plain cloudscraper returns the challenge HTML instead of your data. This package fills exactly that gap: it keeps cloudscraper's `create_scraper` / `requests.Session` shape and does the one thing cloudscraper cannot, by sending the challenge to a solver that runs a real browser.
26
-
27
- ## Powered by Peak
28
-
29
- This package uses [Peak](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) to solve Turnstile and the 5s challenge.
30
-
31
- - Solve Cloudflare Turnstile & the 5s challenge in about a second
32
- - $0.90 per 1,000 successful Turnstile solves, down to $0.35 at volume
33
- - 1,000 free solves to start, no card.
34
-
35
- → [Get your free API key](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Pricing](https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
36
-
37
- ## Install
38
-
39
- ```bash
40
- pip install cloudscraper-turnstile
41
- ```
42
-
43
- The only dependency is `requests` (you already have it if you used cloudscraper).
44
-
45
- ## Migration guide
46
-
47
- There is no rewrite. cloudscraper-turnstile mirrors cloudscraper's public API: `create_scraper(...)` returns a `CloudScraper` object that subclasses `requests.Session`, so `.get`, `.post`, `.request`, `.cookies`, and `.headers` all behave the same.
48
-
49
- **Before**
50
-
51
- ```python
52
- import cloudscraper
53
-
54
- scraper = cloudscraper.create_scraper()
55
- resp = scraper.get("https://protected.example.com/") # 403 / "Just a moment..." on Turnstile sites
56
- ```
57
-
58
- **After**
59
-
60
- ```python
61
- import cloudscraper_turnstile as cloudscraper # the only line that changes
62
-
63
- scraper = cloudscraper.create_scraper() # reads PEAK_API_KEY from env
64
- resp = scraper.get("https://protected.example.com/") # Turnstile solved, real page returned
65
- ```
66
-
67
- If you were already using cloudscraper's captcha-provider style, that keeps working too, so migration is a no-op:
68
-
69
- ```python
70
- scraper = cloudscraper.create_scraper(
71
- captcha={"provider": "peak", "api_key": "pk_your_api_key"},
72
- )
73
- ```
74
-
75
- Existing cloudscraper kwargs (`browser`, `delay`, `interpreter`, `allow_brotli`, `sess`, ...) are accepted and never raise, so you do not have to touch the rest of your `create_scraper` call.
76
-
77
- ## Quickstart
78
-
79
- ```bash
80
- pip install cloudscraper-turnstile requests
81
- export PEAK_API_KEY=pk_your_api_key # Windows: setx PEAK_API_KEY pk_your_api_key
82
- ```
83
-
84
- ```python
85
- import os
86
- import cloudscraper_turnstile as cloudscraper
87
-
88
- scraper = cloudscraper.create_scraper(api_key=os.environ["PEAK_API_KEY"])
89
-
90
- # Use it exactly like requests / cloudscraper. A Turnstile or 5s challenge is
91
- # detected, solved through Peak, and the request is retried transparently.
92
- resp = scraper.get("https://protected.example.com/")
93
- print(resp.status_code) # 200
94
- print(resp.text) # the real page, not the challenge
95
-
96
- # Cookies obtained during the solve (including cf_clearance) persist on the
97
- # session for every later request.
98
- resp2 = scraper.post(
99
- "https://protected.example.com/api/search",
100
- json={"q": "widgets"},
101
- )
102
- ```
103
-
104
- ### Where the key comes from
105
-
106
- The API key is resolved in this order:
107
-
108
- 1. Explicit `create_scraper(api_key="pk_...")`
109
- 2. `create_scraper(captcha={"provider": "peak", "api_key": "pk_..."})`
110
- 3. `PEAK_API_KEY` environment variable
111
-
112
- ### Using a proxy
113
-
114
- Pass a proxy and it is forwarded to Peak, so the solve happens from the same IP as your crawl (this matters, since Cloudflare ties clearance to the requesting IP):
115
-
116
- ```python
117
- scraper = cloudscraper.create_scraper(
118
- api_key="pk_your_api_key",
119
- proxy="http://user:pass@ip:port",
120
- )
121
- ```
122
-
123
- If you set `scraper.proxies` the requests way instead, that proxy is used for the solve automatically.
124
-
125
- ### Earn with your app ID
126
-
127
- Pass your Peak app id and you earn 5% of every solve this tool makes, paid as solve credit. The `app_id` is optional and only changes who is credited, never whether or how fast a challenge is solved. Create one at [peak.fo/dashboard/developer](https://peak.fo/dashboard/developer); details at [peak.fo/earn](https://peak.fo/earn).
128
-
129
- ```python
130
- scraper = cloudscraper.create_scraper(
131
- api_key="pk_your_api_key",
132
- app_id="app_your_app_id", # optional; or set PEAK_APP_ID in the env
133
- )
134
- ```
135
-
136
- ## Compatibility
137
-
138
- | cloudscraper API | Status in cloudscraper-turnstile |
139
- | --- | --- |
140
- | `create_scraper(**kwargs)` | Supported. Returns a `requests.Session` subclass. |
141
- | Returns a `requests.Session` | Yes. `CloudScraper(requests.Session)`. |
142
- | `.get / .post / .put / .delete / .request` | Supported (inherited from `requests.Session`). |
143
- | `.cookies`, `.headers`, `.proxies`, `.auth` | Supported (session state persists across the solve retry). |
144
- | `sess=` (adopt an existing Session) | Supported (cookies, headers, proxies, auth carried over). |
145
- | `captcha={"provider": ..., "api_key": ...}` | Supported. `provider: "peak"` is native; the `api_key` is read regardless. |
146
- | `browser=`, `delay=`, `interpreter=`, `allow_brotli=`, `debug=` | Accepted, never raise. `debug=True` prints solve steps. |
147
- | Legacy IUAM JS-math challenge | Handled by Cloudflare's own retry path; not the focus. |
148
- | Cloudflare Turnstile | **Solved** via Peak (`turnstiletask`). |
149
- | Cloudflare 5s "Just a moment" / managed | **Solved** via Peak (`cloudflare5stask`). |
150
-
151
- ## cloudscraper vs cloudscraper-turnstile
152
-
153
- | Challenge / trait | cloudscraper | cloudscraper-turnstile |
154
- | --- | --- | --- |
155
- | Legacy IUAM JS-math | Yes | Yes |
156
- | Cloudflare Turnstile | No (hands off to a paid API you must wire up) | **Yes** |
157
- | 5s "Just a moment" interstitial | No (no JS engine) | **Yes** |
158
- | Managed challenge | No | **Yes** |
159
- | `requests.Session` drop-in | Yes | Yes |
160
- | Actively maintained | No (last release 2023) | Yes |
161
-
162
- ## FAQ
163
-
164
- **Why is cloudscraper not working in 2026?**
165
- Because the site moved to Cloudflare Turnstile or the managed 5s challenge. cloudscraper only solves the old IUAM JavaScript-math page and has no JS engine, so on a modern challenge it returns the challenge HTML (usually `403`, `503`, or a "Just a moment..." page) instead of your data. Its last release was in 2023. cloudscraper-turnstile detects those challenges and solves them through Peak.
166
-
167
- **What is a good cloudscraper alternative for Turnstile?**
168
- cloudscraper-turnstile is built to be that alternative: same `create_scraper` API, same `requests.Session` object, but it actually solves Turnstile. Change the import, add a Peak API key, and your existing code runs.
169
-
170
- **How do I fix cloudscraper 403 Forbidden?**
171
- A `403` from a Cloudflare-protected site usually means you received the challenge page, not a real block. Confirm the body contains `cf-turnstile`, `Just a moment`, or `cf_chl_opt`. If so, switch to `import cloudscraper_turnstile as cloudscraper`, set `PEAK_API_KEY`, and the challenge is solved and the request retried automatically. If the proxy/IP that gets challenged is not your default one, pass `proxy=` so the solve matches.
172
-
173
- **Does cloudscraper solve Cloudflare Turnstile?**
174
- Not on its own. cloudscraper never solved Turnstile itself; it only added hooks to pass the token from an external paid CAPTCHA service. cloudscraper-turnstile does the solve for you through Peak and injects the `cf-turnstile-response` token, so there is nothing else to wire up.
175
-
176
- **Do I need a real browser or Selenium?**
177
- No. This is a pure `requests`-based client. The browser work happens on Peak's side; you send the sitekey and URL and get a token (or a `cf_clearance` cookie for the 5s challenge) back.
178
-
179
- **Does it handle the 5s "Just a moment" page too?**
180
- Yes. When the response is the interstitial rather than a Turnstile widget, the package calls Peak's `cloudflare5stask`, sets the returned `cf_clearance` cookie (and user-agent) on the session, and re-requests the original URL.
181
-
182
- **Will it loop forever if a solve fails?**
183
- No. Solving is capped by `max_solve_attempts` (default 3). After that the last response is returned as-is so you can inspect it.
184
-
185
- ## Legitimate use
186
-
187
- Use this for automation, QA, monitoring, and scraping public data you are allowed to access. Respect each target's Terms of Service and `robots.txt`, rate-limit yourself, and do not use it for credential stuffing or to access data you have no right to. You are responsible for how you use it.
188
-
189
- ## Links
190
-
191
- - [Peak home](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
192
- - [Turnstile docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
193
- - [Pricing](https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
194
-
195
- ## License
196
-
197
- MIT. See [LICENSE](./LICENSE).
1
+ <a href="https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile">
2
+ <img src="https://raw.githubusercontent.com/CircuitSavage/cloudscraper-turnstile/main/assets/peak-banner.png" alt="Peak: solve Cloudflare Turnstile and the 5s challenge" width="100%">
3
+ </a>
4
+
5
+ # cloudscraper-turnstile
6
+
7
+ **cloudscraper-turnstile** is a drop-in replacement for [cloudscraper](https://github.com/VeNoMouS/cloudscraper) that solves Cloudflare Turnstile and the 5s "Just a moment..." interstitial. It subclasses `requests.Session` the same way cloudscraper does, so you change one import line and your existing scraper keeps working, except now the requests that used to return `403` come back with the real page.
8
+
9
+ ```python
10
+ import cloudscraper_turnstile as cloudscraper
11
+
12
+ scraper = cloudscraper.create_scraper(api_key="pk_your_api_key")
13
+ resp = scraper.get("https://protected.example.com/") # Turnstile solved, real page returned
14
+ ```
15
+
16
+ ## Why cloudscraper can't do this anymore
17
+
18
+ cloudscraper is a good tool for the challenge it was built for, but that challenge is gone from most sites:
19
+
20
+ - **It only ever solved the legacy IUAM challenge.** cloudscraper works by reading Cloudflare's old "I'm Under Attack Mode" page, extracting the JavaScript math problem, and evaluating it. That is the entire mechanism.
21
+ - **It has no JS engine and no browser.** Modern Cloudflare managed challenges and Turnstile run real, obfuscated browser JavaScript and collect behavioral and fingerprint signals. There is nothing in the page for a regex-and-eval tool to solve, so the request stays on the challenge page and you get a `403`, a `503`, or an endless "Just a moment..." loop.
22
+ - **Its own "Turnstile support" is a hand-off.** cloudscraper never solved Turnstile itself. It added hooks to pass the challenge to a third-party paid CAPTCHA API and inject the returned token. Without one of those API keys configured, Turnstile support does nothing.
23
+ - **The project is unmaintained.** Its last real release was in 2023. Cloudflare has shipped many detection changes since.
24
+
25
+ So on any site that switched to Turnstile or the managed 5s challenge (most of them, by now), plain cloudscraper returns the challenge HTML instead of your data. This package fills that gap: it keeps cloudscraper's `create_scraper` / `requests.Session` shape and does the one thing cloudscraper cannot, by sending the challenge to a solver that runs a real browser.
26
+
27
+ ## Powered by Peak
28
+
29
+ This package uses [Peak](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) to solve Turnstile and the 5s challenge.
30
+
31
+ - [$0.90 per 1,000](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing) successful Turnstile solves, down to $0.35 at volume
32
+ - Pay only for solves that land. A failed solve is not billed.
33
+ - 1,000 free solves to start, no card.
34
+
35
+ → [Get your free API key](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile) · [Pricing](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing)
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install cloudscraper-turnstile
41
+ ```
42
+
43
+ The only dependency is `requests` (you already have it if you used cloudscraper).
44
+
45
+ ## Migration guide
46
+
47
+ There is no rewrite. cloudscraper-turnstile mirrors cloudscraper's public API: `create_scraper(...)` returns a `CloudScraper` object that subclasses `requests.Session`, so `.get`, `.post`, `.request`, `.cookies`, and `.headers` all behave the same.
48
+
49
+ **Before**
50
+
51
+ ```python
52
+ import cloudscraper
53
+
54
+ scraper = cloudscraper.create_scraper()
55
+ resp = scraper.get("https://protected.example.com/") # 403 / "Just a moment..." on Turnstile sites
56
+ ```
57
+
58
+ **After**
59
+
60
+ ```python
61
+ import cloudscraper_turnstile as cloudscraper # the only line that changes
62
+
63
+ scraper = cloudscraper.create_scraper() # reads PEAK_API_KEY from env
64
+ resp = scraper.get("https://protected.example.com/") # Turnstile solved, real page returned
65
+ ```
66
+
67
+ If you were already using cloudscraper's captcha-provider style, that keeps working too, so migration is a no-op:
68
+
69
+ ```python
70
+ scraper = cloudscraper.create_scraper(
71
+ captcha={"provider": "peak", "api_key": "pk_your_api_key"},
72
+ )
73
+ ```
74
+
75
+ Existing cloudscraper kwargs (`browser`, `delay`, `interpreter`, `allow_brotli`, `sess`, ...) are accepted and never raise, so you do not have to touch the rest of your `create_scraper` call.
76
+
77
+ ## Quickstart
78
+
79
+ ```bash
80
+ pip install cloudscraper-turnstile requests
81
+ export PEAK_API_KEY=pk_your_api_key # Windows: setx PEAK_API_KEY pk_your_api_key
82
+ ```
83
+
84
+ ```python
85
+ import os
86
+ import cloudscraper_turnstile as cloudscraper
87
+
88
+ scraper = cloudscraper.create_scraper(api_key=os.environ["PEAK_API_KEY"])
89
+
90
+ # Use it like requests / cloudscraper. A Turnstile or 5s challenge is
91
+ # detected, solved through Peak, and the request is retried for you.
92
+ resp = scraper.get("https://protected.example.com/")
93
+ print(resp.status_code) # 200
94
+ print(resp.text) # the real page, not the challenge
95
+
96
+ # Cookies obtained during the solve (including cf_clearance) persist on the
97
+ # session for every later request.
98
+ resp2 = scraper.post(
99
+ "https://protected.example.com/api/search",
100
+ json={"q": "widgets"},
101
+ )
102
+ ```
103
+
104
+ ### Where the key comes from
105
+
106
+ The API key is resolved in this order:
107
+
108
+ 1. Explicit `create_scraper(api_key="pk_...")`
109
+ 2. `create_scraper(captcha={"provider": "peak", "api_key": "pk_..."})`
110
+ 3. `PEAK_API_KEY` environment variable
111
+
112
+ ### Using a proxy
113
+
114
+ Pass a proxy and it is forwarded to Peak, so the solve happens from the same IP as your crawl (this matters, since Cloudflare ties clearance to the requesting IP):
115
+
116
+ ```python
117
+ scraper = cloudscraper.create_scraper(
118
+ api_key="pk_your_api_key",
119
+ proxy="http://user:pass@ip:port",
120
+ )
121
+ ```
122
+
123
+ If you set `scraper.proxies` the requests way instead, the solve uses that proxy too.
124
+
125
+ ### Earn with your app ID
126
+
127
+ Pass your Peak app id and you earn 5% of every solve this tool makes, paid as solve credit. The `app_id` is optional and only changes who is credited, never whether or how fast a challenge is solved. Create one at [peak.fo/dashboard/developer](https://peak.fo/dashboard/developer); details at [peak.fo/earn](https://peak.fo/earn).
128
+
129
+ ```python
130
+ scraper = cloudscraper.create_scraper(
131
+ api_key="pk_your_api_key",
132
+ app_id="app_your_app_id", # optional; or set PEAK_APP_ID in the env
133
+ )
134
+ ```
135
+
136
+ ## Compatibility
137
+
138
+ | cloudscraper API | Status in cloudscraper-turnstile |
139
+ | --- | --- |
140
+ | `create_scraper(**kwargs)` | Supported. Returns a `requests.Session` subclass. |
141
+ | Returns a `requests.Session` | Yes. `CloudScraper(requests.Session)`. |
142
+ | `.get / .post / .put / .delete / .request` | Supported (inherited from `requests.Session`). |
143
+ | `.cookies`, `.headers`, `.proxies`, `.auth` | Supported (session state persists across the solve retry). |
144
+ | `sess=` (adopt an existing Session) | Supported (cookies, headers, proxies, auth carried over). |
145
+ | `captcha={"provider": ..., "api_key": ...}` | Supported. `provider: "peak"` is native; the `api_key` is read regardless. |
146
+ | `browser=`, `delay=`, `interpreter=`, `allow_brotli=`, `debug=` | Accepted, never raise. `debug=True` prints solve steps. |
147
+ | Legacy IUAM JS-math challenge | Handled by Cloudflare's own retry path; not the focus. |
148
+ | Cloudflare Turnstile | **Solved** via Peak (`turnstiletask`). |
149
+ | Cloudflare 5s "Just a moment" / managed | **Solved** via Peak (`cloudflare5stask`). |
150
+
151
+ ## cloudscraper vs cloudscraper-turnstile
152
+
153
+ | Challenge / trait | cloudscraper | cloudscraper-turnstile |
154
+ | --- | --- | --- |
155
+ | Legacy IUAM JS-math | Yes | Yes |
156
+ | Cloudflare Turnstile | No (hands off to a paid API you must wire up) | **Yes** |
157
+ | 5s "Just a moment" interstitial | No (no JS engine) | **Yes** |
158
+ | Managed challenge | No | **Yes** |
159
+ | `requests.Session` drop-in | Yes | Yes |
160
+ | Actively maintained | No (last release 2023) | Yes |
161
+
162
+ ## FAQ
163
+
164
+ **Why is cloudscraper not working in 2026?**
165
+ Because the site moved to Cloudflare Turnstile or the managed 5s challenge. cloudscraper only solves the old IUAM JavaScript-math page and has no JS engine, so on a modern challenge it returns the challenge HTML (usually `403`, `503`, or a "Just a moment..." page) instead of your data. Its last release was in 2023. cloudscraper-turnstile detects those challenges and solves them through Peak.
166
+
167
+ **What is a good cloudscraper alternative for Turnstile?**
168
+ cloudscraper-turnstile is built to be that alternative: same `create_scraper` API, same `requests.Session` object, and it solves Turnstile. Change the import, add a Peak API key, and your existing code runs.
169
+
170
+ **How do I fix cloudscraper 403 Forbidden?**
171
+ A `403` from a Cloudflare-protected site means, in most cases, that you received the challenge page, not a real block. Confirm the body contains `cf-turnstile`, `Just a moment`, or `cf_chl_opt`. If so, switch to `import cloudscraper_turnstile as cloudscraper`, set `PEAK_API_KEY`, and the package solves the challenge and retries the request. If the proxy/IP that gets challenged is not your default one, pass `proxy=` so the solve matches.
172
+
173
+ **Does cloudscraper solve Cloudflare Turnstile?**
174
+ Not on its own. cloudscraper never solved Turnstile itself; it only added hooks to pass the token from an external paid CAPTCHA service. cloudscraper-turnstile does the solve for you through Peak and injects the `cf-turnstile-response` token, so there is nothing else to wire up.
175
+
176
+ **Do I need a real browser or Selenium?**
177
+ No. This is a pure `requests`-based client. The browser work happens on Peak's side; you send the sitekey and URL and get a token (or a `cf_clearance` cookie for the 5s challenge) back.
178
+
179
+ **Does it handle the 5s "Just a moment" page too?**
180
+ Yes. When the response is the interstitial rather than a Turnstile widget, the package calls Peak's `cloudflare5stask`, sets the returned `cf_clearance` cookie (and user-agent) on the session, and re-requests the original URL.
181
+
182
+ **Will it loop forever if a solve fails?**
183
+ No. Solving is capped by `max_solve_attempts` (default 3). After that the last response is returned as-is so you can inspect it.
184
+
185
+ ## Troubleshooting
186
+
187
+ The package raises `PeakError` with a string you can grep for, or hands you back the challenge page when it gives up. Each case, and the two failures that show up after a solve, has a longer write-up on the Peak blog.
188
+
189
+ - **`PeakError: No Peak API key.`** None of the three sources above had a key. Keys start with `pk_`; the free one comes from the [dashboard](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile).
190
+ - **`PeakError: Peak request failed: ...`** The HTTP call to `api.peak.fo` itself failed: a DNS or TLS error, a proxy that refused the connection, or a timeout. The `proxy=` you pass is forwarded to Peak for the solve, not used for this call; check your own network path first.
191
+ - **`PeakError: <error text from Peak>`** Peak answered with `success: false`. The text is Peak's own reason, for example an exhausted balance or a sitekey the solver could not clear. The [Cloudflare Turnstile error codes](https://blog.peak.fo/cloudflare-turnstile-error-codes/) post covers the widget-side codes (110200, 300030, 600010 and friends) that often sit behind a failed solve.
192
+ - **`scraper.get()` returns the challenge HTML with no exception.** The solve ran up to `max_solve_attempts` times (default 3) and the site still served a challenge, so the last response comes back as-is. Pass `debug=True` to `create_scraper` to print each attempt. The usual cause is an egress mismatch: Cloudflare ties `cf_clearance` to the IP and User-Agent that earned it, so a clearance solved from Peak's network and replayed from yours gets refused. Pass `proxy=` (or set `scraper.proxies`) so the solve and the crawl share one IP. [Cloudflare Turnstile 403](https://blog.peak.fo/cloudflare-turnstile-403-scraper-fix/) walks through the fix.
193
+ - **The page had a Turnstile widget but the package took the 5s path.** `_solve_and_retry` goes the Turnstile route only when it finds a `data-sitekey` in the HTML. A widget rendered by script after load has no sitekey in the raw body, so the package treats the response as an interstitial. [How to find a Cloudflare Turnstile sitekey](https://blog.peak.fo/how-to-find-a-cloudflare-turnstile-sitekey/) shows where sites hide it, and [Turnstile token vs cookie](https://blog.peak.fo/cloudflare-turnstile-token-vs-cookie/) explains which of the two artefacts a given page wants.
194
+ - **A later request 403s even though the first one passed.** The `cf_clearance` cookie expired or the site rotated its challenge. The session keeps the cookie, so the next challenged request triggers a fresh solve. [The Cloudflare 5-second challenge explained](https://blog.peak.fo/the-cloudflare-5-second-challenge-explained/) covers how long a clearance lives, and [the cf-turnstile-response token explained](https://blog.peak.fo/the-cf-turnstile-response-token-explained/) covers the token side.
195
+
196
+ Two longer reads for this stack: [How to scrape Cloudflare-protected sites without getting blocked](https://blog.peak.fo/how-to-scrape-cloudflare-protected-sites-without-getting-blocked/) (also on [Hashnode](https://peakfo.hashnode.dev/how-to-scrape-cloudflare-protected-sites-without-getting-blocked)) and the [2026 Turnstile developer guide](https://blog.peak.fo/how-to-solve-cloudflare-turnstile-in-2026-dev-guide/).
197
+
198
+ ## Related
199
+
200
+ Same pattern for other stacks: [turnstile-curl](https://github.com/CircuitSavage/turnstile-curl) (the `curl_cffi` companion, also browserless) · [scrapy-turnstile](https://github.com/CircuitSavage/scrapy-turnstile) · [scrapling-turnstile](https://github.com/CircuitSavage/scrapling-turnstile) · [playwright-turnstile](https://github.com/CircuitSavage/playwright-turnstile) · [patchright-turnstile](https://github.com/CircuitSavage/patchright-turnstile) · [camoufox-turnstile](https://github.com/CircuitSavage/camoufox-turnstile) · [nodriver-turnstile](https://github.com/CircuitSavage/nodriver-turnstile) · [pydoll-turnstile](https://github.com/CircuitSavage/pydoll-turnstile) · [drissionpage-turnstile](https://github.com/CircuitSavage/drissionpage-turnstile) · [selenium-turnstile](https://github.com/CircuitSavage/selenium-turnstile) · [botasaurus-turnstile](https://github.com/CircuitSavage/botasaurus-turnstile) · [crawlee-turnstile](https://github.com/CircuitSavage/crawlee-turnstile) · [puppeteer-extra-plugin-turnstile](https://github.com/CircuitSavage/puppeteer-extra-plugin-turnstile) · [browser-use-turnstile](https://github.com/CircuitSavage/browser-use-turnstile) · [crawl4ai-turnstile](https://github.com/CircuitSavage/crawl4ai-turnstile). Full list in [awesome-turnstile-solvers](https://github.com/CircuitSavage/awesome-turnstile-solvers).
201
+
202
+ If you want to know what the widget does before it hands out a token, [cloudflare-turnstile-reversed](https://github.com/CircuitSavage/cloudflare-turnstile-reversed) documents the challenge flow, the widget parameters and the fingerprinting it runs.
203
+
204
+ ## Legitimate use
205
+
206
+ Use this for automation, QA, monitoring, and scraping public data you are allowed to access. Respect each target's Terms of Service and `robots.txt`, rate-limit yourself, and do not use it for credential stuffing or to access data you have no right to. You are responsible for how you use it.
207
+
208
+ ## Links
209
+
210
+ - [Peak home](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
211
+ - [Turnstile docs](https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile)
212
+ - [Pricing](https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile#pricing)
213
+
214
+ ## License
215
+
216
+ MIT. See [LICENSE](./LICENSE).
@@ -1,52 +1,52 @@
1
- """cloudscraper-turnstile: a cloudscraper drop-in that solves Cloudflare
2
- Turnstile and the 5s interstitial through the Peak API.
3
-
4
- Swap two lines and existing code keeps working::
5
-
6
- import cloudscraper_turnstile as cloudscraper
7
-
8
- scraper = cloudscraper.create_scraper(api_key="pk_your_api_key")
9
- r = scraper.get("https://protected.example.com/")
10
- print(r.status_code, r.text)
11
- """
12
-
13
- from __future__ import annotations
14
-
15
- from .detect import (
16
- extract_sitekey,
17
- extract_turnstile_fields,
18
- is_cloudflare_challenge,
19
- is_interstitial_challenge,
20
- is_turnstile_challenge,
21
- )
22
- from .peak import (
23
- PeakClient,
24
- PeakError,
25
- build_cloudflare5s_payload,
26
- build_turnstile_payload,
27
- )
28
- from .scraper import (
29
- CloudScraper,
30
- create_scraper,
31
- resolve_api_key,
32
- resolve_app_id,
33
- )
34
-
35
- __version__ = "0.2.1"
36
-
37
- __all__ = [
38
- "create_scraper",
39
- "CloudScraper",
40
- "resolve_api_key",
41
- "resolve_app_id",
42
- "PeakClient",
43
- "PeakError",
44
- "build_turnstile_payload",
45
- "build_cloudflare5s_payload",
46
- "is_cloudflare_challenge",
47
- "is_turnstile_challenge",
48
- "is_interstitial_challenge",
49
- "extract_sitekey",
50
- "extract_turnstile_fields",
51
- "__version__",
52
- ]
1
+ """cloudscraper-turnstile: a cloudscraper drop-in that solves Cloudflare
2
+ Turnstile and the 5s interstitial through the Peak API.
3
+
4
+ Swap two lines and existing code keeps working::
5
+
6
+ import cloudscraper_turnstile as cloudscraper
7
+
8
+ scraper = cloudscraper.create_scraper(api_key="pk_your_api_key")
9
+ r = scraper.get("https://protected.example.com/")
10
+ print(r.status_code, r.text)
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from .detect import (
16
+ extract_sitekey,
17
+ extract_turnstile_fields,
18
+ is_cloudflare_challenge,
19
+ is_interstitial_challenge,
20
+ is_turnstile_challenge,
21
+ )
22
+ from .peak import (
23
+ PeakClient,
24
+ PeakError,
25
+ build_cloudflare5s_payload,
26
+ build_turnstile_payload,
27
+ )
28
+ from .scraper import (
29
+ CloudScraper,
30
+ create_scraper,
31
+ resolve_api_key,
32
+ resolve_app_id,
33
+ )
34
+
35
+ __version__ = "0.2.2"
36
+
37
+ __all__ = [
38
+ "create_scraper",
39
+ "CloudScraper",
40
+ "resolve_api_key",
41
+ "resolve_app_id",
42
+ "PeakClient",
43
+ "PeakError",
44
+ "build_turnstile_payload",
45
+ "build_cloudflare5s_payload",
46
+ "is_cloudflare_challenge",
47
+ "is_turnstile_challenge",
48
+ "is_interstitial_challenge",
49
+ "extract_sitekey",
50
+ "extract_turnstile_fields",
51
+ "__version__",
52
+ ]
@@ -1,65 +1,65 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "cloudscraper-turnstile"
7
- version = "0.2.1"
8
- description = "cloudscraper drop-in that actually solves Cloudflare Turnstile and the 5s interstitial via the Peak API. Subclasses requests.Session; swap two lines and your existing scraper works."
9
- readme = "README.md"
10
- requires-python = ">=3.8"
11
- license = { text = "MIT" }
12
- authors = [{ name = "Peak" }]
13
- keywords = [
14
- "cloudscraper",
15
- "cloudscraper-alternative",
16
- "cloudflare",
17
- "cloudflare-bypass",
18
- "turnstile",
19
- "cloudflare-turnstile",
20
- "captcha",
21
- "captcha-solver",
22
- "scraper",
23
- "web-scraping",
24
- "requests",
25
- "bypass",
26
- "403",
27
- "anti-bot",
28
- ]
29
- classifiers = [
30
- "Development Status :: 4 - Beta",
31
- "Intended Audience :: Developers",
32
- "License :: OSI Approved :: MIT License",
33
- "Operating System :: OS Independent",
34
- "Programming Language :: Python :: 3",
35
- "Programming Language :: Python :: 3.8",
36
- "Programming Language :: Python :: 3.9",
37
- "Programming Language :: Python :: 3.10",
38
- "Programming Language :: Python :: 3.11",
39
- "Programming Language :: Python :: 3.12",
40
- "Programming Language :: Python :: 3.13",
41
- "Topic :: Internet :: WWW/HTTP",
42
- "Topic :: Internet :: WWW/HTTP :: Indexing/Search",
43
- "Topic :: Software Development :: Libraries :: Python Modules",
44
- ]
45
- dependencies = ["requests>=2.25"]
46
-
47
- [project.urls]
48
- Homepage = "https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
49
- Documentation = "https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
50
- Pricing = "https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
51
- Source = "https://github.com/CircuitSavage/cloudscraper-turnstile"
52
-
53
- [tool.hatch.build.targets.wheel]
54
- packages = ["cloudscraper_turnstile"]
55
-
56
- [tool.hatch.build.targets.sdist]
57
- include = [
58
- "cloudscraper_turnstile",
59
- "examples",
60
- "tests",
61
- "assets",
62
- "README.md",
63
- "LICENSE",
64
- "TEST.md",
65
- ]
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "cloudscraper-turnstile"
7
+ version = "0.2.2"
8
+ description = "cloudscraper drop-in that actually solves Cloudflare Turnstile and the 5s interstitial via the Peak API. Subclasses requests.Session; swap two lines and your existing scraper works."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Peak" }]
13
+ keywords = [
14
+ "cloudscraper",
15
+ "cloudscraper-alternative",
16
+ "cloudflare",
17
+ "cloudflare-bypass",
18
+ "turnstile",
19
+ "cloudflare-turnstile",
20
+ "captcha",
21
+ "captcha-solver",
22
+ "scraper",
23
+ "web-scraping",
24
+ "requests",
25
+ "bypass",
26
+ "403",
27
+ "anti-bot",
28
+ ]
29
+ classifiers = [
30
+ "Development Status :: 4 - Beta",
31
+ "Intended Audience :: Developers",
32
+ "License :: OSI Approved :: MIT License",
33
+ "Operating System :: OS Independent",
34
+ "Programming Language :: Python :: 3",
35
+ "Programming Language :: Python :: 3.8",
36
+ "Programming Language :: Python :: 3.9",
37
+ "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.11",
39
+ "Programming Language :: Python :: 3.12",
40
+ "Programming Language :: Python :: 3.13",
41
+ "Topic :: Internet :: WWW/HTTP",
42
+ "Topic :: Internet :: WWW/HTTP :: Indexing/Search",
43
+ "Topic :: Software Development :: Libraries :: Python Modules",
44
+ ]
45
+ dependencies = ["requests>=2.25"]
46
+
47
+ [project.urls]
48
+ Homepage = "https://peak.fo/?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
49
+ Documentation = "https://peak.fo/docs/turnstile?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
50
+ Pricing = "https://peak.fo/pricing?utm_source=github&utm_medium=readme&utm_campaign=packages&utm_content=cloudscraper-turnstile"
51
+ Source = "https://github.com/CircuitSavage/cloudscraper-turnstile"
52
+
53
+ [tool.hatch.build.targets.wheel]
54
+ packages = ["cloudscraper_turnstile"]
55
+
56
+ [tool.hatch.build.targets.sdist]
57
+ include = [
58
+ "cloudscraper_turnstile",
59
+ "examples",
60
+ "tests",
61
+ "assets",
62
+ "README.md",
63
+ "LICENSE",
64
+ "TEST.md",
65
+ ]