Get Extract Video Clip List
Description
The get_extract_video_clip_list
function retrieves a list of extracted video clips from a device based on the given serial number and time range.
Function Signature:
def get_extract_video_clip_list(ws_config: WebServiceConfig, serial_number: str, start_epoch: int, end_epoch: int) -> WebServiceResult:
Parameters
- ws_config (WebServiceConfig): The configuration object for the web service.
- serial_number (str): The serial number of the device whose extracted video clips are being retrieved.
- start_epoch (int): The starting epoch time (in seconds) for the time range.
- end_epoch (int): The ending epoch time (in seconds) for the time range.
Returns
- WebServiceResult: The result of the web service request, which includes:
- http_response_code: The HTTP response code from the server (e.g., 200 for success).
- http_response_string: The response body from the server, which may contain extracted video clip data or errors.
- json_data: The parsed JSON response data, if available.
Example Usage
ws_config = WebServiceConfig(base_url="https://api.actionstreamer.com")
serial_number = "ABC1234"
start_epoch = 1609459200 # Start of January 1, 2021
end_epoch = 1609545600 # End of January 1, 2021
result = get_extract_video_clip_list(ws_config, serial_number, start_epoch, end_epoch)
print(result.http_response_code, result.http_response_string)
Behavior
- Sends a
POST
request tov1/videoclip/extract/list
to retrieve the extracted video clips for the specified device and time range. - Returns a
WebServiceResult
containing the response code, message, and parsed JSON data.
Error Handling
- General Exception: If any exception occurs during the request or processing, the function logs the error, sets the response code to
-1
, and includes a message in the response string indicating the failure.