diff --git a/rclone_python/utils.py b/rclone_python/utils.py index 5b63252..f53f8f6 100644 --- a/rclone_python/utils.py +++ b/rclone_python/utils.py @@ -112,6 +112,17 @@ def rclone_progress( def extract_rclone_progress(line: str) -> Tuple[bool, Union[Dict[str, Any], None]]: + """Extracts and returns the progress updates from the rclone transfer operation. + The returned Dictionary includes the original rclone stats output inside of "rclone_output". + All file sizes and speeds are give in bytes. + + Args: + line (str): One output line of the rclone transfer operation with the --use-json-log flag enabled. + + Returns: + Tuple[bool, Union[Dict[str, Any], None]]: The retrieved update Dictionary. + """ + try: stats: Dict = json.loads(line).get("stats", None) except ValueError: