-1

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?

6
  • Please provide more information about the situation. How are you running this code, how are you testing it and details like error messages if any, it might be helpful if you can share your whole code as well. Commented Aug 18 at 6:38
  • I am running this code on AppScript: script.google.com Sample code: developers.google.com/youtube/v3/code_samples/… There is no error message. It is not updated the video snippet.defaultLanguage also. Commented Aug 20 at 3:45
  • Please edit your post to include these details. Commented Aug 20 at 8:52
  • There is not usage of defaultLanguage in the references that you gave, please provide your whole code if you can Commented Aug 20 at 8:56
  • upon searching defaultLanguage is a metadata Commented Aug 20 at 9:24

1 Answer 1

0

Use PUT https://www.googleapis.com/youtube/v3/videos. Using the Advanced YouTube Service, use YouTube.Videos.update(resource, part, optionalArgs)

Reference

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.