From Claude...
Great, glad it's working! Just to summarise what the chain of issues was in case it's useful:
ytmusicapi.setup() was timing out due to a Brotli decompression issue — fixed by installing brotli
The HTTP request line (POST /youtubei/v1/browse... HTTP/3) was slipping through parse_headers into the headers dict because the request line strip happened after the early return
The early return was also returning the original headers_text instead of the cleaned lines, so the request line persisted even when headers were already formatted
Now make sure brotli is in your requirements.txt so it doesn't bite you again on a fresh install:
From Claude...
Great, glad it's working! Just to summarise what the chain of issues was in case it's useful:
ytmusicapi.setup() was timing out due to a Brotli decompression issue — fixed by installing brotli
The HTTP request line (POST /youtubei/v1/browse... HTTP/3) was slipping through parse_headers into the headers dict because the request line strip happened after the early return
The early return was also returning the original headers_text instead of the cleaned lines, so the request line persisted even when headers were already formatted
Now make sure brotli is in your requirements.txt so it doesn't bite you again on a fresh install: