@crawlee/core 4.0.0-beta.24 → 4.0.0-beta.241
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.
- package/README.md +15 -15
- package/byte-utils.d.ts +17 -0
- package/byte-utils.js +42 -0
- package/configuration.d.ts +77 -235
- package/configuration.js +157 -227
- package/debug.d.ts +36 -0
- package/debug.js +70 -0
- package/errors.d.ts +45 -18
- package/errors.js +58 -27
- package/events/event-manager.d.ts +78 -0
- package/events/{event_manager.js → event-manager.js} +12 -13
- package/events/index.d.ts +3 -3
- package/events/index.js +2 -3
- package/events/local-event-manager.d.ts +32 -0
- package/events/local-event-manager.js +101 -0
- package/events/system-info.d.ts +38 -0
- package/events/system-info.js +1 -0
- package/index.d.ts +9 -12
- package/index.js +10 -11
- package/internal.d.ts +8 -0
- package/internal.js +9 -0
- package/iterables.d.ts +79 -0
- package/iterables.js +134 -0
- package/log.d.ts +77 -1
- package/log.js +134 -1
- package/memory-storage/consts.d.ts +4 -0
- package/memory-storage/consts.js +4 -0
- package/memory-storage/index.d.ts +1 -0
- package/memory-storage/index.js +1 -0
- package/memory-storage/memory-storage.d.ts +43 -0
- package/memory-storage/memory-storage.js +158 -0
- package/memory-storage/resource-clients/common/base-client.d.ts +4 -0
- package/memory-storage/resource-clients/common/base-client.js +6 -0
- package/memory-storage/resource-clients/dataset.d.ts +35 -0
- package/memory-storage/resource-clients/dataset.js +108 -0
- package/memory-storage/resource-clients/key-value-store.d.ts +54 -0
- package/memory-storage/resource-clients/key-value-store.js +179 -0
- package/memory-storage/resource-clients/request-queue.d.ts +55 -0
- package/memory-storage/resource-clients/request-queue.js +413 -0
- package/memory-storage/utils.d.ts +16 -0
- package/memory-storage/utils.js +41 -0
- package/owned-or-injected.d.ts +58 -0
- package/owned-or-injected.js +98 -0
- package/package.json +20 -20
- package/proxy-configuration.d.ts +118 -0
- package/proxy-configuration.js +141 -0
- package/recoverable-state.d.ts +177 -0
- package/recoverable-state.js +268 -0
- package/request.d.ts +48 -93
- package/request.js +112 -230
- package/serialization.d.ts +0 -1
- package/serialization.js +18 -18
- package/service-locator.d.ts +168 -0
- package/service-locator.js +255 -0
- package/storages/batched-adds.d.ts +37 -0
- package/storages/batched-adds.js +73 -0
- package/storages/dataset.d.ts +105 -58
- package/storages/dataset.js +292 -150
- package/storages/index.d.ts +11 -12
- package/storages/index.js +7 -12
- package/storages/key-value-store-codec.d.ts +32 -0
- package/storages/key-value-store-codec.js +108 -0
- package/storages/{key_value_store.d.ts → key-value-store.d.ts} +169 -72
- package/storages/key-value-store.js +767 -0
- package/storages/request-dedup-cache.d.ts +20 -0
- package/storages/request-dedup-cache.js +48 -0
- package/storages/{request_list.d.ts → request-list.d.ts} +33 -173
- package/storages/{request_list.js → request-list.js} +276 -255
- package/storages/request-loader.d.ts +127 -0
- package/storages/request-loader.js +36 -0
- package/storages/request-manager-tandem.d.ts +82 -0
- package/storages/request-manager-tandem.js +200 -0
- package/storages/request-manager.d.ts +119 -0
- package/storages/request-manager.js +1 -0
- package/storages/{request_provider.d.ts → request-queue.d.ts} +128 -159
- package/storages/request-queue.js +870 -0
- package/storages/storage-instance-manager.d.ts +86 -0
- package/storages/storage-instance-manager.js +256 -0
- package/storages/storage-stats.d.ts +48 -0
- package/storages/storage-stats.js +29 -0
- package/storages/transaction.d.ts +270 -0
- package/storages/transaction.js +296 -0
- package/storages/utils.d.ts +59 -11
- package/storages/utils.js +76 -16
- package/system-info/cpu-info.d.ts +67 -0
- package/system-info/cpu-info.js +216 -0
- package/system-info/memory-info.d.ts +31 -0
- package/system-info/memory-info.js +115 -0
- package/system-info/ps-tree.d.ts +17 -0
- package/system-info/ps-tree.js +144 -0
- package/system-info/runtime.d.ts +14 -0
- package/system-info/runtime.js +80 -0
- package/typedefs.d.ts +0 -6
- package/typedefs.js +0 -1
- package/url.d.ts +9 -0
- package/url.js +11 -0
- package/validators.d.ts +23 -18
- package/validators.js +14 -18
- package/autoscaling/autoscaled_pool.d.ts +0 -300
- package/autoscaling/autoscaled_pool.d.ts.map +0 -1
- package/autoscaling/autoscaled_pool.js +0 -533
- package/autoscaling/autoscaled_pool.js.map +0 -1
- package/autoscaling/index.d.ts +0 -4
- package/autoscaling/index.d.ts.map +0 -1
- package/autoscaling/index.js +0 -4
- package/autoscaling/index.js.map +0 -1
- package/autoscaling/snapshotter.d.ts +0 -189
- package/autoscaling/snapshotter.d.ts.map +0 -1
- package/autoscaling/snapshotter.js +0 -285
- package/autoscaling/snapshotter.js.map +0 -1
- package/autoscaling/system_status.d.ts +0 -181
- package/autoscaling/system_status.d.ts.map +0 -1
- package/autoscaling/system_status.js +0 -169
- package/autoscaling/system_status.js.map +0 -1
- package/configuration.d.ts.map +0 -1
- package/configuration.js.map +0 -1
- package/cookie_utils.d.ts +0 -43
- package/cookie_utils.d.ts.map +0 -1
- package/cookie_utils.js +0 -111
- package/cookie_utils.js.map +0 -1
- package/crawlers/context_pipeline.d.ts +0 -61
- package/crawlers/context_pipeline.d.ts.map +0 -1
- package/crawlers/context_pipeline.js +0 -99
- package/crawlers/context_pipeline.js.map +0 -1
- package/crawlers/crawler_commons.d.ts +0 -191
- package/crawlers/crawler_commons.d.ts.map +0 -1
- package/crawlers/crawler_commons.js +0 -108
- package/crawlers/crawler_commons.js.map +0 -1
- package/crawlers/crawler_utils.d.ts +0 -10
- package/crawlers/crawler_utils.d.ts.map +0 -1
- package/crawlers/crawler_utils.js +0 -12
- package/crawlers/crawler_utils.js.map +0 -1
- package/crawlers/error_snapshotter.d.ts +0 -60
- package/crawlers/error_snapshotter.d.ts.map +0 -1
- package/crawlers/error_snapshotter.js +0 -118
- package/crawlers/error_snapshotter.js.map +0 -1
- package/crawlers/error_tracker.d.ts +0 -55
- package/crawlers/error_tracker.d.ts.map +0 -1
- package/crawlers/error_tracker.js +0 -309
- package/crawlers/error_tracker.js.map +0 -1
- package/crawlers/index.d.ts +0 -7
- package/crawlers/index.d.ts.map +0 -1
- package/crawlers/index.js +0 -7
- package/crawlers/index.js.map +0 -1
- package/crawlers/internals/types.d.ts +0 -8
- package/crawlers/internals/types.d.ts.map +0 -1
- package/crawlers/internals/types.js +0 -2
- package/crawlers/internals/types.js.map +0 -1
- package/crawlers/statistics.d.ts +0 -213
- package/crawlers/statistics.d.ts.map +0 -1
- package/crawlers/statistics.js +0 -349
- package/crawlers/statistics.js.map +0 -1
- package/enqueue_links/enqueue_links.d.ts +0 -249
- package/enqueue_links/enqueue_links.d.ts.map +0 -1
- package/enqueue_links/enqueue_links.js +0 -269
- package/enqueue_links/enqueue_links.js.map +0 -1
- package/enqueue_links/index.d.ts +0 -3
- package/enqueue_links/index.d.ts.map +0 -1
- package/enqueue_links/index.js +0 -3
- package/enqueue_links/index.js.map +0 -1
- package/enqueue_links/shared.d.ts +0 -73
- package/enqueue_links/shared.d.ts.map +0 -1
- package/enqueue_links/shared.js +0 -212
- package/enqueue_links/shared.js.map +0 -1
- package/errors.d.ts.map +0 -1
- package/errors.js.map +0 -1
- package/events/event_manager.d.ts +0 -52
- package/events/event_manager.d.ts.map +0 -1
- package/events/event_manager.js.map +0 -1
- package/events/index.d.ts.map +0 -1
- package/events/index.js.map +0 -1
- package/events/local_event_manager.d.ts +0 -27
- package/events/local_event_manager.d.ts.map +0 -1
- package/events/local_event_manager.js +0 -75
- package/events/local_event_manager.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/log.d.ts.map +0 -1
- package/log.js.map +0 -1
- package/proxy_configuration.d.ts +0 -169
- package/proxy_configuration.d.ts.map +0 -1
- package/proxy_configuration.js +0 -247
- package/proxy_configuration.js.map +0 -1
- package/recoverable_state.d.ts +0 -123
- package/recoverable_state.d.ts.map +0 -1
- package/recoverable_state.js +0 -140
- package/recoverable_state.js.map +0 -1
- package/request.d.ts.map +0 -1
- package/request.js.map +0 -1
- package/router.d.ts +0 -134
- package/router.d.ts.map +0 -1
- package/router.js +0 -164
- package/router.js.map +0 -1
- package/serialization.d.ts.map +0 -1
- package/serialization.js.map +0 -1
- package/session_pool/consts.d.ts +0 -4
- package/session_pool/consts.d.ts.map +0 -1
- package/session_pool/consts.js +0 -4
- package/session_pool/consts.js.map +0 -1
- package/session_pool/errors.d.ts +0 -8
- package/session_pool/errors.d.ts.map +0 -1
- package/session_pool/errors.js +0 -12
- package/session_pool/errors.js.map +0 -1
- package/session_pool/events.d.ts +0 -3
- package/session_pool/events.d.ts.map +0 -1
- package/session_pool/events.js +0 -3
- package/session_pool/events.js.map +0 -1
- package/session_pool/index.d.ts +0 -6
- package/session_pool/index.d.ts.map +0 -1
- package/session_pool/index.js +0 -6
- package/session_pool/index.js.map +0 -1
- package/session_pool/session.d.ts +0 -186
- package/session_pool/session.d.ts.map +0 -1
- package/session_pool/session.js +0 -278
- package/session_pool/session.js.map +0 -1
- package/session_pool/session_pool.d.ts +0 -258
- package/session_pool/session_pool.d.ts.map +0 -1
- package/session_pool/session_pool.js +0 -387
- package/session_pool/session_pool.js.map +0 -1
- package/storages/access_checking.d.ts +0 -13
- package/storages/access_checking.d.ts.map +0 -1
- package/storages/access_checking.js +0 -14
- package/storages/access_checking.js.map +0 -1
- package/storages/dataset.d.ts.map +0 -1
- package/storages/dataset.js.map +0 -1
- package/storages/index.d.ts.map +0 -1
- package/storages/index.js.map +0 -1
- package/storages/key_value_store.d.ts.map +0 -1
- package/storages/key_value_store.js +0 -512
- package/storages/key_value_store.js.map +0 -1
- package/storages/request_list.d.ts.map +0 -1
- package/storages/request_list.js.map +0 -1
- package/storages/request_list_adapter.d.ts +0 -58
- package/storages/request_list_adapter.d.ts.map +0 -1
- package/storages/request_list_adapter.js +0 -81
- package/storages/request_list_adapter.js.map +0 -1
- package/storages/request_manager_tandem.d.ts +0 -68
- package/storages/request_manager_tandem.d.ts.map +0 -1
- package/storages/request_manager_tandem.js +0 -124
- package/storages/request_manager_tandem.js.map +0 -1
- package/storages/request_provider.d.ts.map +0 -1
- package/storages/request_provider.js +0 -591
- package/storages/request_provider.js.map +0 -1
- package/storages/request_queue.d.ts +0 -128
- package/storages/request_queue.d.ts.map +0 -1
- package/storages/request_queue.js +0 -320
- package/storages/request_queue.js.map +0 -1
- package/storages/request_queue_v2.d.ts +0 -87
- package/storages/request_queue_v2.d.ts.map +0 -1
- package/storages/request_queue_v2.js +0 -438
- package/storages/request_queue_v2.js.map +0 -1
- package/storages/sitemap_request_list.d.ts +0 -250
- package/storages/sitemap_request_list.d.ts.map +0 -1
- package/storages/sitemap_request_list.js +0 -431
- package/storages/sitemap_request_list.js.map +0 -1
- package/storages/storage_manager.d.ts +0 -62
- package/storages/storage_manager.d.ts.map +0 -1
- package/storages/storage_manager.js +0 -105
- package/storages/storage_manager.js.map +0 -1
- package/storages/utils.d.ts.map +0 -1
- package/storages/utils.js.map +0 -1
- package/typedefs.d.ts.map +0 -1
- package/typedefs.js.map +0 -1
- package/validators.d.ts.map +0 -1
- package/validators.js.map +0 -1
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
|
|
2
|
-
import type { BetterIntervalID } from '@apify/utilities';
|
|
3
|
-
import { Configuration } from '../configuration.js';
|
|
4
|
-
export declare const enum EventType {
|
|
5
|
-
PERSIST_STATE = "persistState",
|
|
6
|
-
SYSTEM_INFO = "systemInfo",
|
|
7
|
-
MIGRATING = "migrating",
|
|
8
|
-
ABORTING = "aborting",
|
|
9
|
-
EXIT = "exit"
|
|
10
|
-
}
|
|
11
|
-
export type EventTypeName = EventType | 'systemInfo' | 'persistState' | 'migrating' | 'aborting' | 'exit';
|
|
12
|
-
interface Intervals {
|
|
13
|
-
persistState?: BetterIntervalID;
|
|
14
|
-
systemInfo?: BetterIntervalID;
|
|
15
|
-
}
|
|
16
|
-
export declare abstract class EventManager {
|
|
17
|
-
readonly config: Configuration;
|
|
18
|
-
protected events: AsyncEventEmitter<{}>;
|
|
19
|
-
protected initialized: boolean;
|
|
20
|
-
protected intervals: Intervals;
|
|
21
|
-
// @ts-ignore optional peer dependency or compatibility with es2022
|
|
22
|
-
protected log: import("@apify/log").Log;
|
|
23
|
-
constructor(config?: Configuration);
|
|
24
|
-
/**
|
|
25
|
-
* Initializes the event manager by creating the `persistState` event interval.
|
|
26
|
-
* This is automatically called at the beginning of `crawler.run()`.
|
|
27
|
-
*/
|
|
28
|
-
init(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Clears the internal `persistState` event interval.
|
|
31
|
-
* This is automatically called at the end of `crawler.run()`.
|
|
32
|
-
*/
|
|
33
|
-
close(): Promise<void>;
|
|
34
|
-
on(event: EventTypeName, listener: (...args: any[]) => any): void;
|
|
35
|
-
off(event: EventTypeName, listener?: (...args: any[]) => any): void;
|
|
36
|
-
emit(event: EventTypeName, ...args: unknown[]): void;
|
|
37
|
-
isInitialized(): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
listenerCount(event: EventTypeName): number;
|
|
42
|
-
/**
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
listeners(event: EventTypeName): (() => Promise<unknown>)[];
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
waitForAllListenersToComplete(): Promise<boolean>;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=event_manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event_manager.d.ts","sourceRoot":"","sources":["../../src/events/event_manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,0BAAkB,SAAS;IACvB,aAAa,iBAAiB;IAC9B,WAAW,eAAe;IAC1B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,IAAI,SAAS;CAChB;AAED,MAA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"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
package/events/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventManager } from './event_manager.js';
|
|
2
|
-
export declare class LocalEventManager extends EventManager {
|
|
3
|
-
/**
|
|
4
|
-
* Initializes the EventManager and sets up periodic `systemInfo` and `persistState` events.
|
|
5
|
-
* This is automatically called at the beginning of `crawler.run()`.
|
|
6
|
-
*/
|
|
7
|
-
init(): Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
emitSystemInfoEvent(intervalCallback: () => unknown): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
isContainerizedWrapper(): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a SystemInfo object based on local metrics.
|
|
22
|
-
*/
|
|
23
|
-
private createSystemInfo;
|
|
24
|
-
private createCpuInfo;
|
|
25
|
-
private createMemoryInfo;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=local_event_manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local_event_manager.d.ts","sourceRoot":"","sources":["../../src/events/local_event_manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,iBAAkB,SAAQ,YAAY;IAC/C;;;OAGG;IACY,IAAI;IAYnB;;OAEG;IACY,KAAK;IASpB;;OAEG;IACG,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,OAAO;IAQzD;;OAEG;IACG,sBAAsB;IAI5B;;OAEG;YACW,gBAAgB;YAQhB,aAAa;YAQb,gBAAgB;CAWjC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { getCurrentCpuTicksV2, getMemoryInfo, isContainerized } from '@crawlee/utils';
|
|
2
|
-
import log from '@apify/log';
|
|
3
|
-
import { betterClearInterval, betterSetInterval } from '@apify/utilities';
|
|
4
|
-
import { EventManager } from './event_manager.js';
|
|
5
|
-
export class LocalEventManager extends EventManager {
|
|
6
|
-
/**
|
|
7
|
-
* Initializes the EventManager and sets up periodic `systemInfo` and `persistState` events.
|
|
8
|
-
* This is automatically called at the beginning of `crawler.run()`.
|
|
9
|
-
*/
|
|
10
|
-
async init() {
|
|
11
|
-
if (this.initialized) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
await super.init();
|
|
15
|
-
const systemInfoIntervalMillis = this.config.get('systemInfoIntervalMillis');
|
|
16
|
-
this.emitSystemInfoEvent = this.emitSystemInfoEvent.bind(this);
|
|
17
|
-
this.intervals.systemInfo = betterSetInterval(this.emitSystemInfoEvent.bind(this), systemInfoIntervalMillis);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
async close() {
|
|
23
|
-
if (!this.initialized) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
await super.close();
|
|
27
|
-
betterClearInterval(this.intervals.systemInfo);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
async emitSystemInfoEvent(intervalCallback) {
|
|
33
|
-
const info = await this.createSystemInfo({
|
|
34
|
-
maxUsedCpuRatio: this.config.get('maxUsedCpuRatio'),
|
|
35
|
-
});
|
|
36
|
-
this.events.emit("systemInfo" /* EventType.SYSTEM_INFO */, info);
|
|
37
|
-
intervalCallback();
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
async isContainerizedWrapper() {
|
|
43
|
-
return this.config.get('containerized', await isContainerized());
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates a SystemInfo object based on local metrics.
|
|
47
|
-
*/
|
|
48
|
-
async createSystemInfo(options) {
|
|
49
|
-
return {
|
|
50
|
-
createdAt: new Date(),
|
|
51
|
-
...(await this.createCpuInfo(options)),
|
|
52
|
-
...(await this.createMemoryInfo()),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
async createCpuInfo(options) {
|
|
56
|
-
const usedCpuRatio = await getCurrentCpuTicksV2(await this.isContainerizedWrapper());
|
|
57
|
-
return {
|
|
58
|
-
cpuCurrentUsage: usedCpuRatio * 100,
|
|
59
|
-
isCpuOverloaded: usedCpuRatio > options.maxUsedCpuRatio,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
async createMemoryInfo() {
|
|
63
|
-
try {
|
|
64
|
-
const memInfo = await getMemoryInfo(await this.isContainerizedWrapper());
|
|
65
|
-
return {
|
|
66
|
-
memCurrentBytes: memInfo.mainProcessBytes + memInfo.childProcessesBytes,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
log.exception(err, 'Memory snapshot failed.');
|
|
71
|
-
return {};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=local_event_manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local_event_manager.js","sourceRoot":"","sources":["../../src/events/local_event_manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,iB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AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/log.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
|
package/proxy_configuration.d.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { ProxyInfo } from '@crawlee/types';
|
|
2
|
-
import type { Request } from './request.js';
|
|
3
|
-
export interface ProxyConfigurationFunction {
|
|
4
|
-
(options?: {
|
|
5
|
-
request?: Request;
|
|
6
|
-
}): string | null | Promise<string | null>;
|
|
7
|
-
}
|
|
8
|
-
type UrlList = (string | null)[];
|
|
9
|
-
export interface ProxyConfigurationOptions {
|
|
10
|
-
/**
|
|
11
|
-
* An array of custom proxy URLs to be rotated.
|
|
12
|
-
* Custom proxies are not compatible with Apify Proxy and an attempt to use both
|
|
13
|
-
* configuration options will cause an error to be thrown on initialize.
|
|
14
|
-
*/
|
|
15
|
-
proxyUrls?: UrlList;
|
|
16
|
-
/**
|
|
17
|
-
* Custom function that allows you to generate the new proxy URL dynamically. It gets an optional parameter with the `Request` object when applicable.
|
|
18
|
-
* Can return either stringified proxy URL or `null` if the proxy should not be used. Can be asynchronous.
|
|
19
|
-
*
|
|
20
|
-
* This function is used to generate the URL when {@link ProxyConfiguration.newUrl} or {@link ProxyConfiguration.newProxyInfo} is called.
|
|
21
|
-
*/
|
|
22
|
-
newUrlFunction?: ProxyConfigurationFunction;
|
|
23
|
-
/**
|
|
24
|
-
* An array of custom proxy URLs to be rotated stratified in tiers.
|
|
25
|
-
* This is a more advanced version of `proxyUrls` that allows you to define a hierarchy of proxy URLs
|
|
26
|
-
* If everything goes well, all the requests will be sent through the first proxy URL in the list.
|
|
27
|
-
* Whenever the crawler encounters a problem with the current proxy on the given domain, it will switch to the higher tier for this domain.
|
|
28
|
-
* The crawler probes lower-level proxies at intervals to check if it can make the tier downshift.
|
|
29
|
-
*
|
|
30
|
-
* This feature is useful when you have a set of proxies with different performance characteristics (speed, price, antibot performance etc.) and you want to use the best one for each domain.
|
|
31
|
-
*
|
|
32
|
-
* Use `null` as a proxy URL to disable the proxy for the given tier.
|
|
33
|
-
*/
|
|
34
|
-
tieredProxyUrls?: UrlList[];
|
|
35
|
-
}
|
|
36
|
-
export interface TieredProxy {
|
|
37
|
-
proxyUrl: string | null;
|
|
38
|
-
proxyTier?: number;
|
|
39
|
-
}
|
|
40
|
-
interface TieredProxyOptions {
|
|
41
|
-
request?: Request;
|
|
42
|
-
proxyTier?: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Internal class for tracking the proxy tier history for a specific domain.
|
|
46
|
-
*
|
|
47
|
-
* Predicts the best proxy tier for the next request based on the error history for different proxy tiers.
|
|
48
|
-
*/
|
|
49
|
-
declare class ProxyTierTracker {
|
|
50
|
-
private histogram;
|
|
51
|
-
private currentTier;
|
|
52
|
-
constructor(tieredProxyUrls: (string | null)[][]);
|
|
53
|
-
/**
|
|
54
|
-
* Processes a single step of the algorithm and updates the current tier prediction based on the error history.
|
|
55
|
-
*/
|
|
56
|
-
private processStep;
|
|
57
|
-
/**
|
|
58
|
-
* Increases the error score for the given proxy tier. This raises the chance of picking a different proxy tier for the subsequent requests.
|
|
59
|
-
*
|
|
60
|
-
* The error score is increased by 10 for the given tier. This means that this tier will be disadvantaged for the next 10 requests (every new request prediction decreases the error score by 1).
|
|
61
|
-
* @param tier The proxy tier to mark as problematic.
|
|
62
|
-
*/
|
|
63
|
-
addError(tier: number): void;
|
|
64
|
-
/**
|
|
65
|
-
* Returns the best proxy tier for the next request based on the error history for different proxy tiers.
|
|
66
|
-
* @returns The proxy tier prediction
|
|
67
|
-
*/
|
|
68
|
-
predictTier(): number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking
|
|
72
|
-
* your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
73
|
-
* them to use the selected proxies for all connections. You can get information about the currently used proxy by inspecting
|
|
74
|
-
* the {@link ProxyInfo} property in your crawler's page function. There, you can inspect the proxy's URL and other attributes.
|
|
75
|
-
*
|
|
76
|
-
* If you want to use your own proxies, use the {@link ProxyConfigurationOptions.proxyUrls} option. Your list of proxy URLs will
|
|
77
|
-
* be rotated by the configuration if this option is provided.
|
|
78
|
-
*
|
|
79
|
-
* **Example usage:**
|
|
80
|
-
*
|
|
81
|
-
* ```javascript
|
|
82
|
-
*
|
|
83
|
-
* const proxyConfiguration = new ProxyConfiguration({
|
|
84
|
-
* proxyUrls: ['...', '...'],
|
|
85
|
-
* });
|
|
86
|
-
*
|
|
87
|
-
* const crawler = new CheerioCrawler({
|
|
88
|
-
* // ...
|
|
89
|
-
* proxyConfiguration,
|
|
90
|
-
* requestHandler({ proxyInfo }) {
|
|
91
|
-
* const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
|
|
92
|
-
* }
|
|
93
|
-
* })
|
|
94
|
-
*
|
|
95
|
-
* ```
|
|
96
|
-
* @category Scaling
|
|
97
|
-
*/
|
|
98
|
-
export declare class ProxyConfiguration {
|
|
99
|
-
isManInTheMiddle: boolean;
|
|
100
|
-
protected nextCustomUrlIndex: number;
|
|
101
|
-
protected proxyUrls?: UrlList;
|
|
102
|
-
protected tieredProxyUrls?: UrlList[];
|
|
103
|
-
protected usedProxyUrls: Map<string, string | null>;
|
|
104
|
-
protected newUrlFunction?: ProxyConfigurationFunction;
|
|
105
|
-
// @ts-ignore optional peer dependency or compatibility with es2022
|
|
106
|
-
protected log: import("@apify/log").Log;
|
|
107
|
-
protected domainTiers: Map<string, ProxyTierTracker>;
|
|
108
|
-
/**
|
|
109
|
-
* Creates a {@link ProxyConfiguration} instance based on the provided options. Proxy servers are used to prevent target websites from
|
|
110
|
-
* blocking your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
111
|
-
* them to use the selected proxies for all connections.
|
|
112
|
-
*
|
|
113
|
-
* ```javascript
|
|
114
|
-
* const proxyConfiguration = new ProxyConfiguration({
|
|
115
|
-
* proxyUrls: ['http://user:pass@proxy-1.com', 'http://user:pass@proxy-2.com'],
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* const crawler = new CheerioCrawler({
|
|
119
|
-
* // ...
|
|
120
|
-
* proxyConfiguration,
|
|
121
|
-
* requestHandler({ proxyInfo }) {
|
|
122
|
-
* const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
|
|
123
|
-
* }
|
|
124
|
-
* })
|
|
125
|
-
*
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
constructor(options?: ProxyConfigurationOptions);
|
|
129
|
-
/**
|
|
130
|
-
* This function creates a new {@link ProxyInfo} info object.
|
|
131
|
-
* It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
|
|
132
|
-
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
133
|
-
* Use it if you want to work with a rich representation of a proxy URL.
|
|
134
|
-
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
135
|
-
*
|
|
136
|
-
* @return Represents information about used proxy and its configuration.
|
|
137
|
-
*/
|
|
138
|
-
newProxyInfo(options?: TieredProxyOptions): Promise<ProxyInfo | undefined>;
|
|
139
|
-
/**
|
|
140
|
-
* Given a request / proxy tier, this function returns a new proxy URL based on the provided configuration options.
|
|
141
|
-
* @param options Options for the tiered proxy rotation
|
|
142
|
-
* @returns An object with the proxy URL and the proxy tier used.
|
|
143
|
-
*/
|
|
144
|
-
protected _handleTieredUrl(options?: TieredProxyOptions): TieredProxy;
|
|
145
|
-
/**
|
|
146
|
-
* Given a `Request` object, this function returns the tier of the proxy that should be used for the request.
|
|
147
|
-
*
|
|
148
|
-
* This returns `null` if `tieredProxyUrls` option is not set.
|
|
149
|
-
*/
|
|
150
|
-
protected predictProxyTier(request: Request): number | null;
|
|
151
|
-
/**
|
|
152
|
-
* Returns a new proxy URL based on provided configuration options.
|
|
153
|
-
*
|
|
154
|
-
* @return A string with a proxy URL, including authentication credentials and port number.
|
|
155
|
-
* For example, `http://bob:password123@proxy.example.com:8000`
|
|
156
|
-
*/
|
|
157
|
-
newUrl(options?: TieredProxyOptions): Promise<string | undefined>;
|
|
158
|
-
protected _handleProxyUrlsList(): string | null;
|
|
159
|
-
/**
|
|
160
|
-
* Calls the custom newUrlFunction and checks format of its return value
|
|
161
|
-
*/
|
|
162
|
-
protected _callNewUrlFunction(options?: {
|
|
163
|
-
request?: Request;
|
|
164
|
-
}): Promise<string | null>;
|
|
165
|
-
protected _throwCannotCombineCustomMethods(): never;
|
|
166
|
-
protected _throwNoOptionsProvided(): never;
|
|
167
|
-
}
|
|
168
|
-
export {};
|
|
169
|
-
//# sourceMappingURL=proxy_configuration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy_configuration.d.ts","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,0BAA0B;IACvC,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7E;AAED,KAAK,OAAO,GAAG,CAAC,MAAM,GAA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CAAC,SAAS,GAAG,SAAS,CAAC;IAyBhF;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW;IAwBrE;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAiC3D;;;;;OAKG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAYvE,SAAS,CAAC,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI/C;;OAEG;cACa,mBAAmB,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;IAcnE,SAAS,CAAC,gCAAgC,IAAI,KAAK;IAMnD,SAAS,CAAC,uBAAuB,IAAI,KAAK;CAG7C"}
|
package/proxy_configuration.js
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import ow from 'ow';
|
|
2
|
-
import log from '@apify/log';
|
|
3
|
-
/**
|
|
4
|
-
* Internal class for tracking the proxy tier history for a specific domain.
|
|
5
|
-
*
|
|
6
|
-
* Predicts the best proxy tier for the next request based on the error history for different proxy tiers.
|
|
7
|
-
*/
|
|
8
|
-
class ProxyTierTracker {
|
|
9
|
-
histogram;
|
|
10
|
-
currentTier;
|
|
11
|
-
constructor(tieredProxyUrls) {
|
|
12
|
-
this.histogram = tieredProxyUrls.map(() => 0);
|
|
13
|
-
this.currentTier = 0;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Processes a single step of the algorithm and updates the current tier prediction based on the error history.
|
|
17
|
-
*/
|
|
18
|
-
processStep() {
|
|
19
|
-
this.histogram.forEach((x, i) => {
|
|
20
|
-
if (this.currentTier === i)
|
|
21
|
-
return;
|
|
22
|
-
if (x > 0)
|
|
23
|
-
this.histogram[i]--;
|
|
24
|
-
});
|
|
25
|
-
const left = this.currentTier > 0 ? this.histogram[this.currentTier - 1] : Infinity;
|
|
26
|
-
const right = this.currentTier < this.histogram.length - 1 ? this.histogram[this.currentTier + 1] : Infinity;
|
|
27
|
-
if (this.histogram[this.currentTier] > Math.min(left, right)) {
|
|
28
|
-
this.currentTier = left <= right ? this.currentTier - 1 : this.currentTier + 1;
|
|
29
|
-
}
|
|
30
|
-
else if (this.histogram[this.currentTier] === left) {
|
|
31
|
-
this.currentTier--;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Increases the error score for the given proxy tier. This raises the chance of picking a different proxy tier for the subsequent requests.
|
|
36
|
-
*
|
|
37
|
-
* The error score is increased by 10 for the given tier. This means that this tier will be disadvantaged for the next 10 requests (every new request prediction decreases the error score by 1).
|
|
38
|
-
* @param tier The proxy tier to mark as problematic.
|
|
39
|
-
*/
|
|
40
|
-
addError(tier) {
|
|
41
|
-
this.histogram[tier] += 10;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Returns the best proxy tier for the next request based on the error history for different proxy tiers.
|
|
45
|
-
* @returns The proxy tier prediction
|
|
46
|
-
*/
|
|
47
|
-
predictTier() {
|
|
48
|
-
this.processStep();
|
|
49
|
-
return this.currentTier;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking
|
|
54
|
-
* your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
55
|
-
* them to use the selected proxies for all connections. You can get information about the currently used proxy by inspecting
|
|
56
|
-
* the {@link ProxyInfo} property in your crawler's page function. There, you can inspect the proxy's URL and other attributes.
|
|
57
|
-
*
|
|
58
|
-
* If you want to use your own proxies, use the {@link ProxyConfigurationOptions.proxyUrls} option. Your list of proxy URLs will
|
|
59
|
-
* be rotated by the configuration if this option is provided.
|
|
60
|
-
*
|
|
61
|
-
* **Example usage:**
|
|
62
|
-
*
|
|
63
|
-
* ```javascript
|
|
64
|
-
*
|
|
65
|
-
* const proxyConfiguration = new ProxyConfiguration({
|
|
66
|
-
* proxyUrls: ['...', '...'],
|
|
67
|
-
* });
|
|
68
|
-
*
|
|
69
|
-
* const crawler = new CheerioCrawler({
|
|
70
|
-
* // ...
|
|
71
|
-
* proxyConfiguration,
|
|
72
|
-
* requestHandler({ proxyInfo }) {
|
|
73
|
-
* const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
|
|
74
|
-
* }
|
|
75
|
-
* })
|
|
76
|
-
*
|
|
77
|
-
* ```
|
|
78
|
-
* @category Scaling
|
|
79
|
-
*/
|
|
80
|
-
export class ProxyConfiguration {
|
|
81
|
-
isManInTheMiddle = false;
|
|
82
|
-
nextCustomUrlIndex = 0;
|
|
83
|
-
proxyUrls;
|
|
84
|
-
tieredProxyUrls;
|
|
85
|
-
usedProxyUrls = new Map();
|
|
86
|
-
newUrlFunction;
|
|
87
|
-
log = log.child({ prefix: 'ProxyConfiguration' });
|
|
88
|
-
domainTiers = new Map();
|
|
89
|
-
/**
|
|
90
|
-
* Creates a {@link ProxyConfiguration} instance based on the provided options. Proxy servers are used to prevent target websites from
|
|
91
|
-
* blocking your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
92
|
-
* them to use the selected proxies for all connections.
|
|
93
|
-
*
|
|
94
|
-
* ```javascript
|
|
95
|
-
* const proxyConfiguration = new ProxyConfiguration({
|
|
96
|
-
* proxyUrls: ['http://user:pass@proxy-1.com', 'http://user:pass@proxy-2.com'],
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* const crawler = new CheerioCrawler({
|
|
100
|
-
* // ...
|
|
101
|
-
* proxyConfiguration,
|
|
102
|
-
* requestHandler({ proxyInfo }) {
|
|
103
|
-
* const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
|
|
104
|
-
* }
|
|
105
|
-
* })
|
|
106
|
-
*
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
constructor(options = {}) {
|
|
110
|
-
const { validateRequired, ...rest } = options;
|
|
111
|
-
ow(rest, ow.object.exactShape({
|
|
112
|
-
proxyUrls: ow.optional.array.nonEmpty.ofType(ow.any(ow.string.url, ow.null)),
|
|
113
|
-
newUrlFunction: ow.optional.function,
|
|
114
|
-
tieredProxyUrls: ow.optional.array.nonEmpty.ofType(ow.array.nonEmpty.ofType(ow.any(ow.string.url, ow.null))),
|
|
115
|
-
}));
|
|
116
|
-
const { proxyUrls, newUrlFunction, tieredProxyUrls } = options;
|
|
117
|
-
if ([proxyUrls, newUrlFunction, tieredProxyUrls].filter((x) => x).length > 1)
|
|
118
|
-
this._throwCannotCombineCustomMethods();
|
|
119
|
-
if (!proxyUrls && !newUrlFunction && validateRequired)
|
|
120
|
-
this._throwNoOptionsProvided();
|
|
121
|
-
this.proxyUrls = proxyUrls;
|
|
122
|
-
this.newUrlFunction = newUrlFunction;
|
|
123
|
-
this.tieredProxyUrls = tieredProxyUrls;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* This function creates a new {@link ProxyInfo} info object.
|
|
127
|
-
* It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
|
|
128
|
-
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
129
|
-
* Use it if you want to work with a rich representation of a proxy URL.
|
|
130
|
-
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
131
|
-
*
|
|
132
|
-
* @return Represents information about used proxy and its configuration.
|
|
133
|
-
*/
|
|
134
|
-
async newProxyInfo(options) {
|
|
135
|
-
let url;
|
|
136
|
-
let tier;
|
|
137
|
-
if (this.tieredProxyUrls) {
|
|
138
|
-
const { proxyUrl, proxyTier } = this._handleTieredUrl(options);
|
|
139
|
-
url = proxyUrl ?? undefined;
|
|
140
|
-
tier = proxyTier;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
url = await this.newUrl(options);
|
|
144
|
-
}
|
|
145
|
-
if (!url)
|
|
146
|
-
return undefined;
|
|
147
|
-
const { username, password, port, hostname } = new URL(url);
|
|
148
|
-
return {
|
|
149
|
-
url,
|
|
150
|
-
username: decodeURIComponent(username),
|
|
151
|
-
password: decodeURIComponent(password),
|
|
152
|
-
hostname,
|
|
153
|
-
port: port,
|
|
154
|
-
proxyTier: tier,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Given a request / proxy tier, this function returns a new proxy URL based on the provided configuration options.
|
|
159
|
-
* @param options Options for the tiered proxy rotation
|
|
160
|
-
* @returns An object with the proxy URL and the proxy tier used.
|
|
161
|
-
*/
|
|
162
|
-
_handleTieredUrl(options) {
|
|
163
|
-
if (!this.tieredProxyUrls)
|
|
164
|
-
throw new Error('Tiered proxy URLs are not set');
|
|
165
|
-
if (!options || (!options?.request && options?.proxyTier === undefined)) {
|
|
166
|
-
const allProxyUrls = this.tieredProxyUrls.flat();
|
|
167
|
-
return {
|
|
168
|
-
proxyUrl: allProxyUrls[this.nextCustomUrlIndex++ % allProxyUrls.length],
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
let tierPrediction = options.proxyTier;
|
|
172
|
-
if (typeof tierPrediction !== 'number') {
|
|
173
|
-
tierPrediction = this.predictProxyTier(options.request);
|
|
174
|
-
}
|
|
175
|
-
const proxyTier = this.tieredProxyUrls[tierPrediction];
|
|
176
|
-
return {
|
|
177
|
-
proxyUrl: proxyTier[this.nextCustomUrlIndex++ % proxyTier.length],
|
|
178
|
-
proxyTier: tierPrediction,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Given a `Request` object, this function returns the tier of the proxy that should be used for the request.
|
|
183
|
-
*
|
|
184
|
-
* This returns `null` if `tieredProxyUrls` option is not set.
|
|
185
|
-
*/
|
|
186
|
-
predictProxyTier(request) {
|
|
187
|
-
if (!this.tieredProxyUrls)
|
|
188
|
-
return null;
|
|
189
|
-
const domain = new URL(request.url).hostname;
|
|
190
|
-
if (!this.domainTiers.has(domain)) {
|
|
191
|
-
this.domainTiers.set(domain, new ProxyTierTracker(this.tieredProxyUrls));
|
|
192
|
-
}
|
|
193
|
-
request.userData.__crawlee ??= {};
|
|
194
|
-
const tracker = this.domainTiers.get(domain);
|
|
195
|
-
if (typeof request.userData.__crawlee.lastProxyTier === 'number') {
|
|
196
|
-
tracker.addError(request.userData.__crawlee.lastProxyTier);
|
|
197
|
-
}
|
|
198
|
-
const tierPrediction = tracker.predictTier();
|
|
199
|
-
if (typeof request.userData.__crawlee.lastProxyTier === 'number' &&
|
|
200
|
-
request.userData.__crawlee.lastProxyTier !== tierPrediction) {
|
|
201
|
-
log.debug(`Changing proxy tier for domain "${domain}" from ${request.userData.__crawlee.lastProxyTier} to ${tierPrediction}.`);
|
|
202
|
-
}
|
|
203
|
-
request.userData.__crawlee.lastProxyTier = tierPrediction;
|
|
204
|
-
request.userData.__crawlee.forefront = true;
|
|
205
|
-
return tierPrediction;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Returns a new proxy URL based on provided configuration options.
|
|
209
|
-
*
|
|
210
|
-
* @return A string with a proxy URL, including authentication credentials and port number.
|
|
211
|
-
* For example, `http://bob:password123@proxy.example.com:8000`
|
|
212
|
-
*/
|
|
213
|
-
async newUrl(options) {
|
|
214
|
-
if (this.newUrlFunction) {
|
|
215
|
-
return (await this._callNewUrlFunction({ request: options?.request })) ?? undefined;
|
|
216
|
-
}
|
|
217
|
-
if (this.tieredProxyUrls) {
|
|
218
|
-
return this._handleTieredUrl(options).proxyUrl ?? undefined;
|
|
219
|
-
}
|
|
220
|
-
return this._handleProxyUrlsList() ?? undefined;
|
|
221
|
-
}
|
|
222
|
-
_handleProxyUrlsList() {
|
|
223
|
-
return this.proxyUrls[this.nextCustomUrlIndex++ % this.proxyUrls.length];
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Calls the custom newUrlFunction and checks format of its return value
|
|
227
|
-
*/
|
|
228
|
-
async _callNewUrlFunction(options) {
|
|
229
|
-
const proxyUrl = await this.newUrlFunction(options);
|
|
230
|
-
try {
|
|
231
|
-
if (proxyUrl) {
|
|
232
|
-
new URL(proxyUrl); // eslint-disable-line no-new
|
|
233
|
-
}
|
|
234
|
-
return proxyUrl;
|
|
235
|
-
}
|
|
236
|
-
catch (err) {
|
|
237
|
-
throw new Error(`The provided newUrlFunction did not return a valid URL.\nCause: ${err.message}`);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
_throwCannotCombineCustomMethods() {
|
|
241
|
-
throw new Error('Cannot combine custom proxies "options.proxyUrls" with custom generating function "options.newUrlFunction".');
|
|
242
|
-
}
|
|
243
|
-
_throwNoOptionsProvided() {
|
|
244
|
-
throw new Error('One of "options.proxyUrls" or "options.newUrlFunction" needs to be provided.');
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=proxy_configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy_configuration.js","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,GAAG,MAAM,YAAY,CAAC;AAkD7B;;;;GAIG;AACH,MAAM,gBAAgB;IACV,SAAS,CAAW;IACpB,WAAW,CAAS;IAE5B,YAAY,eAAoC;QAC5C,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,WAAW;QACf,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;gBAAE,OAAO;YACnC,IAAI,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,CAAC,CAAC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