PR

3 YouTube API OAuth Pitfalls for Solo Creators, and How to Fix Them

3 YouTube API OAuth Pitfalls for Solo Creators, and How to Fix Them YouTube Auto-Upload for Solo Creators
記事内に広告が含まれています。

When people try to automate their YouTube uploads, most of them stop before a single video is sent. The cause is not the code. It is the sign-in setup in Google Cloud. This article covers the three places where solo creators get stuck and how to get past each one, based on the setup guide and troubleshooting guide included in the YouTube Auto-Upload Builder Pack for Solo Creators. Screen names are as of November 2026, and Google can change them.

1. The Permission Step That Comes Before Any Upload

To upload a video from a program, you use the YouTube Data API v3. An API is the official door that lets a program operate a service in place of a person clicking in a browser. Before a program can use that door, Google has to issue a key that says “this program on this computer is allowed to upload.” The system behind that permission is OAuth, a way to give a program permission to act on your account without handing it your password.

Only three things are involved.

Term In plain words
Google Cloud project A free “workspace” you need in order to use an API
OAuth client (client_secret.json) An ID card that tells Google “I made this program”
Token (token.json) A permit that says “I allowed uploads to this channel.” It is created automatically at your first sign-in

The setup has six steps: create a project, enable the API, configure the OAuth consent screen, create the client, put the downloaded file in place, and sign in for the first time. The setup guide says to allow 20 to 30 minutes (an estimate), and it costs nothing. No credit card is required.

One naming note saves confusion. The settings that used to be called the “OAuth consent screen” now live under a menu called “Google Auth Platform.” If a tutorial you are following shows different menu names, this is probably why. The console changes from time to time, so if a name is slightly different on your screen, look for the closest match.

the documents included in the pack and what each one is for, including the Google Cloud setup guide and the troubleshooting guide
the documents included in the pack and what each one is for, including the Google Cloud setup guide and the troubleshooting guide

2. Pitfall 1: You Did Not Add Yourself as a Test User

At the first sign-in, the browser can stop you with these two messages:

Access blocked: (app name) has not completed the Google verification process
Error 403: access_denied

The cause is that the Google account you tried to sign in with is not registered as a test user. A newly created app is in “Testing” status, and while an app is in Testing, only Google accounts registered as test users can sign in. That includes you, the person who created the app.

The fix:

  1. In the left menu of the Google Auth Platform, open “Audience.”
  2. Check that “Publishing status” says “Testing.”
  3. Under “Test users,” click “Add users.”
  4. Enter the email address of the Google account that manages your channel, and save.

If the account that manages the channel is different from the account you use for Google Cloud, add the address of the account that manages the channel. That is the one that will sign in.

Two related points come up on the same screens.

First, when you create the consent screen, choose “External” for the audience. “Internal” is only for Google Workspace accounts (company or school), and it cannot be selected with a regular Gmail account.

Second, partway through the sign-in you will see a screen that says “Google hasn’t verified this app.” It appears for an app you created yourself in Testing status, and it is not a sign of a problem. Check that the app name shown is the one you entered, click “Advanced,” then “Go to (app name).”

The console also has a “Data Access” page where you can add scopes (the range of permissions). You can skip it. The script requests the permissions it needs at run time.

3. Pitfall 2: The Client Type Is Not “Desktop app”

When you create the OAuth client, one screen asks for the “Application type.” Choose “Desktop app.” The script does not work if you choose “Web application.” It is a program that runs on your own computer, so “Desktop app” is the type that matches.

On the confirmation dialog, click “Download JSON” right then. Once you close that dialog, you may not be able to view the client secret again. If you miss it, nothing is broken: delete the client and create a new one.

Then put the file in place:

  1. Inside your project folder (the one that contains upload_youtube.py), create a folder named secrets.
  2. Move the downloaded file into it. It has a long name that starts with client_secret_.
  3. Rename it to client_secret.json.

On Windows there is a small trap here. If file extensions are hidden, renaming the file can actually produce client_secret.json.json. Turn on “View” > “File name extensions” in File Explorer to check. If a copy of the file is still in your Downloads folder, delete it to be safe.

You can confirm the file is in the right place with a dry run, a rehearsal that validates your files and settings and sends nothing. You run it in a terminal, the text window where you type commands instead of clicking:

python upload_youtube.py --dir videos/2030-01-31_weekend_camp_vlog --dry-run

If the file is missing, the dry run says so:

  [ERROR] secrets/client_secret.json is missing (required for a real upload)

The check then ends with a line that starts with -> NG. NG (no good) means there is at least one error to fix before uploading. Once every error is fixed, the last line starts with -> OK: no errors.

the pre-flight check lists the reasons for NG, and after the fixes it ends in OK: no errors
the pre-flight check lists the reasons for NG, and after the fixes it ends in OK: no errors

