From f4aae2b2e5ebcc53a1b646a3b8559e0ef2ded6ef Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Sat, 17 Dec 2022 22:34:10 -0600 Subject: [PATCH] Final commit for today Changed some stuff with Compose --- docker-compose.yml | 4 ++-- main.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 35a4809..e8f7783 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,8 +46,8 @@ services: - RUN_BY_COMPOSE=true depends_on: - bridge - # Use wait-for-it to wait for the bridge at port 8554 to be ready and then run /app/main.py - command: /bin/bash -c "wait-for-it.sh -h bridge -p 1935 --timeout=0 --strict -- echo "done" && python /app/main.py" + # Use wait-for-it to wait for the bridge at port 8888 (hls) to be ready and then run /app/main.py + # command: /bin/bash -c "wait-for-it.sh -h bridge -p 8888 --timeout=0 --strict -- echo "done" && python /app/main.py" # How can this be run and a .env file passed? diff --git a/main.py b/main.py index 708ceb8..27b2656 100644 --- a/main.py +++ b/main.py @@ -90,7 +90,8 @@ for i in range(5): # If it is not, print an error and exit try: # Replace rtsp with http and the port with 8888 - r = requests.get(URL.replace("rtsp", "http").replace(":8554", ":8888")) + url = URL.replace("rtsp", "http").replace(":8554", ":8888") + r = requests.get(url) if r.status_code != 200: print("HLS stream not available, please check your URL") exit()