One potential source of 403 response errors is quota issues. You
didn't share what the error in the body of your HTTP 403 response is,
so I can't tell you whether that's what it is for sure, but it sounds
likely based on what you describe. You can read more about our quota
system at
http://apiblog.youtube.com/2010/02/best-practices-for-avoiding-quota.html
Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev
On Feb 29, 4:52 am, Ajitpal Singh <ajit.kam...@gmail.com> wrote:
> Hello all,
> I'm using YouTube API to upload video to the YouTube sever.
> The video uploading shows the progress of 100% and then it give error as "*The
> remote server returned an error: (403) Forbidden*". I'm using .net 3.5
> framework. If i'm using a windows form to upload the video, the video
> upload successfully but if i'm using windows service it give error after
> showing progress of 100%. Does anybody has face those issue. could any one
> explain how to resolve this issue.
>
> Code:
> Video newVideo = new Video();
> newVideo.Title = "TestFeed";
> newVideo.Tags.Add(new MediaCategory("Tech",
> YouTubeNameTable.CategorySchema));
> newVideo.Keywords = "TestFeed";
> newVideo.Description = "TestFeed_";
> newVideo.YouTubeEntry.Private = false;
> newVideo.YouTubeEntry.setYouTubeExtension("location", "Delhi, India");
> newVideo.YouTubeEntry.MediaSource = new
> MediaFileSource(@"E:\Publish\mp4\TestFeed_137_52_512.mp4", "video/mp4");
>
> AtomLink link = new
> AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/" +
> "YTUser_Name" + "/uploads");
> link.Rel = ResumableUploader.CreateMediaRelation;
> newVideo.YouTubeEntry.Links.Add(link);
>
> GDataCredentials Credentails = new GDataCredentials(Username,
> Password);
> string AppName = Application.ProductName;
> ClientLoginAuthenticator cAuth = new
> ClientLoginAuthenticator(AppName, ServiceNames.YouTube, Credentails);
> cAuth.DeveloperKey = DeveloperKey;
>
> ResumableUploader RSUpload = new ResumableUploader(10);
> RSUpload.AsyncOperationCompleted += new
> AsyncOperationCompletedEventHandler(RSUpload_AsyncOperationCompleted);
> RSUpload.AsyncOperationProgress += new
> AsyncOperationProgressEventHandler(RSUpload_AsyncOperationProgress);
>
> UserState State = new UserState();
> State.RetryCounter = 0;
>
> RSUpload.InsertAsync(cAuth, newVideo.YouTubeEntry, State);
>
> void RSUpload_AsyncOperationCompleted(object sender,
> AsyncOperationCompletedEventArgs e)
> {
> if (e != null)
> {
> UserState u = e.UserState as UserState;
>
> if (u != null)
> {
> if (e.Cancelled)
> {
>
> }
> //After complete uploading video always stuck here....
> else if (e.Error != null)
> {
> console.writeLine("Error - " + e.error.toString());
> }
> else
> {
> console.writeLine("Uploaded!!!!");
>
> }
> }}
>
> Thanks,
> Ajitpal Singh
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
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