[GH-ISSUE #468] Get album information from get_song method #348

Closed
opened 2026-02-27 23:00:18 +03:00 by kerem · 1 comment
Owner

Originally created by @lukekh on GitHub (Nov 4, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/468

Is your feature request related to a problem? Please describe.
I've been trying to use this to scrape playlists and filtering (e.g. filter playlist for songs that are released in the last calendar year). I've been using

song = ytmusic.get_song(videoID)
date = song['microformat']['microformatDataRenderer']['publishDate']

but this is fairly unreliable. Is there any information that can trace this back to the album? Is it possible to infer this somehow and make a method to get the album given the song's videoID?

Describe the solution you'd like
I would like a method that allows me to get an album's information given I have the id of a song from the album.

Describe alternatives you've considered
I've attempted using other bits of metadata to trace this back but I've been unsuccesful.

Originally created by @lukekh on GitHub (Nov 4, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/468 **Is your feature request related to a problem? Please describe.** I've been trying to use this to scrape playlists and filtering (e.g. filter playlist for songs that are released in the last calendar year). I've been using ```python song = ytmusic.get_song(videoID) date = song['microformat']['microformatDataRenderer']['publishDate'] ``` but this is fairly unreliable. Is there any information that can trace this back to the album? Is it possible to infer this somehow and make a method to get the album given the song's videoID? **Describe the solution you'd like** I would like a method that allows me to get an album's information given I have the id of a song from the album. **Describe alternatives you've considered** I've attempted using other bits of metadata to trace this back but I've been unsuccesful.
kerem closed this issue 2026-02-27 23:00:19 +03:00
Author
Owner

@sigma67 commented on GitHub (Nov 9, 2023):

You can use

watch_playlist = get_watch_playlist(videoId)
year = watch_playlist['tracks'][0]['year']
<!-- gh-comment-id:1804284607 --> @sigma67 commented on GitHub (Nov 9, 2023): You can use ``` python watch_playlist = get_watch_playlist(videoId) year = watch_playlist['tracks'][0]['year'] ```
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#348
No description provided.