reqstorm 2.4.0__tar.gz → 2.4.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.
- {reqstorm-2.4.0/reqstorm.egg-info → reqstorm-2.4.2}/PKG-INFO +36 -4
- {reqstorm-2.4.0 → reqstorm-2.4.2}/README.md +25 -1
- {reqstorm-2.4.0 → reqstorm-2.4.2}/pyproject.toml +11 -2
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/__init__.py +1 -1
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_client.py +2 -2
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_socks.py +19 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2/reqstorm.egg-info}/PKG-INFO +36 -4
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_socks_backoff.py +20 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/LICENSE +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/__main__.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_adaptive.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_auth.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_cache.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_cli.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_files.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_legacy.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_limits.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_observe.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_paginate.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_plan.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_progress.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_pydantic.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_report.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_schema.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_schema_sinks.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_sync.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/_template.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm/py.typed +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm.egg-info/SOURCES.txt +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm.egg-info/dependency_links.txt +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm.egg-info/entry_points.txt +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm.egg-info/requires.txt +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/reqstorm.egg-info/top_level.txt +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/setup.cfg +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_adaptive.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_auth.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_cache_proxy.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_cli.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_fetch_all.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_files.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_legacy.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_limits.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_observe.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_ordered_and_db.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_paginate.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_pydantic.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_report.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_run_report.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_schema.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_schema_db.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_stream.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_sync.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_template.py +0 -0
- {reqstorm-2.4.0 → reqstorm-2.4.2}/tests/test_tls.py +0 -0
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reqstorm
|
|
3
|
-
Version: 2.4.
|
|
4
|
-
Summary: Send
|
|
3
|
+
Version: 2.4.2
|
|
4
|
+
Summary: Send thousands of HTTP requests from Python or the command line, with per-host rate limits, retries, pagination, progress and logs, and results written to files or databases.
|
|
5
5
|
Author-email: Melih Colpan <colpanmelih@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://reqstorm.github.io
|
|
8
|
+
Project-URL: Documentation, https://reqstorm.github.io
|
|
8
9
|
Project-URL: Source, https://github.com/melihcolpan/reqstorm
|
|
9
10
|
Project-URL: Changelog, https://github.com/melihcolpan/reqstorm/blob/master/CHANGELOG.md
|
|
10
11
|
Project-URL: Issues, https://github.com/melihcolpan/reqstorm/issues
|
|
11
|
-
Keywords: asyncio,aiohttp,
|
|
12
|
+
Keywords: http,http-client,asyncio,aiohttp,bulk-requests,batch,concurrency,rate-limit,retry,backoff,pagination,api-client,cli,socks,jsonl,sqlite,postgresql
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Console
|
|
13
15
|
Classifier: Framework :: AsyncIO
|
|
16
|
+
Classifier: Framework :: Pydantic :: 2
|
|
14
17
|
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
20
|
Classifier: Operating System :: OS Independent
|
|
16
21
|
Classifier: Programming Language :: Python :: 3
|
|
17
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -20,7 +25,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Topic :: Database
|
|
23
29
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
30
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
31
|
+
Classifier: Topic :: Utilities
|
|
24
32
|
Classifier: Typing :: Typed
|
|
25
33
|
Requires-Python: >=3.9
|
|
26
34
|
Description-Content-Type: text/markdown
|
|
@@ -144,11 +152,35 @@ reqstorm does all of that for you, with one call.
|
|
|
144
152
|
|
|
145
153
|
## Installation
|
|
146
154
|
|
|
155
|
+
**In your Python code:**
|
|
156
|
+
|
|
147
157
|
```console
|
|
148
158
|
$ python -m pip install reqstorm
|
|
149
159
|
```
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
**As a command** (`reqstorm urls.txt -o out.jsonl`), pick what you already use:
|
|
162
|
+
|
|
163
|
+
| You have | Install with |
|
|
164
|
+
|---|---|
|
|
165
|
+
| Homebrew (macOS, Linux) | `brew install melihcolpan/tap/reqstorm` |
|
|
166
|
+
| pipx | `pipx install "reqstorm[socks]"` |
|
|
167
|
+
| uv | `uv tool install "reqstorm[socks]"` |
|
|
168
|
+
| Docker | nothing to install, see below |
|
|
169
|
+
|
|
170
|
+
```console
|
|
171
|
+
$ docker run --rm -v "$PWD:/data" \
|
|
172
|
+
ghcr.io/melihcolpan/reqstorm \
|
|
173
|
+
urls.txt -o results.jsonl
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Python 3.9 to 3.13 on Linux, macOS and Windows. The only required dependency is [aiohttp](https://docs.aiohttp.org). Optional extras:
|
|
177
|
+
|
|
178
|
+
| Extra | Adds |
|
|
179
|
+
|---|---|
|
|
180
|
+
| `reqstorm[socks]` | SOCKS4/5 proxies |
|
|
181
|
+
| `reqstorm[pydantic]` | Pydantic models as schemas |
|
|
182
|
+
|
|
183
|
+
For PostgreSQL or MySQL output, install the driver you already use (`psycopg`, `psycopg2`, `pymysql`, `mysqlclient` or `mysql-connector-python`).
|
|
152
184
|
|
|
153
185
|
## Quick start
|
|
154
186
|
|
|
@@ -99,11 +99,35 @@ reqstorm does all of that for you, with one call.
|
|
|
99
99
|
|
|
100
100
|
## Installation
|
|
101
101
|
|
|
102
|
+
**In your Python code:**
|
|
103
|
+
|
|
102
104
|
```console
|
|
103
105
|
$ python -m pip install reqstorm
|
|
104
106
|
```
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
**As a command** (`reqstorm urls.txt -o out.jsonl`), pick what you already use:
|
|
109
|
+
|
|
110
|
+
| You have | Install with |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Homebrew (macOS, Linux) | `brew install melihcolpan/tap/reqstorm` |
|
|
113
|
+
| pipx | `pipx install "reqstorm[socks]"` |
|
|
114
|
+
| uv | `uv tool install "reqstorm[socks]"` |
|
|
115
|
+
| Docker | nothing to install, see below |
|
|
116
|
+
|
|
117
|
+
```console
|
|
118
|
+
$ docker run --rm -v "$PWD:/data" \
|
|
119
|
+
ghcr.io/melihcolpan/reqstorm \
|
|
120
|
+
urls.txt -o results.jsonl
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Python 3.9 to 3.13 on Linux, macOS and Windows. The only required dependency is [aiohttp](https://docs.aiohttp.org). Optional extras:
|
|
124
|
+
|
|
125
|
+
| Extra | Adds |
|
|
126
|
+
|---|---|
|
|
127
|
+
| `reqstorm[socks]` | SOCKS4/5 proxies |
|
|
128
|
+
| `reqstorm[pydantic]` | Pydantic models as schemas |
|
|
129
|
+
|
|
130
|
+
For PostgreSQL or MySQL output, install the driver you already use (`psycopg`, `psycopg2`, `pymysql`, `mysqlclient` or `mysql-connector-python`).
|
|
107
131
|
|
|
108
132
|
## Quick start
|
|
109
133
|
|
|
@@ -5,18 +5,23 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "reqstorm"
|
|
7
7
|
dynamic = ["version"]
|
|
8
|
-
description = "Send
|
|
8
|
+
description = "Send thousands of HTTP requests from Python or the command line, with per-host rate limits, retries, pagination, progress and logs, and results written to files or databases."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
12
|
authors = [{ name = "Melih Colpan", email = "colpanmelih@gmail.com" }]
|
|
13
13
|
requires-python = ">=3.9"
|
|
14
14
|
dependencies = ["aiohttp>=3.9,<4"]
|
|
15
|
-
keywords = ["
|
|
15
|
+
keywords = ["http", "http-client", "asyncio", "aiohttp", "bulk-requests", "batch", "concurrency", "rate-limit",
|
|
16
|
+
"retry", "backoff", "pagination", "api-client", "cli", "socks", "jsonl", "sqlite", "postgresql"]
|
|
16
17
|
classifiers = [
|
|
17
18
|
"Development Status :: 5 - Production/Stable",
|
|
19
|
+
"Environment :: Console",
|
|
18
20
|
"Framework :: AsyncIO",
|
|
21
|
+
"Framework :: Pydantic :: 2",
|
|
19
22
|
"Intended Audience :: Developers",
|
|
23
|
+
"Intended Audience :: Science/Research",
|
|
24
|
+
"Intended Audience :: System Administrators",
|
|
20
25
|
"Operating System :: OS Independent",
|
|
21
26
|
"Programming Language :: Python :: 3",
|
|
22
27
|
"Programming Language :: Python :: 3 :: Only",
|
|
@@ -25,7 +30,10 @@ classifiers = [
|
|
|
25
30
|
"Programming Language :: Python :: 3.11",
|
|
26
31
|
"Programming Language :: Python :: 3.12",
|
|
27
32
|
"Programming Language :: Python :: 3.13",
|
|
33
|
+
"Topic :: Database",
|
|
28
34
|
"Topic :: Internet :: WWW/HTTP",
|
|
35
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
36
|
+
"Topic :: Utilities",
|
|
29
37
|
"Typing :: Typed",
|
|
30
38
|
]
|
|
31
39
|
|
|
@@ -40,6 +48,7 @@ reqstorm = "reqstorm._cli:main"
|
|
|
40
48
|
|
|
41
49
|
[project.urls]
|
|
42
50
|
Homepage = "https://reqstorm.github.io"
|
|
51
|
+
Documentation = "https://reqstorm.github.io"
|
|
43
52
|
Source = "https://github.com/melihcolpan/reqstorm"
|
|
44
53
|
Changelog = "https://github.com/melihcolpan/reqstorm/blob/master/CHANGELOG.md"
|
|
45
54
|
Issues = "https://github.com/melihcolpan/reqstorm/issues"
|
|
@@ -33,7 +33,7 @@ from ._schema import Field, Schema, SchemaError, extract, infer_schema
|
|
|
33
33
|
from ._sync import fetch_all_sync, fetch_to_db_sync, fetch_to_file_sync, stream_sync
|
|
34
34
|
from ._template import from_template, read_csv, read_sql
|
|
35
35
|
|
|
36
|
-
__version__ = "2.4.
|
|
36
|
+
__version__ = "2.4.2"
|
|
37
37
|
|
|
38
38
|
__all__ = [
|
|
39
39
|
"Attempt",
|
|
@@ -35,7 +35,7 @@ from multidict import CIMultiDict, CIMultiDictProxy
|
|
|
35
35
|
from ._adaptive import AdaptiveRateLimiter
|
|
36
36
|
from ._limits import HostRateLimiter, RateLimit, host_key
|
|
37
37
|
from ._observe import LogLevel, LogTarget, ProgressTarget, Run, describe
|
|
38
|
-
from ._socks import SocksSessions, check_available, is_socks
|
|
38
|
+
from ._socks import SocksSessions, check_available, is_proxy_error, is_socks
|
|
39
39
|
|
|
40
40
|
__all__ = ["Attempt", "HTTPStatusError", "Request", "Result", "Results", "fetch_all", "stream"]
|
|
41
41
|
|
|
@@ -284,7 +284,7 @@ def _resolve(request: Union[str, Request], options: _Options) -> Request:
|
|
|
284
284
|
def _is_retryable_error(error: BaseException) -> bool:
|
|
285
285
|
if isinstance(error, (aiohttp.InvalidURL, ValueError)):
|
|
286
286
|
return False
|
|
287
|
-
return isinstance(error, (aiohttp.ClientError, asyncio.TimeoutError))
|
|
287
|
+
return isinstance(error, (aiohttp.ClientError, asyncio.TimeoutError)) or is_proxy_error(error)
|
|
288
288
|
|
|
289
289
|
|
|
290
290
|
def _should_retry(result: Result, retry_statuses: frozenset) -> bool:
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import importlib
|
|
5
6
|
from typing import Any, Dict, Optional, Tuple
|
|
6
7
|
from urllib.parse import unquote, urlsplit
|
|
7
8
|
|
|
@@ -15,6 +16,24 @@ def is_socks(proxy: Optional[str]) -> bool:
|
|
|
15
16
|
return proxy is not None and urlsplit(proxy).scheme.lower() in SCHEMES
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
def is_proxy_error(error: BaseException) -> bool:
|
|
20
|
+
"""A failure of a SOCKS proxy: unreachable, refused, timed out or a bad reply.
|
|
21
|
+
|
|
22
|
+
These are worth retrying: the next attempt may use another proxy from the pool, or the
|
|
23
|
+
proxy may be back.
|
|
24
|
+
"""
|
|
25
|
+
kinds: Tuple[type, ...] = ()
|
|
26
|
+
# aiohttp-socks raises its own classes; python-socks has classes of the same names
|
|
27
|
+
for module in ("aiohttp_socks", "python_socks"):
|
|
28
|
+
try:
|
|
29
|
+
package = importlib.import_module(module)
|
|
30
|
+
except ImportError:
|
|
31
|
+
continue
|
|
32
|
+
names = ("ProxyError", "ProxyConnectionError", "ProxyTimeoutError")
|
|
33
|
+
kinds += tuple(getattr(package, name) for name in names if hasattr(package, name))
|
|
34
|
+
return bool(kinds) and isinstance(error, kinds)
|
|
35
|
+
|
|
36
|
+
|
|
18
37
|
def check_available() -> None:
|
|
19
38
|
try:
|
|
20
39
|
import aiohttp_socks # noqa: F401
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reqstorm
|
|
3
|
-
Version: 2.4.
|
|
4
|
-
Summary: Send
|
|
3
|
+
Version: 2.4.2
|
|
4
|
+
Summary: Send thousands of HTTP requests from Python or the command line, with per-host rate limits, retries, pagination, progress and logs, and results written to files or databases.
|
|
5
5
|
Author-email: Melih Colpan <colpanmelih@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://reqstorm.github.io
|
|
8
|
+
Project-URL: Documentation, https://reqstorm.github.io
|
|
8
9
|
Project-URL: Source, https://github.com/melihcolpan/reqstorm
|
|
9
10
|
Project-URL: Changelog, https://github.com/melihcolpan/reqstorm/blob/master/CHANGELOG.md
|
|
10
11
|
Project-URL: Issues, https://github.com/melihcolpan/reqstorm/issues
|
|
11
|
-
Keywords: asyncio,aiohttp,
|
|
12
|
+
Keywords: http,http-client,asyncio,aiohttp,bulk-requests,batch,concurrency,rate-limit,retry,backoff,pagination,api-client,cli,socks,jsonl,sqlite,postgresql
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Console
|
|
13
15
|
Classifier: Framework :: AsyncIO
|
|
16
|
+
Classifier: Framework :: Pydantic :: 2
|
|
14
17
|
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
20
|
Classifier: Operating System :: OS Independent
|
|
16
21
|
Classifier: Programming Language :: Python :: 3
|
|
17
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -20,7 +25,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Topic :: Database
|
|
23
29
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
30
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
31
|
+
Classifier: Topic :: Utilities
|
|
24
32
|
Classifier: Typing :: Typed
|
|
25
33
|
Requires-Python: >=3.9
|
|
26
34
|
Description-Content-Type: text/markdown
|
|
@@ -144,11 +152,35 @@ reqstorm does all of that for you, with one call.
|
|
|
144
152
|
|
|
145
153
|
## Installation
|
|
146
154
|
|
|
155
|
+
**In your Python code:**
|
|
156
|
+
|
|
147
157
|
```console
|
|
148
158
|
$ python -m pip install reqstorm
|
|
149
159
|
```
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
**As a command** (`reqstorm urls.txt -o out.jsonl`), pick what you already use:
|
|
162
|
+
|
|
163
|
+
| You have | Install with |
|
|
164
|
+
|---|---|
|
|
165
|
+
| Homebrew (macOS, Linux) | `brew install melihcolpan/tap/reqstorm` |
|
|
166
|
+
| pipx | `pipx install "reqstorm[socks]"` |
|
|
167
|
+
| uv | `uv tool install "reqstorm[socks]"` |
|
|
168
|
+
| Docker | nothing to install, see below |
|
|
169
|
+
|
|
170
|
+
```console
|
|
171
|
+
$ docker run --rm -v "$PWD:/data" \
|
|
172
|
+
ghcr.io/melihcolpan/reqstorm \
|
|
173
|
+
urls.txt -o results.jsonl
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Python 3.9 to 3.13 on Linux, macOS and Windows. The only required dependency is [aiohttp](https://docs.aiohttp.org). Optional extras:
|
|
177
|
+
|
|
178
|
+
| Extra | Adds |
|
|
179
|
+
|---|---|
|
|
180
|
+
| `reqstorm[socks]` | SOCKS4/5 proxies |
|
|
181
|
+
| `reqstorm[pydantic]` | Pydantic models as schemas |
|
|
182
|
+
|
|
183
|
+
For PostgreSQL or MySQL output, install the driver you already use (`psycopg`, `psycopg2`, `pymysql`, `mysqlclient` or `mysql-connector-python`).
|
|
152
184
|
|
|
153
185
|
## Quick start
|
|
154
186
|
|
|
@@ -142,3 +142,23 @@ async def test_max_backoff_limits_the_real_wait(server):
|
|
|
142
142
|
async def test_negative_backoff_is_rejected(server):
|
|
143
143
|
with pytest.raises(ValueError, match="backoff"):
|
|
144
144
|
await reqstorm.fetch_all([server + "/ok"], max_backoff=-1)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
async def test_unreachable_socks_proxy_is_retried_with_the_next_one(server, socks_proxy):
|
|
148
|
+
dead = "socks5://127.0.0.1:9"
|
|
149
|
+
results = await reqstorm.fetch_all(
|
|
150
|
+
[server + "/ok"], proxy=[dead, socks_proxy.url()], retries=1, backoff=0
|
|
151
|
+
)
|
|
152
|
+
assert results[0].text() == "ok" and results[0].attempts == 2
|
|
153
|
+
assert results[0].history[0].error is not None and len(socks_proxy.requests) == 1
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def test_proxy_failures_count_as_retryable_errors():
|
|
157
|
+
import aiohttp_socks
|
|
158
|
+
import python_socks
|
|
159
|
+
|
|
160
|
+
from reqstorm._client import _is_retryable_error
|
|
161
|
+
|
|
162
|
+
for package in (aiohttp_socks, python_socks):
|
|
163
|
+
for name in ("ProxyError", "ProxyConnectionError", "ProxyTimeoutError"):
|
|
164
|
+
assert _is_retryable_error(getattr(package, name)("x")), (package.__name__, name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|