diff --git a/scrapy_webarchive/downloadermiddlewares.py b/scrapy_webarchive/downloadermiddlewares.py index 960d1bd..32f134b 100644 --- a/scrapy_webarchive/downloadermiddlewares.py +++ b/scrapy_webarchive/downloadermiddlewares.py @@ -1,5 +1,4 @@ import re -from typing import Union from scrapy import signals from scrapy.crawler import Crawler @@ -10,7 +9,7 @@ from scrapy.spiders import Spider from scrapy.statscollectors import StatsCollector from smart_open import open -from typing_extensions import Self +from typing_extensions import Self, Union from scrapy_webarchive.wacz import MultiWaczFile, WaczFile from scrapy_webarchive.warc import record_transformer diff --git a/scrapy_webarchive/middleware.py b/scrapy_webarchive/middleware.py index 67e8b86..2b53155 100644 --- a/scrapy_webarchive/middleware.py +++ b/scrapy_webarchive/middleware.py @@ -1,5 +1,4 @@ import re -from typing import Iterable, Self, Union from urllib.parse import urlparse from scrapy import Request, Spider, signals @@ -8,6 +7,7 @@ from scrapy.settings import Settings from scrapy.statscollectors import StatsCollector from smart_open import open +from typing_extensions import Iterable, Self, Union from scrapy_webarchive.wacz import MultiWaczFile, WaczFile from scrapy_webarchive.warc import record_transformer diff --git a/scrapy_webarchive/warc.py b/scrapy_webarchive/warc.py index fee7594..2d4e849 100644 --- a/scrapy_webarchive/warc.py +++ b/scrapy_webarchive/warc.py @@ -2,13 +2,13 @@ import uuid from datetime import datetime, timezone from io import BytesIO -from typing import List, Tuple from urllib.parse import urlparse from scrapy import __version__ as scrapy_version from scrapy.http.request import Request from scrapy.http.response import Response from scrapy.responsetypes import ResponseTypes +from typing_extensions import List, Tuple from warc.warc import WARCRecord from warcio.recordloader import ArcWarcRecord from warcio.statusandheaders import StatusAndHeaders