esuls 0.2.2__tar.gz → 0.2.3__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.
- {esuls-0.2.2/src/esuls.egg-info → esuls-0.2.3}/PKG-INFO +1 -1
- {esuls-0.2.2 → esuls-0.2.3}/pyproject.toml +1 -1
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/request_cli.py +24 -2
- {esuls-0.2.2 → esuls-0.2.3/src/esuls.egg-info}/PKG-INFO +1 -1
- {esuls-0.2.2 → esuls-0.2.3}/LICENSE +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/README.md +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/setup.cfg +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/__init__.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/db_cli.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/download_icon.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/pdf/__init__.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/pdf/checker.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/pdf/cli.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/pdf/inspect.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/pdf/metadata.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/_common.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/conftest.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_cross_loop.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_db_advanced.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_db_concurrent.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_db_fixes.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_db_migrations.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_db_sqla.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_pdf.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/tests/test_request_cli.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls/utils.py +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls.egg-info/SOURCES.txt +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls.egg-info/dependency_links.txt +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls.egg-info/entry_points.txt +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls.egg-info/requires.txt +0 -0
- {esuls-0.2.2 → esuls-0.2.3}/src/esuls.egg-info/top_level.txt +0 -0
|
@@ -876,6 +876,27 @@ async def make_request_playwright(
|
|
|
876
876
|
await stealth_async(page)
|
|
877
877
|
page.set_default_timeout(timeout_request * 1000)
|
|
878
878
|
|
|
879
|
+
# Track the final main-frame document response. JS cookie
|
|
880
|
+
# challenges (Sucuri CloudProxy, some Cloudflare/HSTS 307s)
|
|
881
|
+
# answer the first request with a 307 + a script that sets a
|
|
882
|
+
# cookie and calls location.reload(); the real page then loads
|
|
883
|
+
# with a fresh 200. page.goto() only returns that first
|
|
884
|
+
# response (the 307), so we follow the main frame's last
|
|
885
|
+
# navigation response to report the status/headers of the
|
|
886
|
+
# document actually rendered.
|
|
887
|
+
final_doc: dict = {"resp": None}
|
|
888
|
+
|
|
889
|
+
def _track_main_doc(r):
|
|
890
|
+
try:
|
|
891
|
+
if (r.request.is_navigation_request()
|
|
892
|
+
and r.frame is page.main_frame):
|
|
893
|
+
final_doc["resp"] = r
|
|
894
|
+
except Exception:
|
|
895
|
+
# Frame/request may already be torn down mid-event.
|
|
896
|
+
pass
|
|
897
|
+
|
|
898
|
+
page.on("response", _track_main_doc)
|
|
899
|
+
|
|
879
900
|
resp = await page.goto(url, wait_until="domcontentloaded")
|
|
880
901
|
# Wait for network activity to settle (more robust than a fixed
|
|
881
902
|
# sleep for SPAs). Bounded by `wait_seconds` so pages with
|
|
@@ -894,13 +915,14 @@ async def make_request_playwright(
|
|
|
894
915
|
f"networkidle wait expired, proceeding: {wait_err}"
|
|
895
916
|
)
|
|
896
917
|
|
|
918
|
+
doc_resp = final_doc["resp"] or resp
|
|
897
919
|
page_source = await page.content()
|
|
898
920
|
final_url = page.url
|
|
899
|
-
status_code =
|
|
921
|
+
status_code = doc_resp.status if doc_resp else 200
|
|
900
922
|
|
|
901
923
|
response = Response(
|
|
902
924
|
status_code=status_code,
|
|
903
|
-
headers=dict(
|
|
925
|
+
headers=dict(doc_resp.headers) if doc_resp else {},
|
|
904
926
|
_content=page_source.encode("utf-8"),
|
|
905
927
|
text=page_source,
|
|
906
928
|
url=final_url,
|
|
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
|