Fix get_library_songs if there are no songs in library (#69)
This commit is contained in:
parent
9bded79ea2
commit
ae8213eda9
1 changed files with 6 additions and 4 deletions
|
|
@ -82,7 +82,9 @@ def parse_library_songs(response):
|
||||||
results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST),
|
results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST),
|
||||||
'itemSectionRenderer')
|
'itemSectionRenderer')
|
||||||
results = nav(results, ITEM_SECTION)
|
results = nav(results, ITEM_SECTION)
|
||||||
if 'musicShelfRenderer' not in results:
|
songs = {'results': [], 'parsed': []}
|
||||||
return []
|
if 'musicShelfRenderer' in results:
|
||||||
results = results['musicShelfRenderer']
|
songs['results'] = results['musicShelfRenderer']
|
||||||
return {'results': results, 'parsed': parse_playlist_items(results['contents'][1:])}
|
songs['parsed'] = parse_playlist_items(songs['results']['contents'][1:])
|
||||||
|
|
||||||
|
return songs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue