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, categoryId: video.snippet.categoryId, defaultLanguage: video.snippet.defaultLanguage }, 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?
snippet.defaultLanguagealso.defaultLanguageis a metadata