3

I am trying to upload a video to Youtube using Youtube API v3 and python and I got the following error.

An HTTP error 401 occurred:

{  "error": {   "errors": [    {
    "domain": "youtube.header",
    "reason": "youtubeSignupRequired",
    "message": "Unauthorized",
    "locationType": "header",
    "location": "Authorization"    }   ],   "code": 401,   "message": "Unauthorized"  } }

I have created my project, created my Key and Client AOuth 2.0 and google console and downloaded the client_secrets.json.

The code I run is the one provided by Youtube API sample_code to download (here) for python.

If for example I try to do a search using the corresponding sample code and my credentials it works perfectly and I don't know why it doesn't work when I want to upload a vide.

Could you please letting me know what I am doing wrong, please?

Thanks in advance

Julius
  • 31
  • 1
  • 2

1 Answers1

6

YouTube Data API - Errors

unauthorized (401) youtubeSignupRequired This error indicates that the user has an unlinked Google Account, which means that the user has a Google Account but does not have a YouTube channel. Such users can access many features that are dependent on user authorization, such as rating videos or adding videos to a watch_later playlist. However, as an example, the user would need a YouTube channel to be able to upload a video. A user who has a Gmail account or an Android device is certain to have a Google Account but may not have already linked that Google Account to a YouTube channel.

This error is commonly seen if you try to use the OAuth 2.0 Service Account flow. YouTube does not support Service Accounts, and if you attempt to authenticate using a Service Account, you will get this error.

The YouTube API blog post introducing Google Account support also discusses the youtubeSignupRequired error in more detail. Although the blog post explains the error for API version 2.1, the meaning of the error is still applicable.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449