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()