Skip to content

Commit

Permalink
chg: Cleanups, deps updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Dec 10, 2024
1 parent 26e5f23 commit 16c4372
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 146 deletions.
9 changes: 3 additions & 6 deletions playwrightcapture/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
from logging import LoggerAdapter, Logger
from tempfile import NamedTemporaryFile
from typing import Any, TypedDict, Literal, TYPE_CHECKING
from collections.abc import MutableMapping, Generator
from collections.abc import MutableMapping, Iterator
from urllib.parse import urlparse, unquote, urljoin, urlsplit, urlunsplit
from zipfile import ZipFile

import aiohttp
import dateparser
import urllib3

from aiohttp_socks import ProxyConnector # type: ignore[import-untyped]
from bs4 import BeautifulSoup
Expand Down Expand Up @@ -61,9 +60,6 @@
except ImportError:
CAN_SOLVE_CAPTCHA = False

# Do not show TLS warnings from urllib3 when fetching a favicon
urllib3.disable_warnings()


class CaptureResponse(TypedDict, total=False):

Expand Down Expand Up @@ -102,7 +98,7 @@ def process(self, msg: str, kwargs: MutableMapping[str, Any]) -> tuple[str, Muta
class PCStealthConfig(StealthConfig): # type: ignore[misc]

@property
def enabled_scripts(self) -> Generator[str]:
def enabled_scripts(self) -> Iterator[str]:
self.chrome_app = True
self.chrome_csi = True
self.chrome_runtime = True
Expand Down Expand Up @@ -698,6 +694,7 @@ async def __frame_consent(self, frame: Frame) -> bool:
"Accept all",
"Accept",
"Agree and close",
"I agree",
# Dutch
"Accepteer",
# Spanish
Expand Down
Loading

0 comments on commit 16c4372

Please sign in to comment.