diff --git a/transferwee.py b/transferwee.py index 8833265..49152db 100755 --- a/transferwee.py +++ b/transferwee.py @@ -378,7 +378,10 @@ def _storm_prepare(authorization: str, filenames: List[str]) -> Dict[Any, Any]: files_bids = [_storm_prepare_item(f) for f in filenames] blocks = [i for sublist in files_bids for i in sublist] - response = {"ok": True, "data": {"blocks": []}} + response: Dict[str, Union[bool, Dict[str, List[Any]]]] = { + "ok": True, + "data": {"blocks": []}, + } chunk_size = 100 for i in range(0, len(blocks), chunk_size): j = { @@ -406,7 +409,9 @@ def _storm_prepare(authorization: str, filenames: List[str]) -> Dict[Any, Any]: if not r_json["ok"]: logger.error(r_json) response["ok"] = response["ok"] and r_json["ok"] - response["data"]["blocks"] += r_json["data"]["blocks"] + typing.cast(typing.Dict[str, List], response["data"])[ + "blocks" + ] += typing.cast(typing.Dict[str, List], r_json["data"])["blocks"] return {"files_bids": files_bids, "blocks": response}