Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in get_artist #575

Closed
fabi321 opened this issue Apr 26, 2024 · 2 comments
Closed

Error in get_artist #575

fabi321 opened this issue Apr 26, 2024 · 2 comments

Comments

@fabi321
Copy link
Contributor

fabi321 commented Apr 26, 2024

Describe the bug

ytmusic = YTMusic()
ytmusic.get_artist('MPADUCvkNfpMmpGTGI9dC2FW0baQ')

Fails with the following error:

  File "/.venv/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 228, in get_artist
    header = response["header"]["musicImmersiveHeaderRenderer"]
             ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'musicImmersiveHeaderRenderer'

From my preliminary diagnosis, it seems like Youtube ships a musicHeaderRenderer instead of a musicImmersiveHeaderRenderer.
Example response:

{
  ...,
  "header": {
    "musicHeaderRenderer": {
      "title": {
        "runs": [
          {
            "text": "SoulHikers"
          }
        ]
      },
      "trackingParams": "..."
    }
  },
  ...
}

Version: 1.6.0 (from pypi)

@fabi321
Copy link
Contributor Author

fabi321 commented Apr 26, 2024

After looking a bit more into the response I got, it confuses me a lot. It doesn't match the website at all. I can only find all singles in it, and nothing else. No subscribe button, no videos. I suspect that they actually changed something about the API endpoint.

@fabi321
Copy link
Contributor Author

fabi321 commented Apr 26, 2024

I have no clue, where I got the channel id from. I thought I copied it from the channel, but apparently I accidentally copied the singles screen, sorry, my bad.

@fabi321 fabi321 closed this as completed Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant