[GH-ISSUE #5] UnicodeEncodeError: 'latin-1' codec can't encode characters in position 12-13 #5

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

Originally created by @ccyang2019 on GitHub (Apr 13, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/5

a little issue at request body which is not default Latin-1 encoded.
add body = body.encode(encoding='utf-8') after line 453 of ytmusic.py could solve my problem.

Originally created by @ccyang2019 on GitHub (Apr 13, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/5 a little issue at request body which is not default `Latin-1` encoded. add `body = body.encode(encoding='utf-8')` after line 453 of ytmusic.py could solve my problem.
kerem 2026-02-27 22:07:29 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sigma67 commented on GitHub (Apr 13, 2020):

Thanks for the report. It seems this is only the case when a string is passed to the requests parameter data, so the other functions using json are not affected.

<!-- gh-comment-id:613052680 --> @sigma67 commented on GitHub (Apr 13, 2020): Thanks for the report. It seems this is only the case when a string is passed to the requests parameter `data`, so the other functions using `json` are not affected.
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#5
No description provided.