[GH-ISSUE #54] keyError longBylineText in watch playlist parse #37

Closed
opened 2026-02-27 22:07:41 +03:00 by kerem · 1 comment
Owner

Originally created by @scrimshander on GitHub (Aug 5, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/54

Hi -

Using v 0.9.1. Looking at the JSON for a watch playlist, I'm only seeing shortBylineText and the parser is looking for longBylineText. Is this a known issue? (Line numbers will be slightly off as I added some code to output the JSON). You can see the song ID I am using in the tracebak. Happy to provide the full JSON as well.

Traceback (most recent call last):
  File "ytmusic_test.py", line 4, in <module>
    ytmusic.get_watch_playlist('X3IA6pIVank')
  File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/mixins/watch.py", line 63, in get_watch_playlist
    tracks = parse_watch_playlist(results['contents'])
  File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/watch.py", line 14, in parse_watch_playlist
    'byline': nav(data, ['longBylineText', 'runs', 0, 'text']),
  File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 75, in nav
    raise err
  File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 69, in nav
    root = root[k]
KeyError: 'longBylineText'
Originally created by @scrimshander on GitHub (Aug 5, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/54 Hi - Using v 0.9.1. Looking at the JSON for a watch playlist, I'm only seeing `shortBylineText` and the parser is looking for `longBylineText`. Is this a known issue? (Line numbers will be slightly off as I added some code to output the JSON). You can see the song ID I am using in the tracebak. Happy to provide the full JSON as well. ``` Traceback (most recent call last): File "ytmusic_test.py", line 4, in <module> ytmusic.get_watch_playlist('X3IA6pIVank') File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/mixins/watch.py", line 63, in get_watch_playlist tracks = parse_watch_playlist(results['contents']) File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/watch.py", line 14, in parse_watch_playlist 'byline': nav(data, ['longBylineText', 'runs', 0, 'text']), File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 75, in nav raise err File "/Users/johnmagee2/Documents/PythonEnvironments/ytmusic/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 69, in nav root = root[k] KeyError: 'longBylineText' ```
kerem closed this issue 2026-02-27 22:07:41 +03:00
Author
Owner

@sigma67 commented on GitHub (Aug 6, 2020):

It seems something changed on the server side, longBylineText is missing for all my tests now, too (which previously passed).

I'll change it to return shortbyline instead, or None if it is missing.

<!-- gh-comment-id:669898845 --> @sigma67 commented on GitHub (Aug 6, 2020): It seems something changed on the server side, `longBylineText` is missing for all my tests now, too (which previously passed). I'll change it to return shortbyline instead, or None if it is missing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#37
No description provided.