Last active
July 15, 2020 22:54
-
-
Save idling-mind/77ae720246f80a14e31249652cc26846 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items = [] | |
nextpagetoken = None | |
# The default number of media items to return at a time is 25. The maximum pageSize is 100. | |
while nextpagetoken != '': | |
print(f"Number of items processed:{len(items)}", end='\r') | |
results = google_photos.mediaItems().list(pageSize=100, pageToken=nextpagetoken).execute() | |
items += results.get('mediaItems', []) | |
nextpagetoken = results.get('nextPageToken', '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment