Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ node_modules/
/package.json
/package-lock.json
# used for local troubleshooting
.photos
.photos
.cookies/
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fix: transfer chunk issues terminate with error [#1202](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/1202)

## 1.29.2 (2025-07-21)

- fix: emulating old browser and client version fails authentication [#1073](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/1073)
Expand Down
20 changes: 18 additions & 2 deletions src/icloudpd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
from multiprocessing import freeze_support

from requests import Timeout
from requests.exceptions import ConnectionError
from requests.exceptions import (
ChunkedEncodingError,
ConnectionError,
ContentDecodingError,
StreamConsumedError,
UnrewindableBodyError,
)
from urllib3.exceptions import NewConnectionError

import foundation
Expand Down Expand Up @@ -1311,7 +1317,7 @@ def core(
skip_bar = not os.environ.get("FORCE_TQDM") and (
only_print_filenames or no_progress_bar or not sys.stdout.isatty()
)
while True: # watch with interval
while True: # watch with interval & retry
try:
icloud = authenticator(
logger,
Expand Down Expand Up @@ -1542,6 +1548,16 @@ def should_break(counter: Counter) -> bool:
return 1
else:
pass
except (
ChunkedEncodingError,
ContentDecodingError,
StreamConsumedError,
UnrewindableBodyError,
) as error:
logger.debug(error)
logger.debug("Retrying...")
# these errors we can safely retry
continue
if watch_interval: # pragma: no cover
logger.info(f"Waiting for {watch_interval} sec...")
interval: Sequence[int] = range(1, watch_interval)
Expand Down
Loading