mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #777] ytmusicapi oauth CLI fails in non-interactive environments (EOFError on input()) #494
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#494
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RomanOnARiver on GitHub (Jun 15, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/777
Describe the bug
When running
ytmusicapi oauthas a background subprocess (such as from a GUI app), the CLI requires the user to "press Enter" after device code authentication. This usesinput(), which fails in non-interactive environments and raisesEOFError, preventingoauth.jsonfrom being written.This makes it impossible to automate authentication from a GUI or headless script.
ytmusicapi version
1.10.3
To Reproduce
Steps to reproduce the behavior:
ytmusicapi oauth --client-id ... --client-secret ... --file ...as a subprocess with no interactive stdin (for example, from a Python script or GUI application).Go to https://www.google.com/device?user_code=XXXX-XXXX-XXXX, finish the login flow and press Enter when done, Ctrl-C to abort
Traceback (most recent call last):
...
EOFError: EOF when reading a line
oauth.jsonfile is not created.Additional context
This blocks any attempt to automate the authentication flow in GUI apps or scripts.
Feature request: Please add a CLI flag (such as
--no-confirmor--non-interactive) to allow the CLI to complete without waiting for user input after device login, or skip the input prompt in non-interactive environments.@sigma67 commented on GitHub (Jun 16, 2025):
PR welcome