File size: 602 Bytes
1d99bd3 ca5b6e4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from typing import Optional
from aiohttp import ClientSession
from dataclasses import dataclass, field
from concurrent.futures import ThreadPoolExecutor
@dataclass
class ScrapeState:
thread_pool: ClientSession
session: ThreadPoolExecutor
existing_image_ids: set[str] = field(default_factory=set)
scraped_image_count: int = 0
last_reached_image_id: Optional[int] = None
last_reached_image_score: Optional[int] = None
avg_query_time: list[float, int] = field(default_factory=lambda: [0.0, 0])
avg_download_time: list[float, int] = field(default_factory=lambda: [0.0, 0])
|