github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/googlephotos.md (about)

     1  ---
     2  title: "Google Photos"
     3  description: "Rclone docs for Google Photos"
     4  ---
     5  
     6  {{< icon "fa fa-images" >}} Google Photos
     7  -------------------------------------------------
     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  ## Configuring Google Photos
    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 auto config?
    66   * Say Y if not sure
    67   * Say N if you are working on a remote or headless machine
    68  y) Yes
    69  n) No
    70  y/n> y
    71  If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
    72  Log in and authorize rclone for access
    73  Waiting for code...
    74  Got code
    75  
    76  *** IMPORTANT: All media items uploaded to Google Photos with rclone
    77  *** are stored in full resolution at original quality.  These uploads
    78  *** will count towards storage in your Google Account.
    79  
    80  --------------------
    81  [remote]
    82  type = google photos
    83  token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"}
    84  --------------------
    85  y) Yes this is OK
    86  e) Edit this remote
    87  d) Delete this remote
    88  y/e/d> y
    89  ```
    90  
    91  Note that rclone runs a webserver on your local machine to collect the
    92  token as returned from Google if you use auto config mode. This only
    93  runs from the moment it opens your browser to the moment you get back
    94  the verification code.  This is on `http://127.0.0.1:53682/` and this
    95  may require you to unblock it temporarily if you are running a host
    96  firewall, or use manual mode.
    97  
    98  This remote is called `remote` and can now be used like this
    99  
   100  See all the albums in your photos
   101  
   102      rclone lsd remote:album
   103  
   104  Make a new album
   105  
   106      rclone mkdir remote:album/newAlbum
   107  
   108  List the contents of an album
   109  
   110      rclone ls remote:album/newAlbum
   111  
   112  Sync `/home/local/images` to the Google Photos, removing any excess
   113  files in the album.
   114  
   115      rclone sync /home/local/image remote:album/newAlbum
   116  
   117  ## Layout
   118  
   119  As Google Photos is not a general purpose cloud storage system the
   120  backend is laid out to help you navigate it.
   121  
   122  The directories under `media` show different ways of categorizing the
   123  media.  Each file will appear multiple times.  So if you want to make
   124  a backup of your google photos you might choose to backup
   125  `remote:media/by-month`.  (**NB** `remote:media/by-day` is rather slow
   126  at the moment so avoid for syncing.)
   127  
   128  Note that all your photos and videos will appear somewhere under
   129  `media`, but they may not appear under `album` unless you've put them
   130  into albums.
   131  
   132  ```
   133  /
   134  - upload
   135      - file1.jpg
   136      - file2.jpg
   137      - ...
   138  - media
   139      - all
   140          - file1.jpg
   141          - file2.jpg
   142          - ...
   143      - by-year
   144          - 2000
   145              - file1.jpg
   146              - ...
   147          - 2001
   148              - file2.jpg
   149              - ...
   150          - ...
   151      - by-month
   152          - 2000
   153              - 2000-01
   154                  - file1.jpg
   155                  - ...
   156              - 2000-02
   157                  - file2.jpg
   158                  - ...
   159          - ...
   160      - by-day
   161          - 2000
   162              - 2000-01-01
   163                  - file1.jpg
   164                  - ...
   165              - 2000-01-02
   166                  - file2.jpg
   167                  - ...
   168          - ...
   169  - album
   170      - album name
   171      - album name/sub
   172  - shared-album
   173      - album name
   174      - album name/sub
   175  - feature
   176      - favorites
   177          - file1.jpg
   178          - file2.jpg
   179  ```
   180  
   181  There are two writable parts of the tree, the `upload` directory and
   182  sub directories of the `album` directory.
   183  
   184  The `upload` directory is for uploading files you don't want to put
   185  into albums. This will be empty to start with and will contain the
   186  files you've uploaded for one rclone session only, becoming empty
   187  again when you restart rclone. The use case for this would be if you
   188  have a load of files you just want to once off dump into Google
   189  Photos. For repeated syncing, uploading to `album` will work better.
   190  
   191  Directories within the `album` directory are also writeable and you
   192  may create new directories (albums) under `album`.  If you copy files
   193  with a directory hierarchy in there then rclone will create albums
   194  with the `/` character in them.  For example if you do
   195  
   196      rclone copy /path/to/images remote:album/images
   197  
   198  and the images directory contains
   199  
   200  ```
   201  images
   202      - file1.jpg
   203      dir
   204          file2.jpg
   205      dir2
   206          dir3
   207              file3.jpg
   208  ```
   209  
   210  Then rclone will create the following albums with the following files in
   211  
   212  - images
   213      - file1.jpg
   214  - images/dir
   215      - file2.jpg
   216  - images/dir2/dir3
   217      - file3.jpg
   218  
   219  This means that you can use the `album` path pretty much like a normal
   220  filesystem and it is a good target for repeated syncing.
   221  
   222  The `shared-album` directory shows albums shared with you or by you.
   223  This is similar to the Sharing tab in the Google Photos web interface.
   224  
   225  ## Limitations
   226  
   227  Only images and videos can be uploaded.  If you attempt to upload non
   228  videos or images or formats that Google Photos doesn't understand,
   229  rclone will upload the file, then Google Photos will give an error
   230  when it is put turned into a media item.
   231  
   232  Note that all media items uploaded to Google Photos through the API
   233  are stored in full resolution at "original quality" and **will** count
   234  towards your storage quota in your Google Account.  The API does
   235  **not** offer a way to upload in "high quality" mode..
   236  
   237  ### Downloading Images
   238  
   239  When Images are downloaded this strips EXIF location (according to the
   240  docs and my tests).  This is a limitation of the Google Photos API and
   241  is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115).
   242  
   243  **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**
   244  
   245  ### Downloading Videos
   246  
   247  When videos are downloaded they are downloaded in a really compressed
   248  version of the video compared to downloading it via the Google Photos
   249  web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044).
   250  
   251  ### Duplicates
   252  
   253  If a file name is duplicated in a directory then rclone will add the
   254  file ID into its name.  So two files called `file.jpg` would then
   255  appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs
   256  are a lot longer alas!).
   257  
   258  If you upload the same image (with the same binary data) twice then
   259  Google Photos will deduplicate it.  However it will retain the
   260  filename from the first upload which may confuse rclone.  For example
   261  if you uploaded an image to `upload` then uploaded the same image to
   262  `album/my_album` the filename of the image in `album/my_album` will be
   263  what it was uploaded with initially, not what you uploaded it with to
   264  `album`.  In practise this shouldn't cause too many problems.
   265  
   266  ### Modified time
   267  
   268  The date shown of media in Google Photos is the creation date as
   269  determined by the EXIF information, or the upload date if that is not
   270  known.
   271  
   272  This is not changeable by rclone and is not the modification date of
   273  the media on local disk.  This means that rclone cannot use the dates
   274  from Google Photos for syncing purposes.
   275  
   276  ### Size
   277  
   278  The Google Photos API does not return the size of media.  This means
   279  that when syncing to Google Photos, rclone can only do a file
   280  existence check.
   281  
   282  It is possible to read the size of the media, but this needs an extra
   283  HTTP HEAD request per media item so is **very slow** and uses up a lot of
   284  transactions.  This can be enabled with the `--gphotos-read-size`
   285  option or the `read_size = true` config parameter.
   286  
   287  If you want to use the backend with `rclone mount` you may need to
   288  enable this flag (depending on your OS and application using the
   289  photos) otherwise you may not be able to read media off the mount.
   290  You'll need to experiment to see if it works for you without the flag.
   291  
   292  ### Albums
   293  
   294  Rclone can only upload files to albums it created. This is a
   295  [limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums).
   296  
   297  Rclone can remove files it uploaded from albums it created only.
   298  
   299  ### Deleting files
   300  
   301  Rclone can remove files from albums it created, but note that the
   302  Google Photos API does not allow media to be deleted permanently so
   303  this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781).
   304  
   305  Rclone cannot delete files anywhere except under `album`.
   306  
   307  ### Deleting albums
   308  
   309  The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733).
   310  
   311  {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/googlephotos/googlephotos.go then run make backenddocs" >}}
   312  ### Standard Options
   313  
   314  Here are the standard options specific to google photos (Google Photos).
   315  
   316  #### --gphotos-client-id
   317  
   318  Google Application Client Id
   319  Leave blank normally.
   320  
   321  - Config:      client_id
   322  - Env Var:     RCLONE_GPHOTOS_CLIENT_ID
   323  - Type:        string
   324  - Default:     ""
   325  
   326  #### --gphotos-client-secret
   327  
   328  Google Application Client Secret
   329  Leave blank normally.
   330  
   331  - Config:      client_secret
   332  - Env Var:     RCLONE_GPHOTOS_CLIENT_SECRET
   333  - Type:        string
   334  - Default:     ""
   335  
   336  #### --gphotos-read-only
   337  
   338  Set to make the Google Photos backend read only.
   339  
   340  If you choose read only then rclone will only request read only access
   341  to your photos, otherwise rclone will request full access.
   342  
   343  - Config:      read_only
   344  - Env Var:     RCLONE_GPHOTOS_READ_ONLY
   345  - Type:        bool
   346  - Default:     false
   347  
   348  ### Advanced Options
   349  
   350  Here are the advanced options specific to google photos (Google Photos).
   351  
   352  #### --gphotos-read-size
   353  
   354  Set to read the size of media items.
   355  
   356  Normally rclone does not read the size of media items since this takes
   357  another transaction.  This isn't necessary for syncing.  However
   358  rclone mount needs to know the size of files in advance of reading
   359  them, so setting this flag when using rclone mount is recommended if
   360  you want to read the media.
   361  
   362  - Config:      read_size
   363  - Env Var:     RCLONE_GPHOTOS_READ_SIZE
   364  - Type:        bool
   365  - Default:     false
   366  
   367  #### --gphotos-start-year
   368  
   369  Year limits the photos to be downloaded to those which are uploaded after the given year
   370  
   371  - Config:      start_year
   372  - Env Var:     RCLONE_GPHOTOS_START_YEAR
   373  - Type:        int
   374  - Default:     2000
   375  
   376  {{< rem autogenerated options stop >}}