Skip to content

Commit

Permalink
Fix: Aleph file download
Browse files Browse the repository at this point in the history
  • Loading branch information
1yam committed Nov 13, 2023
1 parent 14376dd commit 6deebee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/aleph_client/commands/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ async def download(

async with AlephHttpClient(api_server=sdk_settings.API_HOST) as client:
logger.info(f"Downloading {hash} ...")
async with AlephHttpClient(api_server=sdk_settings.API_HOST) as client:
with open(output_file_path, "wb") as fd:
if use_ipfs:
await client.download_file_to_buffer(hash, fd)
else:
await client.download_file_to_buffer(hash, fd)
with open(output_file_path, "wb") as fd:
if not use_ipfs:
await client.download_file_to_buffer(hash, fd)
else:
await client.download_file_ipfs_to_buffer(hash, fd)

logger.debug("File downloaded successfully.")

0 comments on commit 6deebee

Please sign in to comment.