github.com/rclone/rclone@v1.66.1-0.20240517100346-7b89735ae726/docs/content/googlephotos.md (about) 1 --- 2 title: "Google Photos" 3 description: "Rclone docs for Google Photos" 4 versionIntroduced: "v1.49" 5 --- 6 7 # {{< icon "fa fa-images" >}} Google Photos 8 9 The rclone backend for [Google Photos](https://www.google.com/photos/about/) is 10 a specialized backend for transferring photos and videos to and from 11 Google Photos. 12 13 **NB** The Google Photos API which rclone uses has quite a few 14 limitations, so please read the [limitations section](#limitations) 15 carefully to make sure it is suitable for your use. 16 17 ## Configuration 18 19 The initial setup for google cloud storage involves getting a token from Google Photos 20 which you need to do in your browser. `rclone config` walks you 21 through it. 22 23 Here is an example of how to make a remote called `remote`. First run: 24 25 rclone config 26 27 This will guide you through an interactive setup process: 28 29 ``` 30 No remotes found, make a new one? 31 n) New remote 32 s) Set configuration password 33 q) Quit config 34 n/s/q> n 35 name> remote 36 Type of storage to configure. 37 Enter a string value. Press Enter for the default (""). 38 Choose a number from below, or type in your own value 39 [snip] 40 XX / Google Photos 41 \ "google photos" 42 [snip] 43 Storage> google photos 44 ** See help for google photos backend at: https://rclone.org/googlephotos/ ** 45 46 Google Application Client Id 47 Leave blank normally. 48 Enter a string value. Press Enter for the default (""). 49 client_id> 50 Google Application Client Secret 51 Leave blank normally. 52 Enter a string value. Press Enter for the default (""). 53 client_secret> 54 Set to make the Google Photos backend read only. 55 56 If you choose read only then rclone will only request read only access 57 to your photos, otherwise rclone will request full access. 58 Enter a boolean value (true or false). Press Enter for the default ("false"). 59 read_only> 60 Edit advanced config? (y/n) 61 y) Yes 62 n) No 63 y/n> n 64 Remote config 65 Use web browser to automatically authenticate rclone with remote? 66 * Say Y if the machine running rclone has a web browser you can use 67 * Say N if running rclone on a (remote) machine without web browser access 68 If not sure try Y. If Y failed, try N. 69 y) Yes 70 n) No 71 y/n> y 72 If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth 73 Log in and authorize rclone for access 74 Waiting for code... 75 Got code 76 77 *** IMPORTANT: All media items uploaded to Google Photos with rclone 78 *** are stored in full resolution at original quality. These uploads 79 *** will count towards storage in your Google Account. 80 81 -------------------- 82 [remote] 83 type = google photos 84 token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} 85 -------------------- 86 y) Yes this is OK 87 e) Edit this remote 88 d) Delete this remote 89 y/e/d> y 90 ``` 91 92 See the [remote setup docs](/remote_setup/) for how to set it up on a 93 machine with no Internet browser available. 94 95 Note that rclone runs a webserver on your local machine to collect the 96 token as returned from Google if using web browser to automatically 97 authenticate. This only 98 runs from the moment it opens your browser to the moment you get back 99 the verification code. This is on `http://127.0.0.1:53682/` and this 100 may require you to unblock it temporarily if you are running a host 101 firewall, or use manual mode. 102 103 This remote is called `remote` and can now be used like this 104 105 See all the albums in your photos 106 107 rclone lsd remote:album 108 109 Make a new album 110 111 rclone mkdir remote:album/newAlbum 112 113 List the contents of an album 114 115 rclone ls remote:album/newAlbum 116 117 Sync `/home/local/images` to the Google Photos, removing any excess 118 files in the album. 119 120 rclone sync --interactive /home/local/image remote:album/newAlbum 121 122 ### Layout 123 124 As Google Photos is not a general purpose cloud storage system, the 125 backend is laid out to help you navigate it. 126 127 The directories under `media` show different ways of categorizing the 128 media. Each file will appear multiple times. So if you want to make 129 a backup of your google photos you might choose to backup 130 `remote:media/by-month`. (**NB** `remote:media/by-day` is rather slow 131 at the moment so avoid for syncing.) 132 133 Note that all your photos and videos will appear somewhere under 134 `media`, but they may not appear under `album` unless you've put them 135 into albums. 136 137 ``` 138 / 139 - upload 140 - file1.jpg 141 - file2.jpg 142 - ... 143 - media 144 - all 145 - file1.jpg 146 - file2.jpg 147 - ... 148 - by-year 149 - 2000 150 - file1.jpg 151 - ... 152 - 2001 153 - file2.jpg 154 - ... 155 - ... 156 - by-month 157 - 2000 158 - 2000-01 159 - file1.jpg 160 - ... 161 - 2000-02 162 - file2.jpg 163 - ... 164 - ... 165 - by-day 166 - 2000 167 - 2000-01-01 168 - file1.jpg 169 - ... 170 - 2000-01-02 171 - file2.jpg 172 - ... 173 - ... 174 - album 175 - album name 176 - album name/sub 177 - shared-album 178 - album name 179 - album name/sub 180 - feature 181 - favorites 182 - file1.jpg 183 - file2.jpg 184 ``` 185 186 There are two writable parts of the tree, the `upload` directory and 187 sub directories of the `album` directory. 188 189 The `upload` directory is for uploading files you don't want to put 190 into albums. This will be empty to start with and will contain the 191 files you've uploaded for one rclone session only, becoming empty 192 again when you restart rclone. The use case for this would be if you 193 have a load of files you just want to once off dump into Google 194 Photos. For repeated syncing, uploading to `album` will work better. 195 196 Directories within the `album` directory are also writeable and you 197 may create new directories (albums) under `album`. If you copy files 198 with a directory hierarchy in there then rclone will create albums 199 with the `/` character in them. For example if you do 200 201 rclone copy /path/to/images remote:album/images 202 203 and the images directory contains 204 205 ``` 206 images 207 - file1.jpg 208 dir 209 file2.jpg 210 dir2 211 dir3 212 file3.jpg 213 ``` 214 215 Then rclone will create the following albums with the following files in 216 217 - images 218 - file1.jpg 219 - images/dir 220 - file2.jpg 221 - images/dir2/dir3 222 - file3.jpg 223 224 This means that you can use the `album` path pretty much like a normal 225 filesystem and it is a good target for repeated syncing. 226 227 The `shared-album` directory shows albums shared with you or by you. 228 This is similar to the Sharing tab in the Google Photos web interface. 229 230 {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/googlephotos/googlephotos.go then run make backenddocs" >}} 231 ### Standard options 232 233 Here are the Standard options specific to google photos (Google Photos). 234 235 #### --gphotos-client-id 236 237 OAuth Client Id. 238 239 Leave blank normally. 240 241 Properties: 242 243 - Config: client_id 244 - Env Var: RCLONE_GPHOTOS_CLIENT_ID 245 - Type: string 246 - Required: false 247 248 #### --gphotos-client-secret 249 250 OAuth Client Secret. 251 252 Leave blank normally. 253 254 Properties: 255 256 - Config: client_secret 257 - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET 258 - Type: string 259 - Required: false 260 261 #### --gphotos-read-only 262 263 Set to make the Google Photos backend read only. 264 265 If you choose read only then rclone will only request read only access 266 to your photos, otherwise rclone will request full access. 267 268 Properties: 269 270 - Config: read_only 271 - Env Var: RCLONE_GPHOTOS_READ_ONLY 272 - Type: bool 273 - Default: false 274 275 ### Advanced options 276 277 Here are the Advanced options specific to google photos (Google Photos). 278 279 #### --gphotos-token 280 281 OAuth Access Token as a JSON blob. 282 283 Properties: 284 285 - Config: token 286 - Env Var: RCLONE_GPHOTOS_TOKEN 287 - Type: string 288 - Required: false 289 290 #### --gphotos-auth-url 291 292 Auth server URL. 293 294 Leave blank to use the provider defaults. 295 296 Properties: 297 298 - Config: auth_url 299 - Env Var: RCLONE_GPHOTOS_AUTH_URL 300 - Type: string 301 - Required: false 302 303 #### --gphotos-token-url 304 305 Token server url. 306 307 Leave blank to use the provider defaults. 308 309 Properties: 310 311 - Config: token_url 312 - Env Var: RCLONE_GPHOTOS_TOKEN_URL 313 - Type: string 314 - Required: false 315 316 #### --gphotos-read-size 317 318 Set to read the size of media items. 319 320 Normally rclone does not read the size of media items since this takes 321 another transaction. This isn't necessary for syncing. However 322 rclone mount needs to know the size of files in advance of reading 323 them, so setting this flag when using rclone mount is recommended if 324 you want to read the media. 325 326 Properties: 327 328 - Config: read_size 329 - Env Var: RCLONE_GPHOTOS_READ_SIZE 330 - Type: bool 331 - Default: false 332 333 #### --gphotos-start-year 334 335 Year limits the photos to be downloaded to those which are uploaded after the given year. 336 337 Properties: 338 339 - Config: start_year 340 - Env Var: RCLONE_GPHOTOS_START_YEAR 341 - Type: int 342 - Default: 2000 343 344 #### --gphotos-include-archived 345 346 Also view and download archived media. 347 348 By default, rclone does not request archived media. Thus, when syncing, 349 archived media is not visible in directory listings or transferred. 350 351 Note that media in albums is always visible and synced, no matter 352 their archive status. 353 354 With this flag, archived media are always visible in directory 355 listings and transferred. 356 357 Without this flag, archived media will not be visible in directory 358 listings and won't be transferred. 359 360 Properties: 361 362 - Config: include_archived 363 - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED 364 - Type: bool 365 - Default: false 366 367 #### --gphotos-encoding 368 369 The encoding for the backend. 370 371 See the [encoding section in the overview](/overview/#encoding) for more info. 372 373 Properties: 374 375 - Config: encoding 376 - Env Var: RCLONE_GPHOTOS_ENCODING 377 - Type: Encoding 378 - Default: Slash,CrLf,InvalidUtf8,Dot 379 380 #### --gphotos-batch-mode 381 382 Upload file batching sync|async|off. 383 384 This sets the batch mode used by rclone. 385 386 This has 3 possible values 387 388 - off - no batching 389 - sync - batch uploads and check completion (default) 390 - async - batch upload and don't check completion 391 392 Rclone will close any outstanding batches when it exits which may make 393 a delay on quit. 394 395 396 Properties: 397 398 - Config: batch_mode 399 - Env Var: RCLONE_GPHOTOS_BATCH_MODE 400 - Type: string 401 - Default: "sync" 402 403 #### --gphotos-batch-size 404 405 Max number of files in upload batch. 406 407 This sets the batch size of files to upload. It has to be less than 50. 408 409 By default this is 0 which means rclone which calculate the batch size 410 depending on the setting of batch_mode. 411 412 - batch_mode: async - default batch_size is 50 413 - batch_mode: sync - default batch_size is the same as --transfers 414 - batch_mode: off - not in use 415 416 Rclone will close any outstanding batches when it exits which may make 417 a delay on quit. 418 419 Setting this is a great idea if you are uploading lots of small files 420 as it will make them a lot quicker. You can use --transfers 32 to 421 maximise throughput. 422 423 424 Properties: 425 426 - Config: batch_size 427 - Env Var: RCLONE_GPHOTOS_BATCH_SIZE 428 - Type: int 429 - Default: 0 430 431 #### --gphotos-batch-timeout 432 433 Max time to allow an idle upload batch before uploading. 434 435 If an upload batch is idle for more than this long then it will be 436 uploaded. 437 438 The default for this is 0 which means rclone will choose a sensible 439 default based on the batch_mode in use. 440 441 - batch_mode: async - default batch_timeout is 10s 442 - batch_mode: sync - default batch_timeout is 1s 443 - batch_mode: off - not in use 444 445 446 Properties: 447 448 - Config: batch_timeout 449 - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT 450 - Type: Duration 451 - Default: 0s 452 453 #### --gphotos-batch-commit-timeout 454 455 Max time to wait for a batch to finish committing 456 457 Properties: 458 459 - Config: batch_commit_timeout 460 - Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT 461 - Type: Duration 462 - Default: 10m0s 463 464 #### --gphotos-description 465 466 Description of the remote 467 468 Properties: 469 470 - Config: description 471 - Env Var: RCLONE_GPHOTOS_DESCRIPTION 472 - Type: string 473 - Required: false 474 475 {{< rem autogenerated options stop >}} 476 477 ## Limitations 478 479 Only images and videos can be uploaded. If you attempt to upload non 480 videos or images or formats that Google Photos doesn't understand, 481 rclone will upload the file, then Google Photos will give an error 482 when it is put turned into a media item. 483 484 Note that all media items uploaded to Google Photos through the API 485 are stored in full resolution at "original quality" and **will** count 486 towards your storage quota in your Google Account. The API does 487 **not** offer a way to upload in "high quality" mode.. 488 489 `rclone about` is not supported by the Google Photos backend. Backends without 490 this capability cannot determine free space for an rclone mount or 491 use policy `mfs` (most free space) as a member of an rclone union 492 remote. 493 494 See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) 495 See [rclone about](https://rclone.org/commands/rclone_about/) 496 497 ### Downloading Images 498 499 When Images are downloaded this strips EXIF location (according to the 500 docs and my tests). This is a limitation of the Google Photos API and 501 is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115). 502 503 **The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort** 504 505 ### Downloading Videos 506 507 When videos are downloaded they are downloaded in a really compressed 508 version of the video compared to downloading it via the Google Photos 509 web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044). 510 511 ### Duplicates 512 513 If a file name is duplicated in a directory then rclone will add the 514 file ID into its name. So two files called `file.jpg` would then 515 appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs 516 are a lot longer alas!). 517 518 If you upload the same image (with the same binary data) twice then 519 Google Photos will deduplicate it. However it will retain the 520 filename from the first upload which may confuse rclone. For example 521 if you uploaded an image to `upload` then uploaded the same image to 522 `album/my_album` the filename of the image in `album/my_album` will be 523 what it was uploaded with initially, not what you uploaded it with to 524 `album`. In practise this shouldn't cause too many problems. 525 526 ### Modification times 527 528 The date shown of media in Google Photos is the creation date as 529 determined by the EXIF information, or the upload date if that is not 530 known. 531 532 This is not changeable by rclone and is not the modification date of 533 the media on local disk. This means that rclone cannot use the dates 534 from Google Photos for syncing purposes. 535 536 ### Size 537 538 The Google Photos API does not return the size of media. This means 539 that when syncing to Google Photos, rclone can only do a file 540 existence check. 541 542 It is possible to read the size of the media, but this needs an extra 543 HTTP HEAD request per media item so is **very slow** and uses up a lot of 544 transactions. This can be enabled with the `--gphotos-read-size` 545 option or the `read_size = true` config parameter. 546 547 If you want to use the backend with `rclone mount` you may need to 548 enable this flag (depending on your OS and application using the 549 photos) otherwise you may not be able to read media off the mount. 550 You'll need to experiment to see if it works for you without the flag. 551 552 ### Albums 553 554 Rclone can only upload files to albums it created. This is a 555 [limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums). 556 557 Rclone can remove files it uploaded from albums it created only. 558 559 ### Deleting files 560 561 Rclone can remove files from albums it created, but note that the 562 Google Photos API does not allow media to be deleted permanently so 563 this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781). 564 565 Rclone cannot delete files anywhere except under `album`. 566 567 ### Deleting albums 568 569 The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733).