From 2888f5973d85e879c6b1fe045b31c3ad385b87e4 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Tue, 16 May 2023 00:56:19 +0200 Subject: [PATCH] Move `id = comment[id]` in `treatComment(comment)` to an inner scope --- search_in_youtube_video_comments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search_in_youtube_video_comments.py b/search_in_youtube_video_comments.py index 7a89081..1d8a8ca 100755 --- a/search_in_youtube_video_comments.py +++ b/search_in_youtube_video_comments.py @@ -19,9 +19,9 @@ nextPageToken = '' commentRegexCompiled = re.compile(COMMENT_REGEX) def treatComment(comment): - id = comment['id'] textOriginal = comment['snippet']['textOriginal'] if commentRegexCompiled.search(textOriginal): + id = comment['id'] url = f'https://www.youtube.com/watch?v={VIDEO_ID}&lc={id}' print(f'{url} {textOriginal}') if OPEN_IN_FIREFOX: