Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This page describes how to configure the YouTube Service to upload videos to YouTube and delete videos from YouTube. Two steps are required, namely Google configuration and Digizuite configuration. Be aware of the limitations and important knowledge.

Google Configuration

Some preliminary configuration must be done with Google:

  1. Go to https://console.developers.google.com/, and make sure that you are logged in with the Google account that videos should be uploaded with.

  2. If you don’t already have a project, create a new project. Ensure that the appropriate project is selected in the top menu.

  3. Enable “YouTube Data API v3” for the project.

    1. Select “Library” in the left menu.

    2. Search for “YouTube Data API v3”.

    3. Select the search result and enable the API.

  4. Setup an OAuth Consent Screen.

    1. In the left menu, select “OAuth Consent Screen”.

    2. Give the application a name.

    3. In “Authorized Domains” enter the domain of the DAM Center installation. Google can figure out the domain part, if you are unsure. Thus, if the DAM Center is installed at e.g. “mm-dam.dev.digizuite.com”, you can enter this.

    4. Save.

  5. Create credentials.

    1. In the left menu, select “Credentials”.

    2. Click “Create Credentials” in the top menu, and choose “OAuth Client ID” (see image below).

    3. Choose “Web application”.

    4. Give the web application a name.

    5. In “Authorized redirect URIs” enter: “<YOUR_DAM>/DigizuiteCore/YoutubeService/api/v1/YoutubeClients/OAuth2Callback”. E.g. if the DAM Center has been installed at “https://mm-dam.dev.digizuite.com”, the entry should be: “https://mm-dam.dev.digizuite.com/DigizuiteCore/YoutubeService/api/v1/YoutubeClients/OAuth2Callback”. NOTE: It is important that the DAM Center installation is the same that was registered in step 4.c.

    6. Create the credentials.

    7. You have now obtained a ClientId and a ClientSecret. If they aren’t immediately visible, they can be found by clicking the newly created entry in “OAuth 2.0 Client IDs” in the “Credentials” section. These will be needed later.

Digizuite Configuration

YouTube channel creation

A specific channel for videos should be created in the DAM Center. If you already have the ChannelId of the channel to use, you can skip this step.

  1. Go to the DAM Center used in the configuration above.

  2. In “Channels”, create a new folder by right-clicking the channels area.

  3. Give the channel a name. E.g. “YouTube”.

  4. The ChannelId will be needed in a moment. This can be found by right-clicking the created channel, and selecting “Edit folder rights” (see image below).

YouTube client creation

A YouTube client can now be created in MM5.

Firstly, make sure that you are logged in with a user that has the “Youtube_Admin” role. Administrators have this role by default.

Then, click the “Settings” icon on the top-right corner. Select “YouTube”, and create a new YouTube client. The ClientID, ClientSecret, and ChannelId from the configuration above will be needed here. There are two parameters with default values:

  1. Search Name. The name of the search used to fetch the title and description of an asset. By default, the “GetYoutubeInformation” search is used, which fetches the standard asset title and description. A custom search can be created and used, or the “GetYoutubeInformation” can be customized. See below for more information.

  2. Default Privacy Status. The default privacy status to use when uploading videos to YouTube. By default, this is set to “private”. Other possible values are “public” and “unlisted”. See https://support.google.com/youtube/answer/157177?co=GENIE.Platform%3DDesktop&hl=en for more information.

Once a YouTube client has been created, videos will automatically be uploaded to YouTube, when they are published to the created YouTube channel. A video, which has been published to the YouTube channel in the DAM Center and has been successfully uploaded, will be deleted from YouTube if it is either deleted from the DAM Center or unpublished.

Thus, videos can be uploaded to YouTube by simply dragging them to the YouTube channel in the DAM Center. Once they have been successfully uploaded, they can be deleted from YouTube again by unpublishing them from the YouTube channel in the DAM Center.

Search configuration

This step is optional.

As mentioned above, it is possible to configure the search used for retrieving information about a video when uploading it. By default, the “GetYoutubeInformation” search is used, and this search fetches the title and the description of the asset by default.

It is possible to also fetch to privacy status when uploading an asset. This will override the default privacy status on the assets where it is set. This can be done with the following steps:

  1. In the DAM Center, find the “GetYoutubeInformation” search for the DAM Center in the ConfigManager.

  2. Add an output field with id “privacyStatus”. The field could for instance be a ComboValue with the options “private”, “unlisted”, and “public”. Be aware that the privacy status from the search is ignored if it is invalid. The default privacy status is used as a fallback.

  3. Save the search.

It is now possible to set the privacy status for each asset.

The “GetYoutubeInformation” search can be freely configured. However, the search must include at least two output fields with ids:

  1. “title”

  2. “description”

Limitations

The YouTube Service has the following limitations:

  • A video is not necessarily uploaded completely to YouTube when it appears as published to the YouTube channel in the DAM Center. Thus, the green check-mark in the DAM Center does not reflect the upload status. A consequence of this is that unpublishing a video from the YouTube channel in the DAM Center immediately after it has been published might not prevent the video from being uploaded.

  • If something goes wrong while a video is being uploaded, the upload will automatically be retried. However, this might result in some failed “ghost” videos appearing in YouTube. These failed videos will not be visible for others, and they can safely be manually deleted.

  • Republishing a video in the YouTube channel in the DAM Center has no effect on YouTube. If the video should be uploaded again, a workaround is to unpublish and then publish the video.

  • When a video has been uploaded to YouTube with the YouTube Service, changes to the video metadata in the DAM Center does not affect the uploaded video. Thus, changing e.g. the description of an uploaded video in the DAM Center does not change the description on YouTube. Similarly, changing the video description from YouTube Studio does not change the description in the DAM Center.

  • Replacing a video that has been uploaded to YouTube with the YouTube Service does not replace the video on YouTube. A workaround is to unpublish the video from the YouTube channel, replace it, and then publish it to the YouTube channel again.

Important knowledge

  • At most 1 YouTube client should be created per ClientId from Google.

  • All non-recoverable errors are collected in the error queue “YoutubeService.error” in RabbitMQ.

  • Videos uploaded with the YouTube Service should also be deleted with the YouTube Service by unpublishing or deleting the video in the DAM Center. If a video is manually deleted from YouTube, and it is then unpublished or deleted in the DAM Center, and error will be recorded in the error queue in RabbitMQ.

  • Google has a “Quota” system that limits the number of calls to their APIs. For a new project, the default limit is 10,000 per day for the YouTube API, which amounts to approximately 6 video uploads per day. It is possible to apply for a higher limit from https://console.developers.google.com/apis/api/youtube/quotas. If the limit is reached when trying to upload a video, the upload will end up in the error queue in RabbitMQ, from where it can be retried. It is, of course, also always possible to retry an upload by unpublishing and publishing the video again.

  • No labels