24 January 2021

Download all your photos from Google photos with a raspberry pi

How to download all your photos from Google Photos on your raspberry pi using the command line

  • Export your photos via Google TakeOut
    • Surf to Google Takeout
    • Create an export (Seach for photos on this webpage and select only this row)
    • Export to tgz format size 50GB so you will have one large file with all your photos
    • It will take a while before Google sends you a mail with the download link
    • Start the download ..

To use a raspberry pi to download the tgz file containing all your Google photos:

  • Get the download URL:
    • Start the download in a browser on a (windows) PC
    • Via right mouse click on the file being downloaded, you can copy the download URL
    • You can now cancel the download in the browser on your PC and
      launch the download on your raspberry pi using wget
  • Download the tgz file
    • On the raspberry pi, use wget to download the URL
      e.g.  
      nohup wget -b -o GoogleTakeout.log -O GoogleTakeout.tgz "https://00f74ba.....-apidata.googleusercontent.com/download/storage/v1/b/takeout-eu/o/.......XivE&isca=1"
    • Depending on how large the tgz file is, it can take a  long time to download ....
      The download speed is (at home with a 50Mbps download linkspeed) : around 3.3MB/s = 12GB/hour
    • Check if download is working:
      ls -l GoogleTakout.tgz
      la -lh GoogleTakeout.tgz
      tail -f GoogleTakeout.log
      jobs
      ps -ef|grep wget
Tips (Copied from shell - Difference between nohup, disown and & - Unix & Linux Stack Exchange (thanks for the clear explication))

  • & puts the job in the background, that is, makes it block on attempting to read input, and makes the shell not wait for its completion.
  • disown removes the process from the shell's job control, but it still leaves it connected to the terminal. One of the results is that the shell won't send it a SIGHUP. Obviously, it can only be applied to background jobs, because you cannot enter it when a foreground job is running.
  • nohup disconnects the process from the terminal, redirects its output to nohup.out and shields it from SIGHUP. One of the effects (the naming one) is that the process won't receive any sent SIGHUP. It is completely independent from job control and could in principle be used also for foreground jobs (although that's not very useful).