changeset 13:8ac49bf5241f

Document PhotosService.download_item better
author Lewin Bormann <lbo@spheniscida.de>
date Fri, 14 Jun 2019 23:45:35 +0200
parents 31561c863ccf
children b83a9e2622b3
files photosync.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/photosync.py	Fri Jun 14 23:04:10 2019 +0200
+++ b/photosync.py	Fri Jun 14 23:45:35 2019 +0200
@@ -106,6 +106,15 @@
 
     def download_item(self, id, path, video):
         """Download a item and store it under its file name in the directory `path`.
+
+        First, the item is queried again in order to obtain the base URL (which
+        is not permanent). Then, the base URL is used to fetch the image/video
+        bytes.
+
+        Arguments:
+            id: Media ID of item.
+            path: Directory where to store it.
+            video: Boolean, whether item is video.
         """
         item = self._service.mediaItems().get(mediaItemId=id).execute()
         rawurl = item['baseUrl']