[PR #577] [MERGED] Prevent KeyError when using get_account_info() on a user that doesn't have a YouTube channel #657

Closed
opened 2026-02-27 23:01:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigma67/ytmusicapi/pull/577
Author: @apastel
Created: 5/3/2024
Status: Merged
Merged: 5/4/2024
Merged by: @sigma67

Base: mainHead: patch-1


📝 Commits (1)

  • d4f4983 channelHandle is absent if user has not created a YouTube channel

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 ytmusicapi/mixins/library.py (+1 -1)

📄 Description

get_account_info() raises a KeyError if the user does not have a channel handle because they never created a YouTube channel. Seems like a perfect reason to use the handy none_if_absent flag :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigma67/ytmusicapi/pull/577 **Author:** [@apastel](https://github.com/apastel) **Created:** 5/3/2024 **Status:** ✅ Merged **Merged:** 5/4/2024 **Merged by:** [@sigma67](https://github.com/sigma67) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`d4f4983`](https://github.com/sigma67/ytmusicapi/commit/d4f4983d7cf414b6ce583afe43c46da126cfa446) channelHandle is absent if user has not created a YouTube channel ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ytmusicapi/mixins/library.py` (+1 -1) </details> ### 📄 Description `get_account_info()` raises a KeyError if the user does not have a channel handle because they never created a YouTube channel. Seems like a perfect reason to use the handy `none_if_absent` flag :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:01:52 +03:00
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#657
No description provided.