Search code examples
pythonpython-3.xyoutubeyoutube-apiyoutube-data-api

How to set video language when uploading to YouTube with Python API client


I am uploading videos to YouTube programmatically following the official guide:

  body=dict(
    snippet=dict(
      title=title,
      description=description,
      tags=tags,
    ),
    status=dict(
      privacyStatus="public"
    )
  )

I can upload the video, set the title, the description, and upload a thumbnail. The setting "Made for kids" comes from the channel's default.

But the video's language does not come from the channel's default, so I want to set it programmatically. On the web interface, it looks like this:

upload language settings

I would also like to set programmatically other options in the web interface, such as:

  • altered content
  • Allow automatic chapters and key moments
  • Allow automatic concepts
  • Don't allow remixing

How can I set these additional options during or after the upload with the Python API client?

Update

I tried defaultLanguage="fr-FR" in snippet and it sets the title and description language, not the video language:

language setting from the API

I also tried defaultLanguage="fr" in snippet and I get the same result.


Solution

  • For me it worked when adding "defaultAudioLanguage" to the correct language.