2

I am writing a PHP CLI script that will upload videos to my Youtube channel. I created a project in Google Console, enabled Youtube API, enabled OAuth and received my client ID and secret. Then I generated a refresh token using https://developers.google.com/oauthplayground .

The authentication seems to work as I don't get any errors regarding that, but I get the following error:

"code": 403,
"message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e."

The credentials are for a new project where I didn't use anything from the quota.

Why do I get this error and how could I fix it?

George Olah
  • 577
  • 5
  • 16
  • What kind of request are you making? Are you sure you've properly provided the correct parameters? Sometimes Youtube says quota exceeded instead of pointing out the wrong section of your request. – ReyAnthonyRenacia Jul 19 '17 at 20:12
  • 1
    I mananged to make it work if I use oauth from my browser and I manually accept it, but not if i generate the access token from the playground. The code is exactly the same, the access token is the only difference. – George Olah Jul 21 '17 at 08:34
  • Maybe you can start by comparing the scopes – ReyAnthonyRenacia Jul 21 '17 at 09:32

1 Answers1

1

I think you're right @GeorgeOlah. I didn't want to waste time setting up OAuth2 stuff, so I generated a key with the playground and then tried to use it with https://github.com/h2non/youtube-video-api.

I immediately got quota errors using the access token from the playground.

So I setup a token using https://github.com/google/google-api-nodejs-client/blob/1bcb74430143e498b9fd58cf2ca2b97da2ed3b07/samples/oauth2.js.

So far, I've had no quota errors with that token.

Luqmaan
  • 2,052
  • 27
  • 34