1

I'm looking for a way to extract google photos comments. Is there any official way through the API? Any alternatives?

Thanks Z

Zee
  • 131
  • 2
  • 11

1 Answers1

0

The method below will extract comments (and other useful info) from a Google Photos album. This worked on an M1 MacAir running Excel for Mac 16.55 (365 subscription)

  1. go to http://takeout.google.com
  2. select only the album within the google Photos section
  3. put all the resulting .json files and an Excel workbook in a folder located in /Users/[yourUserName]/Library/Group Containers/UBF8T346G9.Office/Docs where you replace [yourUserName] with your user account name
  4. run the Excel VBA macro below in the Excel workbook

Sub extractGooglePhotoInfo()

Dim s As String, path As String, ext As String

Dim tempWk As Workbook, tempR As Range

Dim sh As Worksheet, r As Range, t As String

ext = "json"

Set sh = ThisWorkbook.ActiveSheet

Set r = sh.Range("A1")

r.Offset(0, 0) = "file name"

r.Offset(0, 1) = "description"

r.Offset(0, 2) = "image views"

r.Offset(0, 3) = "photo taken"

r.Offset(0, 4) = "url"

Set r = sh.Range("A2")

s = Dir(ThisWorkbook.path & "/*." & ext)

While s <> ""

path = ThisWorkbook.path & "/" & s

Workbooks.OpenText path, , , xlDelimited

Set tempWk = ActiveWorkbook

Set tempR = tempWk.ActiveSheet.Range("A1")

t = tempR.Offset(1, 0): r.Offset(0, 0) = Mid(t, 13, Len(t) - 14) 'title

t = tempR.Offset(2, 0): r.Offset(0, 1) = Mid(t, 19, Len(t) - 20) 'description

t = tempR.Offset(3, 0): r.Offset(0, 2) = Mid(t, 18, Len(t) - 19) 'imageViews

t = tempR.Offset(10, 0): r.Offset(0, 3) = Mid(t, 19, Len(t) - 19) 'photoTaken

t = tempR.Offset(26, 0): r.Offset(0, 4) = Mid(t, 11, Len(t) - 12) 'url

Set r = r.Offset(1, 0)

tempWk.Close False

s = Dir()

Wend

*Note: the code formatting above is strange because I couldn't get the code formatting features to work with code copied directly from the Mac version of the VBA editor.

Tony M
  • 1,694
  • 2
  • 17
  • 33
  • unfortunately comments are only those done by you; any comments by other members who looked at the shared album will not be included – erict Nov 01 '22 at 12:59