mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 05:06:33 +01:00
fix awn_de by disabling ssl check (#1333)
Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
from html.parser import HTMLParser
|
||||
|
||||
import requests
|
||||
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
from waste_collection_schedule.service.ICS import ICS
|
||||
|
||||
# With verify=True the POST fails due to a SSLCertVerificationError.
|
||||
# Using verify=False works, but is not ideal. The following links may provide a better way of dealing with this:
|
||||
# https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
|
||||
# https://urllib3.readthedocs.io/en/1.26.x/user-guide.html#ssl
|
||||
# These two lines areused to suppress the InsecureRequestWarning when using verify=False
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
|
||||
TITLE = "Abfallwirtschaft Neckar-Odenwald-Kreis"
|
||||
DESCRIPTION = "Source for AWN (Abfallwirtschaft Neckar-Odenwald-Kreis)."
|
||||
URL = "https://www.awn-online.de"
|
||||
@@ -64,6 +72,7 @@ class Source:
|
||||
r = session.get(
|
||||
SERVLET,
|
||||
params={"SubmitAction": "wasteDisposalServices", "InFrameMode": "TRUE"},
|
||||
verify=False,
|
||||
)
|
||||
r.raise_for_status()
|
||||
r.encoding = "utf-8"
|
||||
|
||||
Reference in New Issue
Block a user