[GH-ISSUE #96] Duration unavailable for uploaded songs #70

Closed
opened 2026-02-27 22:07:52 +03:00 by kerem · 2 comments
Owner

Originally created by @chrislewisdev on GitHub (Oct 30, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/96

Hello, and thanks for this neat library!

It does not seem possible with the existing information from the API to find out the duration of an uploaded song. This is similar to #64 except in this case I was hoping the duration would be available as part of the output of get_library_upload_songs().

My use case: I am making a little tool to generate random playlists of a given length, for example, I can request a playlist for 45 minutes and it will create one for me. Obviously knowing the duration of a song is key here, and I would like to include uploaded songs in these playlists but cannot do so at the moment.

It looks like the duration is available in the response content from /browse that is currently used to parse uploaded song info, here's a snippet containing the duration:

"fixedColumns": [
                                    {
                                      "musicResponsiveListItemFixedColumnRenderer": {
                                        "text": {
                                          "runs": [
                                            {
                                              "text": "4:15"
                                            }
                                          ]
                                        },
                                        "displayPriority": "MUSIC_RESPONSIVE_LIST_ITEM_COLUMN_DISPLAY_PRIORITY_HIGH",
                                        "size": "MUSIC_RESPONSIVE_LIST_ITEM_FIXED_COLUMN_SIZE_SMALL"
                                      }
                                    }
                                  ],

Let me know if you think it's possible for this information to be included in the API. If time permits I may have a crack at a PR but if you had some free time to add this it would be highly appreciated. Thanks!

Originally created by @chrislewisdev on GitHub (Oct 30, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/96 Hello, and thanks for this neat library! It does not seem possible with the existing information from the API to find out the duration of an uploaded song. This is similar to #64 except in this case I was hoping the duration would be available as part of the output of `get_library_upload_songs()`. My use case: I am making a little tool to generate random playlists of a given length, for example, I can request a playlist for 45 minutes and it will create one for me. Obviously knowing the duration of a song is key here, and I would like to include uploaded songs in these playlists but cannot do so at the moment. It looks like the duration is available in the response content from `/browse` that is currently used to parse uploaded song info, here's a snippet containing the duration: ``` "fixedColumns": [ { "musicResponsiveListItemFixedColumnRenderer": { "text": { "runs": [ { "text": "4:15" } ] }, "displayPriority": "MUSIC_RESPONSIVE_LIST_ITEM_COLUMN_DISPLAY_PRIORITY_HIGH", "size": "MUSIC_RESPONSIVE_LIST_ITEM_FIXED_COLUMN_SIZE_SMALL" } } ], ``` Let me know if you think it's possible for this information to be included in the API. If time permits I may have a crack at a PR but if you had some free time to add this it would be highly appreciated. Thanks!
kerem 2026-02-27 22:07:52 +03:00
Author
Owner

@sigma67 commented on GitHub (Oct 30, 2020):

Good point, this should defnitely be added. Feel free to submit a PR!

<!-- gh-comment-id:719442595 --> @sigma67 commented on GitHub (Oct 30, 2020): Good point, this should defnitely be added. Feel free to submit a PR!
Author
Owner

@chrislewisdev commented on GitHub (Nov 11, 2020):

Thanks a bunch for adding this @sigma67 :)

<!-- gh-comment-id:725307941 --> @chrislewisdev commented on GitHub (Nov 11, 2020): Thanks a bunch for adding this @sigma67 :)
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#70
No description provided.