[GH-ISSUE #291] Feature request: Scraping the queue for tracks around a given track in a playlist #228

Closed
opened 2026-02-27 22:08:42 +03:00 by kerem · 1 comment
Owner

Originally created by @AntonBogun on GitHub (Aug 31, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/291

I have been thinking about a way to get a range of tracks from a given playlist rather than getting the entire playlist at once and then slicing it.
Recently I realized that youtube music supports links in the form of music.youtube.com/watch?v=VIDEO_ID&list=PLAYLIST_ID, which returns the track and the tracks around the requested track in the requested playlist.
This doesn't quite work out as a range of tracks from one index to another, but it loads much less than a full reload of the playlist, and could therefore be used to optimize some functionality.

Originally created by @AntonBogun on GitHub (Aug 31, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/291 I have been thinking about a way to get a range of tracks from a given playlist rather than getting the entire playlist at once and then slicing it. Recently I realized that youtube music supports links in the form of `music.youtube.com/watch?v=VIDEO_ID&list=PLAYLIST_ID`, which returns the track and the tracks around the requested track in the requested playlist. This doesn't quite work out as a range of tracks from one index to another, but it loads much less than a full reload of the playlist, and could therefore be used to optimize some functionality.
kerem 2026-02-27 22:08:42 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@sigma67 commented on GitHub (Sep 1, 2022):

You should already be able to do this using get_watch_playlist, which supports both parameters. Feel free to play around with it.

<!-- gh-comment-id:1233839813 --> @sigma67 commented on GitHub (Sep 1, 2022): You should already be able to do this using [`get_watch_playlist`](https://ytmusicapi.readthedocs.io/en/latest/reference.html?highlight=get_watch_playlist#ytmusicapi.YTMusic.get_watch_playlist), which supports both parameters. Feel free to play around with it.
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#228
No description provided.