Monday, March 19, 2012

[YouTube-API] Re: Youtube batch process error. Missing parameter: username & video-id

Hello Manuel,

Are you sure that this code actually used to work? Because I just ran
it myself and used Wireshark to capture the HTTP batch request being
sent, and what it's doing is sending the entire contents of your
uploads feed as part of the batch update, even though you're only
intending to update a single video. You should only add the video(s)
that you want to update to to the batch request.

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Mar 15, 11:14 am, Manuel Gaviño <manueljesusgav...@gmail.com>
wrote:
> Hello,
>
> Around 3 week, we have a problem with our youtube batch process. We use
> this batch process to massive update our metadata´s videos.
>
> We use the java api gdata-1.46. If we use the individual video update, we
> checked that it work fine.
>
> This is the thrown exception:
>
> Error in custom provider,
> com.google.youtube.frontend.gdata.common.WrappedServiceException:
> com.google.gdata.provider.InvalidRequestUriException: Missing required
> parameter:username
>   at
> com.google.youtube.frontend.gdata.inject.ParameterBindingBuilder.in(Paramet erBindingBuilder.java:63)
>   at
> com.google.youtube.frontend.gdata.inject.ParameterBindingBuilder.in(Paramet erBindingBuilder.java:63)
>   while locating com.google.youtube.backend.rosy.proto.UserRefData$UserRef
> annotated with
> @com.google.youtube.frontend.gdata.inject.ParameterValue(value=username)
>     for parameter 3 at
> com.google.youtube.frontend.gdata.feeds.UserVideoBatchGetAction.<init>(User VideoGetAction.java:118)
>   while locating
> com.google.youtube.frontend.gdata.feeds.UserVideoBatchGetAction
>   while locating
> com.google.youtube.frontend.gdata.common.action.GetAction<com.google.gdata. model.youtube.VideoEntry>
> annotated with interface
> com.google.youtube.frontend.gdata.feeds.BatchVideoGetActionAnnotation
>
> Error in custom provider,
> com.google.youtube.frontend.gdata.common.WrappedServiceException:
> com.google.gdata.provider.InvalidRequestUriException: Missing required
> parameter:video-id
>   at
> com.google.youtube.frontend.gdata.inject.ParameterBindingBuilder.in(Paramet erBindingBuilder.java:63)
>   at
> com.google.youtube.frontend.gdata.inject.ParameterBindingBuilder.in(Paramet erBindingBuilder.java:63)
>   while locating com.google.youtube.model.VideoId annotated with
> @com.google.youtube.frontend.gdata.inject.ParameterValue(value=video-id)
>     for parameter 4 at
> com.google.youtube.frontend.gdata.feeds.UserVideoBatchGetAction.<init>(User VideoGetAction.java:118)
>   while locating
> com.google.youtube.frontend.gdata.feeds.UserVideoBatchGetAction
>   while locating
> com.google.youtube.frontend.gdata.common.action.GetAction<com.google.gdata. model.youtube.VideoEntry>
> annotated with interface
> com.google.youtube.frontend.gdata.feeds.BatchVideoGetActionAnnotation
>
> This is me JUnit code:
>
> YouTubeService service = new YouTubeService(applicationId, developerKey);
> service.setUserCredentials(username, password);
>
> VideoEntry videoEntry = service.getEntry(new
> URL("http://gdata.youtube.com/feeds/api/users/default/uploads/" + videoId),
> VideoEntry.class);
>
> YouTubeMediaGroup mediaGroup = videoEntry.getOrCreateMediaGroup();
> mediaGroup.setTitle(new MediaTitle());
> mediaGroup.getTitle().setPlainTextContent("Title Test");
>
> VideoFeed feed = service.getFeed(new
> URL("http://gdata.youtube.com/feeds/api/users/default/uploads"),
> VideoFeed.class);
>
> BatchUtils.setBatchId(videoEntry, "A");
> BatchUtils.setBatchOperationType(videoEntry, BatchOperationType.UPDATE);
> feed.getEntries().add(videoEntry);
>
> VideoFeed batchResponse = service.batch(new
> URL(feed.getFeedBatchLink().getHref()), feed);
>
> Any idea?
>
> Thanks for any solutions
>
> Regards

--
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