[GH-ISSUE #321] Headers failing check_header_validity in utils.py #248

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

Originally created by @notaSWE on GitHub (Nov 30, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/321

Hello, when I follow the instructions in Firefox to find a POST yielding 200 OK response with the headers, I then right click and copy all and save to headers.json. When I try to actually use ytmusicapi, the headers appear to fail the check_header_validity in utils.py. Note, this is the beginning of my headers.json file - is it correct? Note, it works fine when I pipe to jq.

{
	"Request Headers (2.466 kB)": {
		"headers": [
			{
				"name": "Accept",
				"value": "*/*"
			},
			{
				...
			}
		]
	}
}

Error message is:
must be of type str or bytes, not <class 'dict'>

Originally created by @notaSWE on GitHub (Nov 30, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/321 Hello, when I follow the instructions in Firefox to find a POST yielding 200 OK response with the headers, I then right click and copy all and save to headers.json. When I try to actually use ytmusicapi, the headers appear to fail the check_header_validity in utils.py. Note, this is the beginning of my headers.json file - is it correct? Note, it works fine when I pipe to jq. ``` { "Request Headers (2.466 kB)": { "headers": [ { "name": "Accept", "value": "*/*" }, { ... } ] } } ``` Error message is: must be of type str or bytes, not <class 'dict'>
kerem closed this issue 2026-02-27 22:08:48 +03:00
Author
Owner

@notaSWE commented on GitHub (Nov 30, 2022):

For other people who have this issue, just read through the Setup documentation and you'll get it working!

https://ytmusicapi.readthedocs.io/en/latest/setup.html

<!-- gh-comment-id:1332653724 --> @notaSWE commented on GitHub (Nov 30, 2022): For other people who have this issue, just read through the Setup documentation and you'll get it working! https://ytmusicapi.readthedocs.io/en/latest/setup.html
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#248
No description provided.