From 0c9c2d976378c9f33d462170b91508e5caa09278 Mon Sep 17 00:00:00 2001 From: Steve Holden Date: Thu, 13 Jan 2022 01:30:59 +0000 Subject: [PATCH] Modify apparently incorrect test The original line 46 contained the test if rvideoId not in liked and rvideoId not in recommended: For line 47 to execute at all, therefore, `rvideoId not in recommended` must be true. It follows that the test in line 47 will always succeed, and that the incrementation logic in line 50 can never execute. It seems unlikely this was intentional. --- samples/retrieve_related_videos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/retrieve_related_videos.py b/samples/retrieve_related_videos.py index c08779a..08d711d 100644 --- a/samples/retrieve_related_videos.py +++ b/samples/retrieve_related_videos.py @@ -43,7 +43,7 @@ for relatedvideos in youtube.iterate_related_videos(videoId,maxCount): for item in relatedvideos['items']: rvideoId, rtitle = item['id']['videoId'],item['snippet']['title'] - if rvideoId not in liked and rvideoId not in recommended: + if rvideoId not in liked: if rvideoId not in recommended: recommended[rvideoId] = {"title" : rtitle,"count" : 1} else: