apify 2.1.0b2__py3-none-any.whl → 2.1.0b4__py3-none-any.whl
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.
Potentially problematic release.
This version of apify might be problematic. Click here for more details.
apify/scrapy/requests.py
CHANGED
|
@@ -42,8 +42,10 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
|
|
|
42
42
|
Returns:
|
|
43
43
|
The converted Apify request if the conversion was successful, otherwise None.
|
|
44
44
|
"""
|
|
45
|
-
if not isinstance(
|
|
46
|
-
Actor.log.warning(
|
|
45
|
+
if not isinstance(scrapy_request, Request):
|
|
46
|
+
Actor.log.warning( # type: ignore[unreachable]
|
|
47
|
+
'Failed to convert to Apify request: Scrapy request must be a Request instance.'
|
|
48
|
+
)
|
|
47
49
|
return None
|
|
48
50
|
|
|
49
51
|
call_id = crypto_random_object_id(8)
|
|
@@ -53,7 +55,7 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
|
|
|
53
55
|
if _is_request_produced_by_middleware(scrapy_request):
|
|
54
56
|
unique_key = compute_unique_key(
|
|
55
57
|
url=scrapy_request.url,
|
|
56
|
-
method=scrapy_request.method,
|
|
58
|
+
method=scrapy_request.method, # type: ignore[arg-type] # str vs literal
|
|
57
59
|
payload=scrapy_request.body,
|
|
58
60
|
use_extended_unique_key=True,
|
|
59
61
|
)
|
|
@@ -80,9 +82,9 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
|
|
|
80
82
|
|
|
81
83
|
# Convert Scrapy's headers to a HttpHeaders and store them in the apify_request
|
|
82
84
|
if isinstance(scrapy_request.headers, Headers):
|
|
83
|
-
apify_request.headers = HttpHeaders(scrapy_request.headers.to_unicode_dict())
|
|
85
|
+
apify_request.headers = HttpHeaders(dict(scrapy_request.headers.to_unicode_dict()))
|
|
84
86
|
else:
|
|
85
|
-
Actor.log.warning(
|
|
87
|
+
Actor.log.warning( # type: ignore[unreachable]
|
|
86
88
|
f'Invalid scrapy_request.headers type, not scrapy.http.headers.Headers: {scrapy_request.headers}'
|
|
87
89
|
)
|
|
88
90
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apify
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.0b4
|
|
4
4
|
Summary: Apify SDK for Python
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: apify,sdk,automation,chrome,crawlee,crawler,headless,scraper,scraping
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
21
21
|
Provides-Extra: scrapy
|
|
22
22
|
Requires-Dist: apify-client (>=1.8.1)
|
|
23
23
|
Requires-Dist: apify-shared (>=1.1.2)
|
|
24
|
-
Requires-Dist: crawlee (>=0.
|
|
24
|
+
Requires-Dist: crawlee (>=0.4.0,<0.5.0)
|
|
25
25
|
Requires-Dist: cryptography (>=42.0.0)
|
|
26
26
|
Requires-Dist: httpx (>=0.27.0)
|
|
27
27
|
Requires-Dist: lazy-object-proxy (>=1.10.0)
|
|
@@ -26,13 +26,13 @@ apify/scrapy/pipelines/__init__.py,sha256=GWPeLN_Zwj8vRBWtXW6DaxdB7mvyQ7Jw5Tz1cc
|
|
|
26
26
|
apify/scrapy/pipelines/actor_dataset_push.py,sha256=otggoULfUdCqOPJLb9wMROZ9WylnlL-209930tMS2Rg,971
|
|
27
27
|
apify/scrapy/pipelines/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
apify/scrapy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
apify/scrapy/requests.py,sha256=
|
|
29
|
+
apify/scrapy/requests.py,sha256=yZ9hIsz2YyqOoOwzN9F1h76wG4qwawrI6h_6xq0I7Iw,7599
|
|
30
30
|
apify/scrapy/scheduler.py,sha256=03kZxejWWb-TofJ-vpSZuQ28rT-qNjhhpC-QeO2OzoU,5977
|
|
31
31
|
apify/scrapy/utils.py,sha256=758DcHCSAgCTProY0QX74uJ1XrzVsQwvCmFanj2f_3Q,2928
|
|
32
32
|
apify/storages/__init__.py,sha256=AE4ZJ-iAoESmQQh_RUU78fe5CxBUnu9wlEZleQc5SwA,177
|
|
33
33
|
apify/storages/_request_list.py,sha256=4nrvSdMUF-kiwGVIPEfIOygLKgjUpO37Jl8Om-jRbIU,5858
|
|
34
34
|
apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
apify-2.1.
|
|
36
|
-
apify-2.1.
|
|
37
|
-
apify-2.1.
|
|
38
|
-
apify-2.1.
|
|
35
|
+
apify-2.1.0b4.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
|
|
36
|
+
apify-2.1.0b4.dist-info/METADATA,sha256=WTFcYAN5G6uf26amRBQ5473WyesTupcffLcJh3DaxFs,8672
|
|
37
|
+
apify-2.1.0b4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
38
|
+
apify-2.1.0b4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|