Skip to content

Commit 5bc94ed

Browse files
update doc for multi account/config support (#1232)
1 parent c527bf2 commit 5bc94ed

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

docs/authentication.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can receive an email notification when two-factor authentication expires by
1010
`--smtp-username` and `--smtp-password` options. Emails will be sent to `--smtp-username` by default,
1111
or you can send to a different email address with `--notification-email`.
1212

13-
If you want to send notification emails using your Gmail account, and you have enabled two-factor authentication, you will need to generate an App Password at <https://myaccount.google.com/apppasswords>
13+
If you want to send notification emails using your Gmail account, and you have enabled two-factor authentication, you will need to generate an App Password at <https://myaccount.google.com/apppasswords>.
1414

1515
## MFA Providers
1616

@@ -42,6 +42,7 @@ Advanced Data Protection (ADP) for iCloud accounts is not supported because `icl
4242

4343
Some authentication errors may be resolved by clearing `.pyicloud` subfolder in the user's home directory. [Example](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/772#issuecomment-1950963522)
4444

45+
(password-providers)=
4546
## Password Providers
4647

4748
```{versionadded} 1.20.0
@@ -85,3 +86,37 @@ icloud --username jappleseed@apple.com --delete-from-keyring
8586
```{note}
8687
Use `icloud`, not `icloudpd`
8788
```
89+
90+
(multiple-accounts-and-configs)=
91+
## Using Multiple Accounts and Config
92+
93+
`icloudpd` can process iCloud collections for multiple accounts or use multiple configs for one account. This is achived by specifying `--username` parameter multiples times: any options specified after `--username` will be applied to mentioned user only. Parameters specified before first `--username` work as defaults for all other user configs. Global app-wide settings can be specified anywhere.
94+
95+
### Example: using two user accounts
96+
97+
```
98+
$ icloudpd --use-os-locale --cookie-directory ./cookies --username alice@apple.com --directory ./alice --username bob@apple.com --directory ./bob
99+
```
100+
101+
Explanation
102+
103+
- `--use-os-locale` is global parameter and can be used anywhere
104+
- `--cookie-directory` is a default for both users; it is okay to use same folder since session and coockies are stored in files based on user name, so they would not collide
105+
- `--directory ./alice` is specifying that all photos for Alice will be downloaded into ./alice folder
106+
- `--directory ./bob` is specifying that all photos for Alice will be downloaded into ./alice folder
107+
108+
### Example: using two configs for one account
109+
110+
```
111+
$ icloudpd --cookie-directory ./cookies --username alice@apple.com --directory ./photos --skip-videos --username alice@apple.com --directory ./videos --skip-photos --use-os-locale
112+
```
113+
114+
Explanation
115+
116+
- `--cookie-directory` is a default for both configs
117+
- `--directory ./photos --skip-videos` is specifying that all photos for Alice will be downloaded into ./photos folder
118+
- `--directory ./videos --skip-photos` is specifying that all videos for Alice will be downloaded into ./videos folder
119+
- `--use-os-locale` is global parameter and can be used anywhere
120+
121+
```{versionadded} 1.32.0
122+
```

docs/naming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Assets on iCloud have names. When downloading assets, `icloudpd` can adjust names.
44

5-
(folder_structure)=
5+
(folder-structure)=
66
## Folder Structure
77

88
```{versionchanged} 1.7.0
@@ -18,7 +18,7 @@ Specifying `--folder-structure none` will put all files into one folder.
1818

1919
### Formatting
2020

21-
`icloudpd` follows [Python string formatting grammar](https://docs.python.org/3/library/string.html#formatstrings) for [`--folder-structure`](folder-structure-parameter) parameter,e.g. `{:%Y}` means the need to take only 4-digit year out of created date. Full list of format codes is [available](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).
21+
`icloudpd` follows [Python string formatting grammar](https://docs.python.org/3/library/string.html#formatstrings) for [`--folder-structure`](folder-structure-parameter) parameter, e.g. `{:%Y}` extracts only the 4-digit year from the creation date. Full list of format codes is [available](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).
2222

2323
Default format is: `{:%Y/%m/%d}`
2424

docs/reference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ This is a list of all options available for command line interface (CLI) of the
105105
: Specifies iCloud password to use for authentication
106106

107107
```{note}
108-
Supplying credentials through command line parameters is considered not a good practice since they can be logged and/or otherwise exposed. Consider using other [password providers](authentication).
108+
Supplying credentials through command line parameters is considered not a good practice since they can be logged and/or otherwise exposed. Consider using other [password providers](password-providers).
109109
```
110110

111111
(directory-parameter)=
112112
`--directory X`
113113

114-
: Specifies root folder where [folder structure](naming) will start and files will be downloaded.
114+
: Specifies root folder where [folder structure](folder-structure-parameter) will start and files will be downloaded.
115115

116116
(file-match-policy-parameter)=
117117
`--file-match-policy X`
@@ -125,7 +125,7 @@ This is a list of all options available for command line interface (CLI) of the
125125
(username-parameter)=
126126
`--username X`
127127

128-
: Specifies AppleID (email address) used for authenticating to iCloud.
128+
: Specifies AppleID (email address) used for authenticating to iCloud. May be used multiple times to introduce different configurations and/or accounts. See [Using Multiple Accounts and Config](multiple-accounts-and-configs)
129129

130130
(auth-only-parameter)=
131131
`--auth-only`
@@ -220,7 +220,7 @@ This is a list of all options available for command line interface (CLI) of the
220220
```{seealso}
221221
[Modes of operation](mode)
222222

223-
[Folder Structure](folder_structure)
223+
[Folder Structure](folder-structure)
224224
```
225225

226226
(only-print-filenames-parameter)=
@@ -237,7 +237,7 @@ This is a list of all options available for command line interface (CLI) of the
237237
: Specifies sub folder naming scheme.
238238

239239
```{seealso}
240-
Details in [Folder structure](naming) section.
240+
Details in [Folder structure](folder-structure) section.
241241
```
242242

243243
(set-exif-datetime-parameter)=
@@ -279,7 +279,7 @@ This is a list of all options available for command line interface (CLI) of the
279279
: Customizes intake of the password for iCloud authentication.
280280

281281
```{seealso}
282-
Details in [Password providers](authentication) section.
282+
Details in [Password providers](password-providers) section.
283283
```
284284
(mfa-provider-parameter)=
285285
`--mfa-provider X`

scripts/install_deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# this is used to setup development env (all required dependencies for all cases)
33
set -euo pipefail
44
python3 -m pip install --disable-pip-version-check -r requirements-pip.txt
5-
pip3 install --disable-pip-version-check -e . --group test --group dev
5+
pip3 install --disable-pip-version-check -e . --group test --group dev --group doc

0 commit comments

Comments
 (0)