From 8821491ff3b66a9ad22a869e9f4db1fdd21e4d15 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 25 Oct 2021 14:00:12 -0700 Subject: [PATCH] Log the total number of snippets retrieved. --- ycdl/ytapi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ycdl/ytapi.py b/ycdl/ytapi.py index e82c4dc..532594a 100644 --- a/ycdl/ytapi.py +++ b/ycdl/ytapi.py @@ -128,6 +128,7 @@ class Youtube: def get_videos(self, video_ids): chunks = gentools.chunk_generator(video_ids, 50) + total_snippets = 0 for chunk in chunks: self.log.debug('Requesting batch of %d video ids.', len(chunk)) self.log.loud(chunk) @@ -138,6 +139,7 @@ class Youtube: ).execute() snippets = data['items'] self.log.debug('Got %d snippets.', len(snippets)) + total_snippets += len(snippets) self.log.loud(snippets) for snippet in snippets: try: @@ -145,3 +147,4 @@ class Youtube: yield video except KeyError as exc: self.log.warning(f'KEYERROR: {exc} not in {snippet}') + self.log.debug('Finished getting a total of %d snippets.', total_snippets)