[GH-ISSUE #711] edit_playlist: add playlist image #460

Open
opened 2026-02-27 23:00:55 +03:00 by kerem · 6 comments
Owner

Originally created by @srajangarg on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/711

Seems like youtube music recently added the ability to add custom images to playlists! Can we extend create_playlist() and edit_playlist to take an optional argument (an image file) so that we can programmatically set it?

Originally created by @srajangarg on GitHub (Jan 3, 2025). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/711 Seems like youtube music recently added the ability to add custom images to playlists! Can we extend `create_playlist()` and `edit_playlist` to take an optional argument (an image file) so that we can programmatically set it?
Author
Owner

@srajangarg commented on GitHub (Jan 3, 2025):

{
  "actions": [
    {
      "action": "ACTION_SET_CUSTOM_THUMBNAIL",
      "addedCustomThumbnail": {
        "imageKey": {
          "type": "PLAYLIST_IMAGE_TYPE_CUSTOM_THUMBNAIL",
          "name": "studio_square_thumbnail"
        },
        "playlistScottyEncryptedBlobId": "65jVDxiw9NQXhgph-9IlssToi-FoBdg68actYIIMK-vjU2o5Gq8QvK5H9PkpmMVZvtP7jQspWqJhprOnmyp1aQ=="
      }
    }
  ]
}

this is the request payload to https://music.youtube.com/youtubei/v1/browse/edit_playlist

<!-- gh-comment-id:2569798738 --> @srajangarg commented on GitHub (Jan 3, 2025): ```json { "actions": [ { "action": "ACTION_SET_CUSTOM_THUMBNAIL", "addedCustomThumbnail": { "imageKey": { "type": "PLAYLIST_IMAGE_TYPE_CUSTOM_THUMBNAIL", "name": "studio_square_thumbnail" }, "playlistScottyEncryptedBlobId": "65jVDxiw9NQXhgph-9IlssToi-FoBdg68actYIIMK-vjU2o5Gq8QvK5H9PkpmMVZvtP7jQspWqJhprOnmyp1aQ==" } } ] } ``` this is the request payload to `https://music.youtube.com/youtubei/v1/browse/edit_playlist`
Author
Owner

@srajangarg commented on GitHub (Jan 3, 2025):

before that call^ there was a call to

https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail?upload_id=AFiumC58THIgewkszL0aq8xbBLW1PSC-notrwUIrOnWDEkxSt0PDPf52HNC8x3xv7XIe1zwBXqOfCA6Ox9mW4dOF_KeC_YCzYro5hbDqGPe9UA&upload_protocol=resumable

with the payload containing the image data (my guess). and the response was

{
  "encryptedBlobId":"65jVDxiw9NQXhgph-9IlssToi-FoBdg68actYIIMK-vjU2o5Gq8QvK5H9PkpmMVZvtP7jQspWqJhprOnmyp1aQ=="
}

the same blobid passed to edit_playlist

<!-- gh-comment-id:2569800994 --> @srajangarg commented on GitHub (Jan 3, 2025): before that call^ there was a call to ``` https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail?upload_id=AFiumC58THIgewkszL0aq8xbBLW1PSC-notrwUIrOnWDEkxSt0PDPf52HNC8x3xv7XIe1zwBXqOfCA6Ox9mW4dOF_KeC_YCzYro5hbDqGPe9UA&upload_protocol=resumable ``` with the payload containing the image data (my guess). and the response was ```json { "encryptedBlobId":"65jVDxiw9NQXhgph-9IlssToi-FoBdg68actYIIMK-vjU2o5Gq8QvK5H9PkpmMVZvtP7jQspWqJhprOnmyp1aQ==" } ``` the same blobid passed to `edit_playlist`
Author
Owner

@srajangarg commented on GitHub (Jan 3, 2025):

and before that call^ was an empty request call to https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail

that returned

x-goog-upload-url:
https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail?upload_id=AFiumC58THIgewkszL0aq8xbBLW1PSC-notrwUIrOnWDEkxSt0PDPf52HNC8x3xv7XIe1zwBXqOfCA6Ox9mW4dOF_KeC_YCzYro5hbDqGPe9UA&upload_protocol=resumable

in the reponse headers - which probably gives us the URL to call while uploading the image

<!-- gh-comment-id:2569810629 --> @srajangarg commented on GitHub (Jan 3, 2025): and before that call^ was an empty request call to `https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail` that returned ``` x-goog-upload-url: https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail?upload_id=AFiumC58THIgewkszL0aq8xbBLW1PSC-notrwUIrOnWDEkxSt0PDPf52HNC8x3xv7XIe1zwBXqOfCA6Ox9mW4dOF_KeC_YCzYro5hbDqGPe9UA&upload_protocol=resumable ``` in the reponse headers - which probably gives us the URL to call while uploading the image
Author
Owner

@sigma67 commented on GitHub (Jan 4, 2025):

Yeah sure, this should be possible. PR welcome

We already have similar upload code in upload_song

<!-- gh-comment-id:2570718486 --> @sigma67 commented on GitHub (Jan 4, 2025): Yeah sure, this should be possible. PR welcome We already have similar upload code in `upload_song`
Author
Owner

@sigma67 commented on GitHub (Jan 4, 2025):

This should be implemented in edit_playlist only. When an optional image Path is provided, the upload is performed via separate calls to

https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail

which returns an encrypted blob id, which is then wrapped in a corresponding action for the edit_playlist call.

<!-- gh-comment-id:2571268956 --> @sigma67 commented on GitHub (Jan 4, 2025): This should be implemented in `edit_playlist` only. When an optional image `Path` is provided, the upload is performed via separate calls to https://music.youtube.com/playlist_image_upload/playlist_custom_thumbnail which returns an encrypted blob id, which is then wrapped in a corresponding action for the `edit_playlist` call.
Author
Owner

@sigma67 commented on GitHub (Nov 12, 2025):

@srajangarg are you interested in implementing this?

<!-- gh-comment-id:3521669353 --> @sigma67 commented on GitHub (Nov 12, 2025): @srajangarg are you interested in implementing this?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#460
No description provided.