# Path: src/amcrest/http.py
# _LOGGER = logging.getLogger(__name__)
# _KEEPALIVE_OPTS = HTTPConnection.default_socket_options + [
#     (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
# ]
# class SOHTTPAdapter(HTTPAdapter):
# class Http:
#     def __init__(self, *args, **kwargs) -> None:
#     def init_poolmanager(self, *args, **kwargs) -> None:
#     def __init__(
#         self,
#         host: str,
#         port: int,
#         user: str,
#         password: str,
#         *,
#         verbose: bool = True,
#         protocol: str = "http",
#         ssl_verify: bool = True,
#         retries_connection: Optional[int] = None,
#         timeout_protocol: TimeoutT = None,
#     ) -> None:
#     def _generate_token(self) -> None:
#     async def _async_generate_token(self) -> None:
#     def __repr__(self) -> str:
#     def as_dict(self) -> dict:
#     def __base_url(self, param: str = "") -> str:
#     def get_base_url(self) -> str:
#     def command(self, *args, **kwargs) -> requests.Response:
#     async def async_command(self, *args, **kwargs) -> httpx.Response:
#     async def async_stream_command(
#         self, *args, **kwargs
#     ) -> AsyncIterator[httpx.Response]:
#     def _command(
#         self,
#         cmd: str,
#         retries: Optional[int] = None,
#         timeout_cmd: TimeoutT = None,
#         stream: bool = False,
#     ) -> requests.Response:
#     async def _async_command(
#         self,
#         cmd: str,
#         retries: Optional[int] = None,
#         timeout_cmd: TimeoutT = None,
#     ) -> httpx.Response:
#     async def _async_stream_command(
#         self,
#         cmd: str,
#         timeout_cmd: TimeoutT = None,
#     ) -> AsyncIterator[httpx.Response]:
#     def command_audio(
#         self,
#         cmd: str,
#         file_content,
#         http_header,
#         timeout: TimeoutT = None,
#     ) -> None:
#     def _get_config(self, config_name: str) -> str:
#     async def _async_get_config(self, config_name: str) -> str:
#     def _magic_box(self, action: str) -> str:
#     async def _async_magic_box(self, action: str) -> str:
# 
# Path: src/amcrest/utils.py
# def date_to_str(value: datetime) -> str:
#     return value.strftime(DATEFMT)


import logging
from datetime import datetime
from typing import Iterator, Optional, Sequence
from .http import Http, TimeoutT
from .utils import date_to_str
                "Marker", "Event", "Mosaic", "Cutout"}. If omitted, find files
                with all the flags.

        event : by which event the record file is triggered. It is an array.
                The index starts from 0. The range of event is {"AlarmLocal",
                "VideoMotion", "VideoLoss", "VideoBlind", "Traffic*"}. This
                condition can be omitted. If omitted, find files of all the
                events. stream : which video stream type you want to find.
                The range of stream is {"Main", "Extra1", "Extra2", "Extra3"}.
                If omitted, find files with all the stream types.
        """

        c_dirs = "".join(
            f"&condition.Dirs[{k}]={v}" for k, v in enumerate(directories)
        )

        c_types = "".join(
            f"&condition.Types[{k}]={v}" for k, v in enumerate(types)
        )

        c_flag = "".join(
            f"&condition.Flag[{k}]={v}" for k, v in enumerate(flags)
        )

        c_events = "".join(
            f"&condition.Events[{k}]={v}" for k, v in enumerate(events)
        )

        c_vs = f"&condition.VideoStream={stream}" if stream else ""


# Path: src/amcrest/http.py
# _LOGGER = logging.getLogger(__name__)
# _KEEPALIVE_OPTS = HTTPConnection.default_socket_options + [
#     (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
# ]
# class SOHTTPAdapter(HTTPAdapter):
# class Http:
#     def __init__(self, *args, **kwargs) -> None:
#     def init_poolmanager(self, *args, **kwargs) -> None:
#     def __init__(
#         self,
#         host: str,
#         port: int,
#         user: str,
#         password: str,
#         *,
#         verbose: bool = True,
#         protocol: str = "http",
#         ssl_verify: bool = True,
#         retries_connection: Optional[int] = None,
#         timeout_protocol: TimeoutT = None,
#     ) -> None:
#     def _generate_token(self) -> None:
#     async def _async_generate_token(self) -> None:
#     def __repr__(self) -> str:
#     def as_dict(self) -> dict:
#     def __base_url(self, param: str = "") -> str:
#     def get_base_url(self) -> str:
#     def command(self, *args, **kwargs) -> requests.Response:
#     async def async_command(self, *args, **kwargs) -> httpx.Response:
#     async def async_stream_command(
#         self, *args, **kwargs
#     ) -> AsyncIterator[httpx.Response]:
#     def _command(
#         self,
#         cmd: str,
#         retries: Optional[int] = None,
#         timeout_cmd: TimeoutT = None,
#         stream: bool = False,
#     ) -> requests.Response:
#     async def _async_command(
#         self,
#         cmd: str,
#         retries: Optional[int] = None,
#         timeout_cmd: TimeoutT = None,
#     ) -> httpx.Response:
#     async def _async_stream_command(
#         self,
#         cmd: str,
#         timeout_cmd: TimeoutT = None,
#     ) -> AsyncIterator[httpx.Response]:
#     def command_audio(
#         self,
#         cmd: str,
#         file_content,
#         http_header,
#         timeout: TimeoutT = None,
#     ) -> None:
#     def _get_config(self, config_name: str) -> str:
#     async def _async_get_config(self, config_name: str) -> str:
#     def _magic_box(self, action: str) -> str:
#     async def _async_magic_box(self, action: str) -> str:
# 
# Path: src/amcrest/utils.py
# def date_to_str(value: datetime) -> str:
#     return value.strftime(DATEFMT)


# Path: src/amcrest/media.py
import logging
from datetime import datetime
from typing import Iterator, Optional, Sequence
from .http import Http, TimeoutT
from .utils import date_to_str

                "Marker", "Event", "Mosaic", "Cutout"}. If omitted, find files
                with all the flags.

        event : by which event the record file is triggered. It is an array.
                The index starts from 0. The range of event is {"AlarmLocal",
                "VideoMotion", "VideoLoss", "VideoBlind", "Traffic*"}. This
                condition can be omitted. If omitted, find files of all the
                events. stream : which video stream type you want to find.
                The range of stream is {"Main", "Extra1", "Extra2", "Extra3"}.
                If omitted, find files with all the stream types.
        """

        c_dirs = "".join(
            f"&condition.Dirs[{k}]={v}" for k, v in enumerate(directories)
        )

        c_types = "".join(
            f"&condition.Types[{k}]={v}" for k, v in enumerate(types)
        )

        c_flag = "".join(
            f"&condition.Flag[{k}]={v}" for k, v in enumerate(flags)
        )

        c_events = "".join(
            f"&condition.Events[{k}]={v}" for k, v in enumerate(events)
        )

        c_vs = f"&condition.VideoStream={stream}" if stream else ""


        start = date_to_str(start_time)