Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How to change snippet.defaultLanguage of YouTube Video using API

$
0
0

I am using YouTube Data API Reference to change Video.snippet.defaultLanguage (https://developers.google.com/youtube/v3/docs/videos#snippet.defaultLanguage) using the following API call

        var resource = {          snippet: {            title: video.snippet.title,            description : video.snippet.description,            defaultLanguage: 'en-IN',            categoryId: video.snippet.categoryId          },          id: video.id,          localizations,        };        YouTube.Videos.update(resource, 'id,snippet,localizations');

I got the above code from the Youtube API Samples example (https://github.com/youtube/api-samples/blob/07263305b59a7c3275bc7e925f9ce6cabf774022/apps-script/youtube.gs#L107)

Form trial and error, I understood that title and categoryId is important even though its irrelevant here.

I have also looked at similar code given by others in GitHub (https://github.com/search?q=language%3AJavaScript+YouTube.Videos.update&type=code), but unable to get a correct API call.

From the documentation, snippet.defaultLanguage is "the language of the text in the video resource's snippet.title and snippet.description properties.". So, it can't be set?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>