# line download


Download an image, video, audio, file, or album preview thumbnail (up to 20 MiB). Use line messages CHAT --details --json to discover message IDs and album preview counts. Existing files are never overwritten. Encrypted media is verified before the first byte is written.

## Usage

```sh
line download CHAT --message ID --output PATH [--preview N] [--json]
line download CHAT --message ID --output - [--preview N] | COMMAND
```

## Target

| Option | Description |
| --- | --- |
| `--message ID` | attachment or album message ID (lookup: up to 10 pages / 1000 records / 30s) |
| `--preview N` | 1-based album thumbnail index (defaults to 1 when omitted) |

## Output

| Option | Description |
| --- | --- |
| `--output PATH` | destination path (never overwritten), or - for binary stdout |
| `--json` | write JSON summary |

## Request

| Option | Description |
| --- | --- |
| `--timeout DURATION` | command deadline including preparation, e.g. 30s; 0 disables it (default 2m0s) |

## Examples

```sh
line download "Alice" --message MESSAGE_ID --output ./photo.jpg
line download "Weekend Trip" --message ALBUM_MSG_ID --preview 2 --output ./thumb.jpg
line download CHAT_ID --message MESSAGE_ID --output - | consumer
```


---
Source: https://kongesque.github.io/line-cli/reference/commands/download/
