1

Everytime i try to use the youtube api i get this error:

The remote server returned an error: (401) Unauthorized.

on this code:

public static YouTubeRequest AuthRequest()
    {
        YouTubeRequestSettings Setting =
            new YouTubeRequestSettings("app", "key", "email", "pass");
        Setting.Timeout = 99999999;
        YouTubeRequest _request = new YouTubeRequest(Setting);
        return _request;
    }

i acquired the key here : http://code.google.com/apis/youtube/dashboard

and the email and password, i checked a few times and they are working fine.

i also registered my application here : https://code.google.com/apis/console

but everytime i try to use the request i get the error, what is the problem? Thanks

Wahtever
  • 3,597
  • 10
  • 44
  • 79

1 Answers1

0

I can't leave comments, and you didn't mention this, but did you replace "app" with the name of your application in the YouTubeRequestSettings constructor method? Leaving the code as "app" would prevent access.

Edit: I took a look at the .NET page for the YouTube API and I couldn't find the constructor you are using. The only constructors that they list are:

  • YouTubeRequestSettings("example app", clientID, developerKey)
  • YouTubeRequestSettings("example app", clientID, developerKey, (String) SessionToken)
  • YouTubeRequestSettings("example app", clientID, developerKey, username, password)
  • YouTubeRequestSettings("NETUnittests", this.ytClient, this.ytDevKey, this.ytUser, this.ytPwd)
GibsonCode
  • 89
  • 2
  • 13