mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #333] how to get 'songs' and not music video when using get_album() #261
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#261
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Mohammad9760 on GitHub (Dec 30, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/333
hey there!
so I can filter the search() to return only 'songs' and not music videos but when I use get_album()['tracks'] the videoId is the link to the music videos if there's a music video for that song.
how do I get the tracks of an album as 'songs', the only way I can think of is to get the track name and artist name and do a search() again with 'songs' filter but that's too tricky and not good for my performance.
thanks!
@sigma67 commented on GitHub (Dec 30, 2022):
Use an authenticated instance: https://ytmusicapi.readthedocs.io/en/stable/setup.html
Non-authenticated requests usually return mostly music videos.
@RaduTek commented on GitHub (Apr 16, 2023):
Here is my workaround for this https://github.com/RaduTek/YTMusicDL/blob/master/ytmusicdl.py#L859
Basically I use yt-dlp to get the playlist with the ID from audioPlaylistId, as on regular YouTube those playlists seem to always list the audio/album version. Then I try and match the song from the YT Music album with the one from the YT playlist by the index number.
It is an annoying workaround you have to do for unauthenticated and free accounts, since audio only mode is a YT Music Premium feature.