Skip to content

Commit

Permalink
Bugfix/get image (#93)
Browse files Browse the repository at this point in the history
* use https

* ignore warning
  • Loading branch information
MateoLostanlen authored Jul 24, 2022
1 parent 245cd1d commit 570e2e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions runner/src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import time
import json
import logging
import urllib3


urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

logging.basicConfig(
format="%(asctime)s | %(levelname)s: %(message)s", level=logging.INFO, force=True
Expand Down Expand Up @@ -51,8 +55,7 @@ def setup_engine():


def capture(ip, CAM_USER, CAM_PWD):
url = f"http://{ip}/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C\
&user={CAM_USER}&password={CAM_PWD}"
url = f"https://{ip}/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user={CAM_USER}&password={CAM_PWD}"

response = requests.get(url, verify=False, timeout=3)
return Image.open(BytesIO(response.content))
Expand Down

0 comments on commit 570e2e2

Please sign in to comment.