[GH-ISSUE #130] Artist missing for uploaded music #96

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

Originally created by @KoljaWindeler on GitHub (Dec 20, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/130

Hi, I've just scrolled in my uploaded song on the youtube website, selected one song .. played just fine, showing all information correct.

Went into my smarthome system .. opened the youtube GUI (which uses your api), selected the "history" playlist, saw the same song .. with "artist - trackname" (from get_history()) .. played the song (which will call get_song with the videoId) and got an exception due to a missing artist field (exception from my code). Double checked: No artist field .. strange.

Tried to open the get_library_upload_songs ... same thing there .. no artist in the return

Strange, right?

Oh and sidenote: get_uploaded_songs will return "authors" and "author" which looks exactly the same to me ..

Originally created by @KoljaWindeler on GitHub (Dec 20, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/130 Hi, I've just scrolled in my uploaded song on the youtube website, selected one song .. played just fine, showing all information correct. Went into my smarthome system .. opened the youtube GUI (which uses your api), selected the "history" playlist, saw the same song .. with "artist - trackname" (from get_history()) .. played the song (which will call get_song with the videoId) and got an exception due to a missing artist field (exception from my code). Double checked: No artist field .. strange. Tried to open the get_library_upload_songs ... same thing there .. no artist in the return Strange, right? Oh and sidenote: get_uploaded_songs will return "authors" and "author" which looks exactly the same to me ..
kerem closed this issue 2026-02-27 22:07:59 +03:00
Author
Owner

@KoljaWindeler commented on GitHub (Dec 20, 2020):

i just saw that this is likely related to https://github.com/sigma67/ytmusicapi/issues/64, correct?

<!-- gh-comment-id:748681564 --> @KoljaWindeler commented on GitHub (Dec 20, 2020): i just saw that this is likely related to https://github.com/sigma67/ytmusicapi/issues/64, correct?
Author
Owner

@sigma67 commented on GitHub (Dec 23, 2020):

get_library_upload_songs should return an artist if the uploaded song actually has an artist. Please verify in the YTMusic Web UI that this is the case. Same with get_history, it works correctly for me.

get_uploaded_songs does not exist anymore, so not sure what you're referring to there.

<!-- gh-comment-id:750289380 --> @sigma67 commented on GitHub (Dec 23, 2020): `get_library_upload_songs` should return an artist if the uploaded song actually has an artist. Please verify in the YTMusic Web UI that this is the case. Same with `get_history`, it works correctly for me. `get_uploaded_songs` does not exist anymore, so not sure what you're referring to there.
Author
Owner

@KoljaWindeler commented on GitHub (Dec 28, 2020):

Hi, I've done a little more digging .. I'm basically using two functions:

  1. get_playlist (that playlist now contains one of the uploaded songs)
  2. once the playlist was selected: get_song (yep, sorry .. not get_uploaded_song)

The tracks of "get_playlist" contain information about the author, get_song does not
Any idea?

get_playlist
    {
    'id': 'PLZvjm51R8SGuNroyDal3v9BYdTw6yqrrM', 
    'privacy': 'PRIVATE', 
    'title': 'shorty', 
    'thumbnails': [ ... ], 
    'author': {
        'name': 'Kolja Windeler', 
        'id': 'UCrFSdLT1nmvmcTCzIOr6J3w'
        }, 
    'duration': '8 minutes, 5 seconds', 
    'trackCount': 2, 
    'tracks': [
        {
            'videoId': 'eCpt2qaqKW0', 
            'title': 'So wie du bist (feat. LARY)', 
            'artists': [{  'name': 'MoTrip',  'id': 'UCcyO_SNHFhbdogh9PPBB9LA'}], 
            'album': {'name': 'Mama', 'id': 'MPREb_PIwNkeyJF95'}, 
            'likeStatus': 'INDIFFERENT', 
            'thumbnails': [ ... ], 
            'isAvailable': True, 
            'duration': '4:29', 
            'setVideoId': '56B44F6D10557CC6', 
            'feedbackTokens': {
                'add': 'AB9zfpK7DNYiYtX7A5S4WQJfRvQyDdZaR0s7NvzbrdC2d8uAtT27gHyEcLIKzgKW8Vz5_bB8NasY1v1MyYjzJCstl9wDw1g41A', 
                'remove': 'AB9zfpJLZZo60hYf8Zix_TWLIytG579dMCMo1Ogh4jFau5rTLg-duXSEpQbKEjxyLMGzR7eXdi0aRzqXp0nsgutanvP8uPsilA'}
        },{
            'videoId': 'N4-8lb8ITfw', 
            'title': 'Bitte Bitte', 
            'artists': [{'name': 'Fler', 'id': 'FEmusic_library_privately_owned_artist_detaila_po_CP-Lo4yw76nhFBIEZmxlcg'}], 
            'album': {'name': 'Neue Deutsche Welle', 'id': 'FEmusic_library_privately_owned_release_detailb_po_CP-Lo4yw76nhFBITbmV1ZSBkZXV0c2NoZSB3ZWxsZSIDZ3Bt'}, 
            'likeStatus': 'INDIFFERENT', 
            'thumbnails': [ ... ], 
            'isAvailable': True, 
            'duration': '3:36', 
            'setVideoId': '289F4A46DF0A30D2'}
        ]
    }

get_song(videoId='N4-8lb8ITfw')
    {
        'videoId': 'N4-8lb8ITfw', 
        'title': 'Bitte Bitte', 
        'lengthSeconds': '217', 
        'channelId': 'UCQDzKj5SHlE7d5UaK51rc7g', 
        'isOwnerViewing': False, 
        'shortDescription': 'Uploaded to YouTube via YouTube Music\n\nBitte Bitte', 
        'isCrawlable': False, 
        'thumbnail': {
            'thumbnails': [ ... ]
        }, 
        'averageRating': 0.0, 
        'allowRatings': True, 
        'viewCount': '2', 
        'author': 'Music Library Uploads', 
        'isPrivate': True, 
        'isUnpluggedCorpus': False, 
        'isLiveContent': False, 
        'category': 'Music'
    }

<!-- gh-comment-id:751626093 --> @KoljaWindeler commented on GitHub (Dec 28, 2020): Hi, I've done a little more digging .. I'm basically using two functions: 1. get_playlist (that playlist now contains one of the uploaded songs) 2. once the playlist was selected: get_song (yep, sorry .. not get_uploaded_song) The tracks of "get_playlist" contain information about the author, get_song does not Any idea? ``` get_playlist { 'id': 'PLZvjm51R8SGuNroyDal3v9BYdTw6yqrrM', 'privacy': 'PRIVATE', 'title': 'shorty', 'thumbnails': [ ... ], 'author': { 'name': 'Kolja Windeler', 'id': 'UCrFSdLT1nmvmcTCzIOr6J3w' }, 'duration': '8 minutes, 5 seconds', 'trackCount': 2, 'tracks': [ { 'videoId': 'eCpt2qaqKW0', 'title': 'So wie du bist (feat. LARY)', 'artists': [{ 'name': 'MoTrip', 'id': 'UCcyO_SNHFhbdogh9PPBB9LA'}], 'album': {'name': 'Mama', 'id': 'MPREb_PIwNkeyJF95'}, 'likeStatus': 'INDIFFERENT', 'thumbnails': [ ... ], 'isAvailable': True, 'duration': '4:29', 'setVideoId': '56B44F6D10557CC6', 'feedbackTokens': { 'add': 'AB9zfpK7DNYiYtX7A5S4WQJfRvQyDdZaR0s7NvzbrdC2d8uAtT27gHyEcLIKzgKW8Vz5_bB8NasY1v1MyYjzJCstl9wDw1g41A', 'remove': 'AB9zfpJLZZo60hYf8Zix_TWLIytG579dMCMo1Ogh4jFau5rTLg-duXSEpQbKEjxyLMGzR7eXdi0aRzqXp0nsgutanvP8uPsilA'} },{ 'videoId': 'N4-8lb8ITfw', 'title': 'Bitte Bitte', 'artists': [{'name': 'Fler', 'id': 'FEmusic_library_privately_owned_artist_detaila_po_CP-Lo4yw76nhFBIEZmxlcg'}], 'album': {'name': 'Neue Deutsche Welle', 'id': 'FEmusic_library_privately_owned_release_detailb_po_CP-Lo4yw76nhFBITbmV1ZSBkZXV0c2NoZSB3ZWxsZSIDZ3Bt'}, 'likeStatus': 'INDIFFERENT', 'thumbnails': [ ... ], 'isAvailable': True, 'duration': '3:36', 'setVideoId': '289F4A46DF0A30D2'} ] } get_song(videoId='N4-8lb8ITfw') { 'videoId': 'N4-8lb8ITfw', 'title': 'Bitte Bitte', 'lengthSeconds': '217', 'channelId': 'UCQDzKj5SHlE7d5UaK51rc7g', 'isOwnerViewing': False, 'shortDescription': 'Uploaded to YouTube via YouTube Music\n\nBitte Bitte', 'isCrawlable': False, 'thumbnail': { 'thumbnails': [ ... ] }, 'averageRating': 0.0, 'allowRatings': True, 'viewCount': '2', 'author': 'Music Library Uploads', 'isPrivate': True, 'isUnpluggedCorpus': False, 'isLiveContent': False, 'category': 'Music' } ```
Author
Owner

@sigma67 commented on GitHub (Jan 3, 2021):

The author is missing for get_song because that function uses a YouTube endpoint (not YouTube music). That endpoint does not provide the author of the uploaded track.

If you check that track on YouTube using https://www.youtube.com/watch?v=___, you will find that the artist is nowhere to be found on that site. There is also no metadata in the comments like for auto-uploads. This means there is no way for ytmusicapi to provide the track author of uploaded tracks from that endpoint.

When you play an uploaded track, YouTube Music actually gets the artist using the next endpoint, which is implemented in get_watch_playlist. The function needs a bit of work to properly return album and artist instead of the generic byline, but that would fix your issue.

<!-- gh-comment-id:753686828 --> @sigma67 commented on GitHub (Jan 3, 2021): The author is missing for `get_song` because that function uses a YouTube endpoint (not YouTube music). That endpoint does not provide the author of the uploaded track. If you check that track on YouTube using https://www.youtube.com/watch?v=___, you will find that the artist is nowhere to be found on that site. There is also no metadata in the comments like for auto-uploads. This means there is no way for ytmusicapi to provide the track author of uploaded tracks from that endpoint. When you play an uploaded track, YouTube Music actually gets the artist using the `next` endpoint, which is implemented in `get_watch_playlist`. The function needs a bit of work to properly return album and artist instead of the generic byline, but that would fix your issue.
Author
Owner

@sigma67 commented on GitHub (Jan 5, 2021):

@KoljaWindeler Please check if 3de9b5e fixes this issue.

<!-- gh-comment-id:754835507 --> @sigma67 commented on GitHub (Jan 5, 2021): @KoljaWindeler Please check if 3de9b5e fixes this issue.
Author
Owner

@KoljaWindeler commented on GitHub (Jan 5, 2021):

Will do and report back

<!-- gh-comment-id:754836403 --> @KoljaWindeler commented on GitHub (Jan 5, 2021): Will do and report back
Author
Owner

@KoljaWindeler commented on GitHub (Jan 6, 2021):

works perfectly! thanks, great work!

<!-- gh-comment-id:755226465 --> @KoljaWindeler commented on GitHub (Jan 6, 2021): works perfectly! thanks, great work!
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#96
No description provided.