scrapely-python 0.1.45__tar.gz → 0.1.46__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.
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/CHANGELOG.md +4 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/PKG-INFO +1 -1
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/pyproject.toml +1 -1
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/__init__.py +1 -1
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/solver.py +36 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/PKG-INFO +1 -1
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/LICENSE +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/LICENSE-APACHE +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/MANIFEST.in +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/NOTICE +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/README.md +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/setup.cfg +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/_browser_locations.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/actor.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/browser_configuration.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/cdp_retry.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/charging.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/charging_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/configuration.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/crypto/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/crypto/_secrets.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/errors.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/events/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/events/_types.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/events/event_manager.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_capture.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_compat.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_detect.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_headers.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_options.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_policy.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_profiles.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_response.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_stats.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/_transport.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/http/profiles.json +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/log.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/patch_browser_pool.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/pricing_types.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/proxy_configuration.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/py.typed +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/request_loaders/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/request_loaders/_scrapely_request_list.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/_actor_runner.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/_async_thread.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/_logging_config.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/_serialization.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/_warnings.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/_graceful_stop.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/_httpcache.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/middlewares/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/middlewares/apify_proxy.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/pipelines/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/pipelines/actor_dataset_push.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/requests.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/scheduler.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/utils.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/_file_system/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/_file_system/_key_value_store_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/_file_system/_storage_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/_metadata.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/api_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/patch_storage.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_dataset_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_kvs_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_rq_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/smart_scrapely_storage_client.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/types.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/utils.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage_clients/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storages/__init__.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/types.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/webhook.py +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/SOURCES.txt +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/dependency_links.txt +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/requires.txt +0 -0
- {scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/top_level.txt +0 -0
|
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.1.46] - 2026-11-10
|
|
8
|
+
|
|
9
|
+
- `scrapely.solver.AkamaiSensor.report(session, verified)`: after `solve_sbsd()` or `solve_pixel()`, re-fetch the page and report whether the site let the session through (`True`) or still showed its bot check (`False`). The platform stores it on that solve, the same way `Solver.report()` does for step solves, so a site that starts refusing these answers shows up in solver health and in the refusal alerts. Best effort: it never raises, and a second report for the same answer is ignored. Needs a platform that sends `x-scrapely-solve-id` on compat answers; on an older one it does nothing.
|
|
10
|
+
|
|
7
11
|
## [0.1.45] - 2026-11-09
|
|
8
12
|
|
|
9
13
|
- **Dataset pushes larger than the API's 10 MiB request limit are stored instead of failing.** The API refuses a request body over 10 MiB (10,485,760 bytes) with `413`. `Actor.push_data(rows)` (and `Dataset.push_data`, crawler `context.push_data`) used to send all rows in one request, so a few big rows that each fitted (for example videos with many subtitle tracks) failed the whole push, and an actor that retried it failed the same way each time. A push that fits one request is sent exactly as before. A larger one is now sent in pieces of at most 9 MiB, in order, as the JS SDK does.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scrapely-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.46"
|
|
8
8
|
description = "Scrapely Python SDK - A toolkit for building Actors on the Scrapely platform"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT AND Apache-2.0"
|
|
@@ -95,6 +95,8 @@ DEGRADED_STATUS_MESSAGE = "Site protection temporarily unavailable, results may
|
|
|
95
95
|
UNAVAILABLE_CODES = ("vendor_degraded", "vendor_down", "provider_unavailable", "vendor_unsupported", "solver_not_enabled")
|
|
96
96
|
|
|
97
97
|
_COMPAT_SUFFIXES = ("/compat/v1",)
|
|
98
|
+
# Header of a compat solve answer: the id its verification is reported under (POST …/solves/<id>/outcome).
|
|
99
|
+
_SOLVE_ID_HEADER = "x-scrapely-solve-id"
|
|
98
100
|
_STATUS_TTL_SECS = 15.0
|
|
99
101
|
_MAX_BODY = 4 * 1024 * 1024
|
|
100
102
|
|
|
@@ -1117,6 +1119,10 @@ class AkamaiSensor:
|
|
|
1117
1119
|
home = await session.get("https://www.example.com/")
|
|
1118
1120
|
result = await akamai.solve(session, "https://www.example.com/", home.text)
|
|
1119
1121
|
page = await session.get("https://www.example.com/item/1")
|
|
1122
|
+
|
|
1123
|
+
After an SBSD or pixel answer, tell the platform whether the site accepted it:
|
|
1124
|
+
``await akamai.report(session, page_is_usable)``. That keeps the site's refusal rate visible in
|
|
1125
|
+
solver health and alerts.
|
|
1120
1126
|
"""
|
|
1121
1127
|
|
|
1122
1128
|
def __init__(
|
|
@@ -1135,6 +1141,8 @@ class AkamaiSensor:
|
|
|
1135
1141
|
self.max_rounds = max_rounds
|
|
1136
1142
|
self.sessions = 0
|
|
1137
1143
|
self.accepted = 0
|
|
1144
|
+
# The platform's id for the latest SBSD / pixel answer per session (see `report`).
|
|
1145
|
+
self._solve_ids: dict[int, str] = {}
|
|
1138
1146
|
|
|
1139
1147
|
@staticmethod
|
|
1140
1148
|
def _endpoint() -> tuple[str, str]:
|
|
@@ -1143,6 +1151,32 @@ class AkamaiSensor:
|
|
|
1143
1151
|
raise VendorUnavailable("solver_not_enabled", "akamai", None, "the platform solver is not available to this run")
|
|
1144
1152
|
return env
|
|
1145
1153
|
|
|
1154
|
+
# -- verification ------------------------------------------------------------
|
|
1155
|
+
|
|
1156
|
+
def _remember(self, session: Any, response: Any) -> None:
|
|
1157
|
+
solve_id = response.headers.get(_SOLVE_ID_HEADER)
|
|
1158
|
+
if solve_id:
|
|
1159
|
+
self._solve_ids[id(session)] = str(solve_id)[:64]
|
|
1160
|
+
|
|
1161
|
+
async def report(self, session: Any, verified: bool) -> None:
|
|
1162
|
+
"""Report whether the site let `session` through after its latest SBSD or pixel answer.
|
|
1163
|
+
|
|
1164
|
+
Call it after you re-fetched the page: ``True`` when the page came back, ``False`` when the bot
|
|
1165
|
+
check was still there. The platform stores it on that solve, so a site that starts refusing these
|
|
1166
|
+
answers shows up in solver health and alerts. Best effort: never raises, and a second report for
|
|
1167
|
+
the same answer is ignored.
|
|
1168
|
+
"""
|
|
1169
|
+
solve_id = self._solve_ids.pop(id(session), None)
|
|
1170
|
+
gw = _gateway()
|
|
1171
|
+
if not solve_id or gw is None:
|
|
1172
|
+
return
|
|
1173
|
+
base, key = gw
|
|
1174
|
+
try:
|
|
1175
|
+
async with httpx.AsyncClient(timeout=15) as api:
|
|
1176
|
+
await api.post(f"{base}/solves/{solve_id}/outcome", json={"verified": bool(verified)}, headers={"authorization": f"Bearer {key}"})
|
|
1177
|
+
except Exception: # noqa: BLE001 - reporting is best effort
|
|
1178
|
+
pass
|
|
1179
|
+
|
|
1146
1180
|
# -- SBSD --------------------------------------------------------------------
|
|
1147
1181
|
|
|
1148
1182
|
async def solve_sbsd(self, session: Any, url: str, html: str) -> bool:
|
|
@@ -1162,6 +1196,7 @@ class AkamaiSensor:
|
|
|
1162
1196
|
json={"bundle": {"scriptSrc": src_attr, "source": source}, "document": {"url": url, "html": html, "cookieHeader": cookie_header}, "profile": {"id": self.profile_id}},
|
|
1163
1197
|
)
|
|
1164
1198
|
check_solver_response(r.status_code, r.text, r.headers.get("retry-after"))
|
|
1199
|
+
self._remember(session, r)
|
|
1165
1200
|
data = _json(r.text)
|
|
1166
1201
|
rows = sorted([s for s in data.get("submissions") or [] if isinstance(s, dict) and s.get("resolvedUrl")], key=lambda s: s.get("index", 0))
|
|
1167
1202
|
if not rows:
|
|
@@ -1194,6 +1229,7 @@ class AkamaiSensor:
|
|
|
1194
1229
|
"profile": {"id": self.profile_id}, "script": {"source": source, "url": collector}},
|
|
1195
1230
|
)
|
|
1196
1231
|
check_solver_response(r.status_code, r.text, r.headers.get("retry-after"))
|
|
1232
|
+
self._remember(session, r)
|
|
1197
1233
|
data = _json(r.text)
|
|
1198
1234
|
request = data.get("request") if isinstance(data.get("request"), dict) else {}
|
|
1199
1235
|
if not data.get("ok") or not isinstance(request.get("body"), str):
|
|
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
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/__init__.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/_graceful_stop.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/extensions/_httpcache.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/middlewares/__init__.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/scrapy/middlewares/apify_proxy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/_file_system/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_dataset_client.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_kvs_client.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_rq_client.py
RENAMED
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely/storage/scrapely_storage_client.py
RENAMED
|
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
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{scrapely_python-0.1.45 → scrapely_python-0.1.46}/src/scrapely_python.egg-info/top_level.txt
RENAMED
|
File without changes
|