Tuesday, May 1, 2012

[YouTube-API] upload vedio to youtube throw .net

while trying to upload vedio to youtube i got "The remote server returned an error: (403) Forbidden."

please review below my code:
 
YouTubeRequestSettings settings =
                      new YouTubeRequestSettings(ProjectName, DevKey
                          , GmailEmail, Pwd);

            YouTubeRequest request = new YouTubeRequest(settings);
            Video newVideo = new Video();
            newVideo.Title = "My Test Movie";
            newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));

            newVideo.Keywords = "cars, funny";
            newVideo.Description = "My description";
            newVideo.YouTubeEntry.Private = false;
            newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag",
            YouTubeNameTable.DeveloperTagSchema));
            //newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);             // alternatively, you could just specify a descriptive string             // newVideo.YouTubeEntry.setYouTubeExtension("location", "Mountain View, CA");
            newVideo.YouTubeEntry.MediaSource = new MediaFileSource(flUpload.FileContent, flUpload.FileName, GetFileMime("avi"));
 
Please Help

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/YZNlAEVOmHAJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment