diff --git a/frigate/restream.py b/frigate/restream.py index 958debeb6..b06ae95e2 100644 --- a/frigate/restream.py +++ b/frigate/restream.py @@ -38,7 +38,9 @@ class RestreamApi: self.relays[cam_name] = escape_special_characters(input.path) else: # go2rtc only supports rtsp for direct relay, otherwise ffmpeg is used - self.relays[cam_name] = get_manual_go2rtc_stream(escape_special_characters(input.path)) + self.relays[cam_name] = get_manual_go2rtc_stream( + escape_special_characters(input.path) + ) for name, path in self.relays.items(): params = {"src": path, "name": name} diff --git a/frigate/test/test_camera_pw.py b/frigate/test/test_camera_pw.py index 46f180980..dd72fcc7d 100644 --- a/frigate/test/test_camera_pw.py +++ b/frigate/test/test_camera_pw.py @@ -8,7 +8,9 @@ from frigate.util import clean_camera_user_pass, escape_special_characters class TestUserPassCleanup(unittest.TestCase): def setUp(self) -> None: self.rtsp_with_pass = "rtsp://user:password@192.168.0.2:554/live" - self.rtsp_with_special_pass = "rtsp://user:password`~!@#$%^&*()-_;',.<>:\"\{\}\[\]@@192.168.0.2:554/live" + self.rtsp_with_special_pass = ( + "rtsp://user:password`~!@#$%^&*()-_;',.<>:\"\{\}\[\]@@192.168.0.2:554/live" + ) self.rtsp_no_pass = "rtsp://192.168.0.3:554/live" def test_cleanup(self): @@ -25,7 +27,10 @@ class TestUserPassCleanup(unittest.TestCase): def test_special_char_password(self): """Test that special characters in pw are escaped, but not others.""" escaped = escape_special_characters(self.rtsp_with_special_pass) - assert escaped == "rtsp://user:password%60~%21%40%23%24%25%5E%26%2A%28%29-_%3B%27%2C.%3C%3E%3A%22%5C%7B%5C%7D%5C%5B%5C%5D%40@192.168.0.2:554/live" + assert ( + escaped + == "rtsp://user:password%60~%21%40%23%24%25%5E%26%2A%28%29-_%3B%27%2C.%3C%3E%3A%22%5C%7B%5C%7D%5C%5B%5C%5D%40@192.168.0.2:554/live" + ) def test_no_special_char_password(self): """Test that no change is made to path with no special characters."""