using the Google.YouTube.YouTubeRequest.Upload(Video v) api call then I get:
GDataRequestException with a response string "Metadata part is too large".
This direct upload call works on my personal development machine, but I get that exception on our QA machine.
any ideas?
EDIT here is the code: so the only metadata that is added is title,description and tags (same metadata on both machines and same video).
public void Add(InternalVideo video)
{
var youtubeVideo = ConvertVideo(video);
var v = _request.Upload(youtubeVideo);
}
private Video ConvertVideo(InternalVideo video)
{
var youTubeVideo = new Video();
youTubeVideo.Title = video.Title;
youTubeVideo.Description = video.Description;
AddTags(video, youTubeVideo);
string contentType = MediaFileSource.GetContentTypeForFileName(video.URL);
byte[] imageData = DownloadData(video.URL);
File.WriteAllBytes(_tempVideoFileName, imageData);
youTubeVideo.MediaSource = new MediaFileSource(_tempVideoFileName, contentType);
var link = new AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads");
link.Rel = ResumableUploader.CreateMediaRelation;
youTubeVideo.YouTubeEntry.Links.Add(link);
youTubeVideo.Private = false;
return youTubeVideo;
}
private void AddTags(InternalVideo video, Video youTubeVideo)
{
var category = video.Client.ClientSyndicationProviders[0].SyndicationProvider.Category;
youTubeVideo.Tags.Clear();
youTubeVideo.Tags.Add(new MediaCategory(category, YouTubeNameTable.CategorySchema));
youTubeVideo.Keywords = video.Tags;
}
EDIT 2: This code works: _resumableUploader = new ResumableUploader(25); WebResponse r = _resumableUploader.Insert(_youTubeAuthenticator, youtubeVideo.YouTubeEntry);
I'm not sure why I had to use the resumeable uploader to make this work. The only difference between machines is that that the QA machine is windows server 2003 R2, while the development machine is a windows 7 professional.