Skip to content

Commit

Permalink
properly determine separator for artists runs on videos (closes #254)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Jan 30, 2022
1 parent 64276bc commit 7bc65ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ytmusicapi/parsers/browsing.py
Expand Up @@ -180,10 +180,15 @@ def parse_single(result):

def parse_video(result):
runs = result['subtitle']['runs']
artists_len = len(runs)
try:
artists_len = runs.index({'text': ' • '})
except ValueError:
pass
video = {
'title': nav(result, TITLE_TEXT),
'videoId': nav(result, NAVIGATION_VIDEO_ID),
'artists': parse_song_artists_runs(runs[:-2]),
'artists': parse_song_artists_runs(runs[:artists_len]),
'playlistId': nav(result, NAVIGATION_PLAYLIST_ID, True),
'thumbnails': nav(result, THUMBNAIL_RENDERER, True)
}
Expand Down

0 comments on commit 7bc65ba

Please sign in to comment.