Skip to content

Commit

Permalink
fix: SSL: CERTIFICATE_VERIFY_FAILED when running compiled version
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Aug 5, 2024
1 parent a74c618 commit 0491636
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
12 changes: 11 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies = [
"psutil",
"pywin32; sys_platform == 'win32'",
"wcmatch",
"certifi>=2024.7.4",
]

[project.urls]
Expand Down
8 changes: 6 additions & 2 deletions src/kleinanzeigen_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from logging.handlers import RotatingFileHandler
from typing import Any, Final

import colorama, nodriver
import certifi, colorama, nodriver
from overrides import overrides
from ruamel.yaml import YAML
from wcmatch import glob
Expand All @@ -34,6 +34,10 @@ class KleinanzeigenBot(WebScrapingMixin):

def __init__(self) -> None:

# workaround for https://github.com/Second-Hand-Friends/kleinanzeigen-bot/issues/295
# see https://github.com/pyinstaller/pyinstaller/issues/7229#issuecomment-1309383026
os.environ["SSL_CERT_FILE"] = certifi.where()

super().__init__()

self.root_url = "https://www.kleinanzeigen.de"
Expand Down Expand Up @@ -615,7 +619,7 @@ async def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dic
# wait for captcha
#############################
try:
await self.web_find(By.CSS_SELECTOR,"iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']", timeout=2)
await self.web_find(By.CSS_SELECTOR, "iframe[name^='a-'][src^='https://www.google.com/recaptcha/api2/anchor?']", timeout = 2)
LOG.warning("############################################")
LOG.warning("# Captcha present! Please solve the captcha.")
LOG.warning("############################################")
Expand Down

0 comments on commit 0491636

Please sign in to comment.