|
6 | 6 | from datetime import timedelta
|
7 | 7 | from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
|
8 | 8 |
|
9 |
| -from crawlee.storages import RequestList |
10 | 9 | from lazy_object_proxy import Proxy
|
11 | 10 | from pydantic import AliasChoices
|
12 | 11 | from typing_extensions import Self
|
13 | 12 |
|
14 | 13 | from apify_client import ApifyClientAsync
|
15 | 14 | from apify_shared.consts import ActorEnvVars, ActorExitCodes, ApifyEnvVars
|
16 | 15 | from apify_shared.utils import ignore_docs, maybe_extract_enum_member_value
|
17 |
| -from crawlee import service_container, Request |
| 16 | +from crawlee import Request, service_container |
18 | 17 | from crawlee.events._types import Event, EventPersistStateData
|
| 18 | +from crawlee.storages import RequestList |
19 | 19 |
|
20 | 20 | from apify._configuration import Configuration
|
21 | 21 | from apify._consts import EVENT_LISTENERS_TIMEOUT
|
@@ -976,18 +976,19 @@ async def create_proxy_configuration(
|
976 | 976 | return proxy_configuration
|
977 | 977 |
|
978 | 978 | @staticmethod
|
979 |
| - def create_request_list( |
980 |
| - *, |
981 |
| - actor_start_urls_input: dict |
982 |
| - ) ->RequestList: |
983 |
| - return RequestList(requests=[ |
984 |
| - Request.from_url( |
985 |
| - method=request_input.get("method"), |
986 |
| - url=request_input.get("url"), |
987 |
| - payload=request_input.get("payload", "").encode("utf-8"), |
988 |
| - headers=request_input.get("headers", {}), |
989 |
| - user_data=request_input.get("userData", {}), |
990 |
| - ) for request_input in actor_start_urls_input]) |
| 979 | + def create_request_list(*, actor_start_urls_input: dict) -> RequestList: |
| 980 | + return RequestList( |
| 981 | + requests=[ |
| 982 | + Request.from_url( |
| 983 | + method=request_input.get('method'), |
| 984 | + url=request_input.get('url'), |
| 985 | + payload=request_input.get('payload', '').encode('utf-8'), |
| 986 | + headers=request_input.get('headers', {}), |
| 987 | + user_data=request_input.get('userData', {}), |
| 988 | + ) |
| 989 | + for request_input in actor_start_urls_input |
| 990 | + ] |
| 991 | + ) |
991 | 992 |
|
992 | 993 |
|
993 | 994 | Actor = cast(_ActorType, Proxy(_ActorType))
|
|
0 commit comments