[GH-ISSUE #135] NameError: name 'headers_auth' is not defined #99

Closed
opened 2026-02-27 22:08:00 +03:00 by kerem · 2 comments
Owner

Originally created by @bretterballz on GitHub (Dec 29, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/135

Trying to authenticate requests, but when doing YTMusic.setup(filepath=headers_auth.json)
I get
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'headers_auth' is not defined
I apologize, I'm a newb and just trying to get https://github.com/KoljaWindeler/ytube_music_player to work. I'm using Python 3.9 (64bit).

Any help to point me in the right direction would be appreciated!

Thanks.

Originally created by @bretterballz on GitHub (Dec 29, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/135 Trying to authenticate requests, but when doing `YTMusic.setup(filepath=headers_auth.json)` I get `Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'headers_auth' is not defined` I apologize, I'm a newb and just trying to get https://github.com/KoljaWindeler/ytube_music_player to work. I'm using Python 3.9 (64bit). Any help to point me in the right direction would be appreciated! Thanks.
kerem closed this issue 2026-02-27 22:08:00 +03:00
Author
Owner

@harrytouche commented on GitHub (Dec 30, 2020):

It looks to me like you're trying to pass headers_auth.json as a variable. Try wrapping it in some quotes to reference a string, and make sure the file is in your working directory

So
YTMusic.setup(filepath=headers_auth.json)
Becomes
YTMusic.setup(filepath="headers_auth.json")

<!-- gh-comment-id:752456148 --> @harrytouche commented on GitHub (Dec 30, 2020): It looks to me like you're trying to pass `headers_auth.json` as a variable. Try wrapping it in some quotes to reference a string, and make sure the file is in your working directory So `YTMusic.setup(filepath=headers_auth.json)` Becomes `YTMusic.setup(filepath="headers_auth.json")`
Author
Owner

@sigma67 commented on GitHub (Dec 30, 2020):

Yes, you need to wrap in quotes since the filepath is provided as a string.

Please use Gitter for further questions if possible: https://gitter.im/sigma67/ytmusicapi/

<!-- gh-comment-id:752645874 --> @sigma67 commented on GitHub (Dec 30, 2020): Yes, you need to wrap in quotes since the filepath is provided as a string. Please use Gitter for further questions if possible: https://gitter.im/sigma67/ytmusicapi/
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#99
No description provided.