I want to do the same thing, explained in this question, i.e change the language through the API
The goal is that the script edits the first field Video language
Youtube's UI for language edition
I tried with defaultLanguage
, to change value from fr-FR
instead of fr
.The link is created, but I still do not get the expected result. It changes the field Title and description language
Result
With defaultAudioLanguage
, nothing...
function createYouTubeLive(oauth2Service, title, description, scheduledStartTime) { var url = 'https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet,status,contentDetails'; var options = { method: 'post', contentType: 'application/json', headers: { Authorization: 'Bearer '+ oauth2Service.getAccessToken() }, payload: JSON.stringify({ snippet: { title: title, description: description, scheduledStartTime: scheduledStartTime, defaultLanguage: 'fr', defaultAudioLanguage: 'fr' }, status: { privacyStatus: 'unlisted', // public, unlisted, private selfDeclaredMadeForKids: false }, contentDetails: { enableAutoStart: true, enableAutoStop: true } }), muteHttpExceptions: true // Activer l'option pour capturer les erreurs HTTP }; var response = UrlFetchApp.fetch(url, options); return response;}