diff --git a/src/icloudpd/download.py b/src/icloudpd/download.py index 2ebd4cbcf..bad73aa40 100644 --- a/src/icloudpd/download.py +++ b/src/icloudpd/download.py @@ -125,7 +125,7 @@ def download_media( ) break - except (ConnectionError, socket.timeout, PyiCloudAPIResponseException, Timeout) as ex: + except (ConnectionError, ConnectionResetError, socket.timeout, PyiCloudAPIResponseException, Timeout) as ex: if "Invalid global session" in str(ex): logger.error("Session error, re-authenticating...") if retries > 0: diff --git a/src/pyicloud_ipd/services/photos.py b/src/pyicloud_ipd/services/photos.py index cafd11da5..ac0e8c99b 100644 --- a/src/pyicloud_ipd/services/photos.py +++ b/src/pyicloud_ipd/services/photos.py @@ -410,7 +410,7 @@ def photos(self) -> Generator["PhotoAsset", Any, None]: while(True): try: request = self.photos_request(offset) - except PyiCloudAPIResponseException as ex: + except (ConnectionError, ConnectionResetError, PyiCloudAPIResponseException) as ex: if self.exception_handler: exception_retries += 1 self.exception_handler(ex, exception_retries)