diff --git a/GoProStream.py b/GoProStream.py index d04038a..17ccad0 100644 --- a/GoProStream.py +++ b/GoProStream.py @@ -9,7 +9,7 @@ ## 3. Run this script. ## ## Supported cameras: -## GoPro HERO5 (incl. Session), HERO4 (incl. Session), HERO+, HERO3+, HERO3, HERO2 w/ WiFi BacPac. +## GoPro HERO5 (incl. Session), HERO4 (incl. Session), HERO+, HERO3+, HERO3, HERO2 w/ WiFi BacPac, HERO 2018. ## ## That's all! When done, press CTRL+C to quit this application. ## @@ -63,9 +63,11 @@ def gopro_live(): response_raw = urlopen('http://10.5.5.9/gp/gpControl').read().decode('utf-8') jsondata=json.loads(response_raw) response=jsondata["info"]["firmware_version"] + model=response.split('.')[0] except http.client.BadStatusLine: response = urlopen('http://10.5.5.9/camera/cv').read().decode('utf-8') - if "HD4" in response or "HD3.2" in response or "HD5" in response or "HX" in response or "HD6" in response: + + if model=="HD4" or model=="HD3" or model=="HD5" or model=="H18" or model=="HX" or model=="HD6": print("branch HD4") print(jsondata["info"]["model_name"]+"\n"+jsondata["info"]["firmware_version"]) ## @@ -80,7 +82,7 @@ def gopro_live(): print("Recording on camera: " + str(RECORD)) ## GoPro HERO4 Session needs status 31 to be greater or equal than 1 in order to start the live feed. - if "HX" in response: + if model=="HX" or model=="H18": connectedStatus=False while connectedStatus == False: req=urlopen("http://10.5.5.9/gp/gpControl/status") @@ -116,7 +118,7 @@ def gopro_live(): sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) sleep(KEEP_ALIVE_PERIOD/1000) else: - print("branch hero3"+response) + print("branch hero3 "+response) if "Hero3" in response or "HERO3+" in response: print("branch hero3") PASSWORD=urlopen("http://10.5.5.9/bacpac/sd").read()