Hi team when I try to upload a video to the you tube using resumable upload using the code in C# .
I am getting an error message "The remote server returned an error: (410) Gone.".
Here is the code that we use to upload the video using C#.
var credentials = new GDataCredentials(_account, _password);
_authenticator = new ClientLoginAuthenticator("YouTubeUploader", ServiceNames.YouTube, credentials){DeveloperKey = _developerKey};
_resumableUploader = new ResumableUploader();
_resumableUploader.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(UlAsyncOperationCompleted);
_resumableUploader.AsyncOperationProgress += new AsyncOperationProgressEventHandler(UlAsyncOperationProgress);
var v = new Video
{
Title = "some title",
Description = "some description",
Keywords = "list of keywords separated by comma",
Private = false
};
v.Tags.Add(new MediaCategory("Entertainment"));
string contentType = MediaFileSource.GetContentTypeForFileName("Video file name");
v.MediaSource = new MediaFileSource("video file name", contentType);
// add the upload uri to it
var link =
{Rel = ResumableUploader.CreateMediaRelation};
v.YouTubeEntry.Links.Add(link);
XmlExtension unlistedAccessControlXmlExtension = CreateAccessControlXmlExtension("list", "denied");
XmlExtension noCommentAccessControlXmlExtension = CreateAccessControlXmlExtension("comment", "denied");
XmlExtension rat1 = CreateAccessControlXmlExtension("commentVote", "denied");
XmlExtension rat2 = CreateAccessControlXmlExtension("videoRespond", "denied");
XmlExtension rat3 = CreateAccessControlXmlExtension("rate", "denied");
v.YouTubeEntry.ExtensionElements.Add(rat1);
v.YouTubeEntry.ExtensionElements.Add(rat2);
v.YouTubeEntry.ExtensionElements.Add(rat3);
v.YouTubeEntry.ExtensionElements.Add(unlistedAccessControlXmlExtension);
v.YouTubeEntry.ExtensionElements.Add(noCommentAccessControlXmlExtension);
var info = new YouTubeFileInfo(desc.Id) { Status = YouTubeFileInfo.YouTubeFileStatus.Uploading, FileName = fileName };
_resumableUploader.InsertAsync(_authenticator, v.YouTubeEntry, data);
I think we are facing the issue because of change in the upload URL Version 2 to version 3.
Can you please help me provide an information regarding how to do the change code or the New URL for Version 3.
So that the video Uploads will be successful using the resumable uploads of Version 3.
Thanks in advance
Mahantesh N K