Skip to content

youtube videos/comments list are API-key-only, don't honor --account (OAuth) #664

@BRO3886

Description

@BRO3886

The --mine reads (activities, playlists, channels) authenticate via OAuth through getYouTubeServiceForAccount when --account is passed. But videos list and comments list only call getYouTubeServiceWithAPIKey, so --account doesn't work for them:

$ gog yt videos list --id <id> --account me@gmail.com
YouTube API key required: set config youtube_api_key KEY or GOG_YOUTUBE_API_KEY

Why it matters: YouTubeVideosListCmd.Run already requests []string{"snippet", "contentDetails", "statistics"}, so view/like/comment counts are right there — but a user authenticated via --account with no API key configured can't retrieve them at all.

Question: is the API-key-only path intentional for public catalog reads, or should videos/comments accept --account too, the way the --mine commands already do?

if flags.Account != "" {
    svc, err = getYouTubeServiceForAccount(ctx, flags.Account)
} else {
    svc, err = getYouTubeServiceWithAPIKey(ctx)
}

Happy to send a PR adding that branch to YouTubeVideosListCmd.Run and YouTubeCommentsListCmd.Run. (Related: I'm adding --account support to a new search command in #650, currently open — this would keep public reads consistent with that.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions