Skip to content

fix: tolerate searchEndpoint (hashtag) runs in artist description#959

Open
grray wants to merge 1 commit into
sigma67:mainfrom
grray:fix/description-hashtag-searchendpoint
Open

fix: tolerate searchEndpoint (hashtag) runs in artist description#959
grray wants to merge 1 commit into
sigma67:mainfrom
grray:fix/description-hashtag-searchendpoint

Conversation

@grray

@grray grray commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Describe the bug
Since #895, get_artist() raises KeyError for any artist whose description
contains a hashtag:

KeyError: "Unable to find 'urlEndpoint' using path ['navigationEndpoint',
'urlEndpoint', 'url'] on {'clickTrackingParams': '...', 'searchEndpoint':
{'query': '#1billboard', 'params': 'agIoAQ%3D%3D'}}, exception: 'urlEndpoint'"

To Reproduce
YTMusic().get_artist("UCRHts_o65erNP48E0j2qYkw") # Zacardi Cortez
YTMusic().get_artist("UCxFCRsIS2KxYg6LB5OIc4Rw") # Carolyn Arends

Both descriptions contain hashtags ("#1Billboard", "#canadianmusic").

Cause
parse_description_runs() assumes every run with a navigationEndpoint
contains an urlEndpoint, but hashtag runs contain a searchEndpoint instead.

Fix
Resolve the url with nav(..., none_if_absent=True) and fall back to a plain
text run when there is no url. Unit test included.

@sigma67

sigma67 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Could you please add a test that covers this case?

@grray
grray force-pushed the fix/description-hashtag-searchendpoint branch from 33fb01f to cda8385 Compare July 22, 2026 05:54
@grray

grray commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@sigma67 I've added the test. I hope I got everything right.

@sigma67

sigma67 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Thanks, it seems the failing tests are unrelated, I'll have to look at those separately first

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

Successfully merging this pull request may close these issues.

2 participants