The dry run does not call the API. It needs no sign-in, and it uses no quota (quota is the daily cap on how much you can use the API). It only checks whether the credential file exists. It does not open the file or print what is in it.

4. Pitfall 3: The Token Expires After 7 Days

This is the one that confuses people most, because nothing looked wrong. The workflow ran last week. Today the same command stops with this:

[ABORTED] The saved token has expired and could not be refreshed.
Sign in again with these steps:
  1. Delete secrets/token.json
       Windows (PowerShell): Remove-Item secrets\token.json
       macOS / Linux       : rm secrets/token.json
  2. Run the same command again and sign in through the browser
  Note: while the OAuth app's publishing status is 'Testing', the token expires after 7 days.

While the app is in Testing status, the authorization (the token) expires 7 days after you sign in. This is how Google designed it, not a fault in your setup. No video has been uploaded at that point, so there is nothing to undo.

The fix is what the message says: delete secrets/token.json and run the same command again. Delete token.json only. Do not delete client_secret.json. The troubleshooting guide puts the weekly re-sign-in at roughly a minute (an estimate).

If you want to stop signing in every week, there is an option. In the Google Auth Platform, open “Audience” and click “Publish app” to change the publishing status to “In production.” The 7-day limit no longer applies. After the change, delete token.json once and sign in again. Understand the following before you use it:

  • “In production” lets Google accounts other than your test users reach the sign-in screen. They still cannot use the app without client_secret.json, so as long as you keep that file safe, you remain the only person who can use it.
  • The app is still unverified, so the “Google hasn’t verified this app” warning keeps appearing at sign-in.
  • How Google treats unverified apps depends on its policies, which can change. The decision is yours to make.

If signing in again about once a week is not a problem for you, staying in Testing status is the simplest choice.

5. Credential Files Are Keys: Keep Them From AI and Third Parties

With client_secret.json and token.json in hand, a person can post to your channel. Treat both files as keys, and do not give them to an AI or to any third party. Three habits cover most of it:

  • Put client_secret.json into the secrets/ folder yourself. Do not have an AI agent do it for you.
  • Do not paste the contents of either file into an AI chat, social media, a help forum, or a public repository.
  • When you ask for help with an error, share the error message only, not the file contents.

If you think you have already pasted one somewhere, act right away:

  1. In the Google Cloud Console, under “Clients” (or “Credentials”), delete the OAuth client.
  2. Create a new OAuth client and replace secrets/client_secret.json.
  3. Delete secrets/token.json.
  4. In your Google Account, go to “Security” > “Your connections to third-party apps & services” and remove the app’s access.

If the files were committed to a public repository, removing them is not enough, because they stay in the history. Do the first three steps anyway.

6. How Far the Builder Pack Guides You

The YouTube Auto-Upload Builder Pack for Solo Creators includes two documents that cover everything above:

  • docs/setup_google_cloud_en.md: Steps 1 to 6, with a checklist at the end
  • docs/troubleshooting_en.md: 15 topics, including the expired token, “Access blocked,” the thumbnail 403 error, quota limits, and what to do if you may have leaked your credentials

It also includes a master prompt (8 safety rules, Steps 0 to 8) that you paste into an AI coding agent such as Claude Code or Cursor. Two parts of it matter for this article. Step 2 has the agent set up a rule that keeps it from reading anything under secrets/. Step 4 is the Google Cloud setup, and the prompt makes that your work: the agent walks you through the guide, waits for you to report that you are done, and checks only that the file exists.

the step headings of the master prompt, Step 0 to Step 8, where Step 2 protects the credentials and Step 4 is the Google Cloud setup
the step headings of the master prompt, Step 0 to Step 8, where Step 2 protects the credentials and Step 4 is the Google Cloud setup

Here is what was and was not checked. Video upload and scheduling were confirmed by uploading private test videos through the live YouTube API, on Windows. Those tests ran with a saved token that was still valid. As a result, the first-time browser sign-in and the expired-token message are implemented, not verified against the live API. The steps in this article come from the included guides and from the messages in the script itself.

The pack does not click through the Google Cloud Console for you. You do that part yourself, with the guide open next to the browser.

7. Summary and Related Articles

  • If you see “Access blocked,” add your own account as a test user
  • Choose “Desktop app” as the client type, and download the JSON file before you close the dialog
  • Stopping after 7 days is by design. Delete token.json and sign in again
  • The credential files are keys. Do not give them to an AI or to any third party

Related articles:

Product page (Gumroad): https://ainavi.gumroad.com/l/youtube-auto-upload-builder-pack-solo

It is a builder pack with no support, a personal license for one person, $19 one-time. The README says to allow 30 to 60 minutes for first-time setup if you are new to Google Cloud (an estimate), and the pack is meant for people who are comfortable with an AI coding agent and basic terminal commands.

コメント

タイトルとURLをコピーしました