Skip to content

Commit 55b362e

Browse files
authored
fix #751: parse_video returns always a video ID or None (#752)
1 parent 5e3bc62 commit 55b362e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ytmusicapi/parsers/browsing.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def parse_video(result):
117117
videoId = nav(result, NAVIGATION_VIDEO_ID, True)
118118
if not videoId:
119119
videoId = next(
120-
id for entry in nav(result, MENU_ITEMS) if nav(entry, MENU_SERVICE + QUEUE_VIDEO_ID, True)
120+
video_id
121+
for entry in nav(result, MENU_ITEMS)
122+
if (video_id := nav(entry, MENU_SERVICE + QUEUE_VIDEO_ID, True))
121123
)
122124
return {
123125
"title": nav(result, TITLE_TEXT),

0 commit comments

Comments
 (0)