1
votes

I would like to add thumbnail images to YouTube channels using YouTube API (V3).

For example: The image at the top left corner found here: https://www.youtube.com/channel/UCO7KVucOJgWRuE9P4mrv8yw

Listing channel resources: https://developers.google.com/youtube/v3/docs/channels/list

The path to thumbnail Images are stored in the channel snippet

"snippet": {
"title": "HannahInJapana",
"description": "My name is Hannah and I am living in Osaka, Japan with my husband and daughter Ellie. Living and being a mom in a foreign country comes with both challenges and excitement. I hope to both share my experiences with you and meet people who are making their way in foreign countries with young children.",
"publishedAt": "2011-03-25T09:58:45.000Z",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/-DqmCXHftE-I/AAAAAAAAAAI/AAAAAAAAAAA/3k1uCwnmlu4/s88-c-k-no/photo.jpg"
},
"medium": {
"url": "https://yt3.ggpht.com/-DqmCXHftE-I/AAAAAAAAAAI/AAAAAAAAAAA/3k1uCwnmlu4/s240-c-k-no/photo.jpg"
},
"high": {
"url": "https://yt3.ggpht.com/-DqmCXHftE-I/AAAAAAAAAAI/AAAAAAAAAAA/3k1uCwnmlu4/s240-c-k-no/photo.jpg"
}
},

First I need to be able to upload my thumbnail image via the YouTube API , then retrieve the URL for the images which I can later set ….

For example:

    channel.Snippet.Thumbnails.Default.Url = "https://yt3.ggpht.com/-DqmCXHftE-I/AAAAAAAAAAI/AAAAAAAAAAA/3k1uCwnmlu4/s240-c-k-no/photo.jpg";
    channel.Snippet.Thumbnails.Default.Height = 120;
    channel.Snippet.Thumbnails.Default.Width = 800;

My problem is there is nowhere in the YouTube API documentation that states how to upload a channel thumbnail…

The document below states how to upload a thumbnail for a video resource but makes no reference to channels https://developers.google.com/youtube/v3/docs/thumbnails

How can I upload channel thumbnail images using YouTube API (V3)?

It appears that channel thumbnail images are linked to Google+ accounts.

Should I be updating the Google+ profile image instead?

The Google+ API doesn't seem to support updating profile images

1

1 Answers

1
votes

Correction:

The channel-header-profile-image in a youtube channel, such as

enter image description here

in https://www.youtube.com/user/achanoi is the same image as

found in the corresponding Google Plus profile, https://plus.google.com/106231037176903967640/videos.

Setting the thumbnail image seems not straightforward, as per https://stackoverflow.com/a/20501327/3303824 and https://developers.google.com/+/domains/profiles.

Yet from the Google Developer Directory API Update User Photo Image, a PUT request:

PUT https://www.googleapis.com/admin/directory/v1/users/userKey/photos/thumbnail

with:

{
    "kind": "admin#directory#user#photo",
    "id": string,
    "etag": etag,
    "primaryEmail": string,
    "mimeType": string,
    "height": integer,
    "width": integer,
    "photoData": bytes
}

is enough.

Was:

From the YouTube API V3 Specs, the channel object has:

{
 "kind": "youtube#channel",
 "etag": etag,
 "id": string,
 "image": {
  "bannerImageUrl": string,
  "bannerMobileImageUrl": string,
  "watchIconImageUrl": string,
  "trackingImageUrl": string,
  "bannerTabletLowImageUrl": string,
  "bannerTabletImageUrl": string,
  "bannerTabletHdImageUrl": string,
  "bannerTabletExtraHdImageUrl": string,
  "bannerMobileLowImageUrl": string,
  "bannerMobileMediumHdImageUrl": string,
  "bannerMobileHdImageUrl": string,
  "bannerMobileExtraHdImageUrl": string,
  "bannerTvImageUrl": string,
  "bannerTvLowImageUrl": string,
  "bannerTvMediumImageUrl": string,
  "bannerTvHighImageUrl": string,
  "bannerExternalUrl": string
 }
}

Set:

brandingSettings.image.bannerExternalUrl