YouTube API v3.0 Class VideoReponse and ListRequest.

Using the first example found here https://developers.google.com/youtube/v3/code_samples/dotnet

for the API.Net YouTube 3.0, I am doing something very similar, but using a VideoResource object, not a SearchResource. Code from the example:

YoutubeService youtube = new YoutubeService(new BaseClientService.Initializer() { ApiKey = credentials.ApiKey }); SearchResource.ListRequest listRequest = youtube.Search.List("snippet"); listRequest.Q = CommandLine.RequestUserInput<string>("Search term: "); listRequest.Order = SearchResource.Order.Relevance; SearchListResponse searchResponse = listRequest.Fetch(); 

Note that after setting the fields in the ListRequest object, the Fetch () method is called to initialize the SearchListResponse object. However, this Fetch () method is not part of the API! What gives? Does anyone know how to do listrequest so that it returns a ListReponse object?

+4
source share
1 answer

Instead of using listRequest.Fetch(); try using listRequest.Execute();

0
source

Source: https://habr.com/ru/post/1486234/


All Articles