Skip to main content

Add your description here

Project description

iCloud Resolver

A fast and lightweight Python library and CLI tool to securely resolve and download files from iCloud Drive public links.

How it works

When you share a public iCloud Drive link (e.g., https://www.icloud.com/iclouddrive/...), it is not a direct file download link. Instead, it leads to Apple's web application.

This tool bypasses the browser by interacting directly with Apple's public CloudKit API. It parses the unique identifier from the link, queries the iCloud database, and safely retrieves the original filename along with the highly-secure, direct downloadURL. Finally, it streams the file directly to your disk with a progress bar.

(Note: iCloud Drive folders are currently not supported because downloading them requires user authentication and dynamic zip archiving).


Command Line Interface (CLI)

You can run this tool instantly from your terminal using zero-install execution tools like uvx or pipx:

# Using uvx
uvx icloud-resolver "https://www.icloud.com/iclouddrive/0afGK6zDBog_0drwp6YZoDLIg#Patches"

# Using pipx
pipx run icloud-resolver "https://www.icloud.com/iclouddrive/0afGK6zDBog_0drwp6YZoDLIg#Patches"

If you install the package globally (e.g. uv tool install .), it exposes two aliases that you can use interchangeably: icloud-resolver and the shorter icr.

CLI Options

  • Download to the current directory:

    icr "https://www.icloud.com/iclouddrive/..."
    
  • Specify an output directory or custom file name:

    icr -o ./my_downloads "https://www.icloud.com/iclouddrive/..."
    icr -o custom_file.zip "https://www.icloud.com/iclouddrive/..."
    
  • Only resolve the URL (print the direct download link without downloading):

    icr -r "https://www.icloud.com/iclouddrive/..."
    

Programmatic Usage

You can also import icloud-resolver directly into your own Python scripts. The library features robust custom exceptions for smooth programmatic error handling.

example.py

from icloud_resolver import resolve_icloud_link, download_file
from icloud_resolver.exceptions import (
    ICloudResolverError, 
    FolderNotSupportedError
)

url = "https://www.icloud.com/iclouddrive/0afGK6zDBog_0drwp6YZoDLIg#Patches"

# Example 1: Resolving the link without downloading
try:
    direct_url, filename = resolve_icloud_link(url)
    print(f"Original Name: {filename}")
    print(f"Direct Link: {direct_url}")
except FolderNotSupportedError:
    print("Oops! This link points to a folder, which is unsupported.")
except ICloudResolverError as e:
    print(f"Something went wrong: {e}")

# Example 2: Downloading the file directly
try:
    # Set target_path to a directory to auto-use the original filename, 
    # or set it to a full path to use a custom filename.
    saved_path = download_file(url, target_path=".")
    print(f"File successfully downloaded to: {saved_path}")
except ICloudResolverError as e:
    print(f"Download failed: {e}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icloud_resolver-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icloud_resolver-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file icloud_resolver-0.1.0.tar.gz.

File metadata

  • Download URL: icloud_resolver-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for icloud_resolver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91a52eefd0331c0123d2909e1799014334fb8e7585a42d1d986fa3ef6da8aafa
MD5 3247794ec2597a9a6835f4aacae10f74
BLAKE2b-256 bc37dea8ac20501eb4d16926c4df656a5d77d4e1cda82fd3859414dfea5dac93

See more details on using hashes here.

Provenance

The following attestation bundles were made for icloud_resolver-0.1.0.tar.gz:

Publisher: publish.yml on xxanqw/icloud-resolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file icloud_resolver-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for icloud_resolver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8e12065aefee98d1a9b0e2d0e2ffe1b5b4313bfdf3bb98770ea7b8614164abf
MD5 604e6b7c5f2f31d85462b7a64433d3e7
BLAKE2b-256 d5b309c3d45ed5c98995c3fc30a5d071d030d6d427c7babe2214646697480455

See more details on using hashes here.

Provenance

The following attestation bundles were made for icloud_resolver-0.1.0-py3-none-any.whl:

Publisher: publish.yml on xxanqw/icloud-resolver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page