Fix test and add safety check

This commit is contained in:
Nicolas Mowen 2024-03-02 12:05:25 -07:00
parent b895676c0f
commit 9b8e2e20be
2 changed files with 4 additions and 1 deletions

View File

@ -10,8 +10,8 @@ from playhouse.shortcuts import model_to_dict
from playhouse.sqlite_ext import SqliteExtDatabase
from playhouse.sqliteq import SqliteQueueDatabase
from frigate.api.app import create_app
from frigate.config import FrigateConfig
from frigate.http import create_app
from frigate.models import Event, Recordings
from frigate.plus import PlusApi
from frigate.stats.emitter import StatsEmitter

View File

@ -122,6 +122,9 @@ def clean_camera_user_pass(line: str) -> str:
def escape_special_characters(path: str) -> str:
"""Cleans reserved characters to encodings for ffmpeg."""
if len(path) > 1000:
return ValueError("Input too long to check")
try:
found = re.search(REGEX_RTSP_CAMERA_USER_PASS, path).group(0)[3:-1]
pw = found[(found.index(":") + 1) :]