Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_playlist: support audio playlists #696

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sgvictorino
Copy link
Contributor

No description provided.

@sgvictorino sgvictorino marked this pull request as draft December 18, 2024 00:55
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.09%. Comparing base (b86654f) to head (7318787).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #696      +/-   ##
==========================================
+ Coverage   95.07%   95.09%   +0.01%     
==========================================
  Files          40       40              
  Lines        2357     2363       +6     
==========================================
+ Hits         2241     2247       +6     
  Misses        116      116              
Flag Coverage Δ
unittests 95.09% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sgvictorino sgvictorino marked this pull request as ready for review December 18, 2024 02:06
@sigma67
Copy link
Owner

sigma67 commented Dec 22, 2024

You're trying to support albums with get_playlist.

Albums are meant to be retrieved with get_album.

I don't see the value in supporting the same content with two different endpoints.

@sigma67
Copy link
Owner

sigma67 commented Dec 22, 2024

I realize that right now it's maybe not convenient to call get_album_browse_id(audioPlaylistId) before calling get_album(browseId), but that's just how the API works

@sigma67
Copy link
Owner

sigma67 commented Dec 22, 2024

Please also following CONTRIBUTING.rst for more involved changes so wasted effort can be prevented:

https://github.com/sigma67/ytmusicapi/blob/main/CONTRIBUTING.rst#pull-requests

Please open an issue before submitting, unless it's just a typo or some other small error.

@sgvictorino
Copy link
Contributor Author

sgvictorino commented Dec 22, 2024

I think it's useful for listing the audio counterparts, while get_album returns music videos:

>>> yt = YTMusic()
>>> playlist = "OLAK5uy_kzi7k-3sR60kgaRt8HpK2zBN6jlNOMoHw"
>>> [(s["videoId"], s["videoType"]) for s in yt.get_album(yt.get_album_browse_id(playlist))["tracks"]]
[('S9bCLPwzSC0', 'MUSIC_VIDEO_TYPE_OMV'), ('6CQ8FIRzjnk', 'MUSIC_VIDEO_TYPE_ATV'), ('sbCe_L_hXi0', 'MUSIC_VIDEO_TYPE_ATV')]
>>> [(s["videoId"], s["videoType"]) for s in yt.get_playlist(playlist)["tracks"]]
[('clxG52zpxIg', 'MUSIC_VIDEO_TYPE_ATV'), ('6CQ8FIRzjnk', 'MUSIC_VIDEO_TYPE_ATV'), ('sbCe_L_hXi0', 'MUSIC_VIDEO_TYPE_ATV')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants