[GH-ISSUE #531] get_episodes_playlist #380

Closed
opened 2026-02-27 23:00:29 +03:00 by kerem · 3 comments
Owner

Originally created by @jesse-dot-id on GitHub (Jan 23, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/531

Hello, first of all, thank you for your work on this API. It's very much appreciated!

I am running into an issue that I'm not sure is PIBKAC, a bug, or a use case that just isn't valid. My oauth.json looks valid. I followed the steps in the documentation to generate it.

Here is my code, via a Python 3.11 interpreter, which is fairly simple:

from ytmusicapi import YTMusic
ytmusic = YTMusic("oauth.json")

# Get latest podcasts from playlist
podcasts = ytmusic.get_playlist(playlistId='RDPN', limit=100, related=False, suggestions_limit=0)

# List each podcast
for podcast in podcasts['tracks']:
    print(podcast['title'])

I retrieved the playlistId in the following steps:

The error I'm receiving when I execute the script:

Traceback (most recent call last):
  File "D:\code-projects\ytmusic-grabber\main.py", line 5, in <module>
    podcasts = ytmusic.get_playlist(playlistId='RDPN', limit=100, related=False, suggestions_limit=0)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\mixins\playlists.py", line 109, in get_playlist
    results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\navigation.py", line 103, in nav
    raise err
  File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\navigation.py", line 97, in nav
    root = root[k]

I've checked the documentation and as far as I can tell, this should work. Am I missing something that is obvious?

Originally created by @jesse-dot-id on GitHub (Jan 23, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/531 Hello, first of all, thank you for your work on this API. It's very much appreciated! I am running into an issue that I'm not sure is PIBKAC, a bug, or a use case that just isn't valid. My oauth.json looks valid. I followed the steps in the documentation to generate it. Here is my code, via a Python 3.11 interpreter, which is fairly simple: ```python from ytmusicapi import YTMusic ytmusic = YTMusic("oauth.json") # Get latest podcasts from playlist podcasts = ytmusic.get_playlist(playlistId='RDPN', limit=100, related=False, suggestions_limit=0) # List each podcast for podcast in podcasts['tracks']: print(podcast['title']) ``` I retrieved the playlistId in the following steps: - Log into YouTube Music - Navigate to https://music.youtube.com/library/podcasts - Click on "New Episodes" - Get redirected to https://music.youtube.com/playlist?list=RDPN - Copy the playlist ID of RDPN. The error I'm receiving when I execute the script: ```error Traceback (most recent call last): File "D:\code-projects\ytmusic-grabber\main.py", line 5, in <module> podcasts = ytmusic.get_playlist(playlistId='RDPN', limit=100, related=False, suggestions_limit=0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\mixins\playlists.py", line 109, in get_playlist results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\navigation.py", line 103, in nav raise err File "D:\code-projects\ytmusic-grabber\.venv\Lib\site-packages\ytmusicapi\navigation.py", line 97, in nav root = root[k] ``` I've checked the documentation and as far as I can tell, this should work. Am I missing something that is obvious?
kerem 2026-02-27 23:00:29 +03:00
Author
Owner

@sigma67 commented on GitHub (Jan 24, 2024):

this is not supported yet, see also #415

I assume you have subscribed to some podcasts? I'm not seeing this playlist in my podcasts library

<!-- gh-comment-id:1907870775 --> @sigma67 commented on GitHub (Jan 24, 2024): this is not supported yet, see also #415 I assume you have subscribed to some podcasts? I'm not seeing this playlist in my podcasts library
Author
Owner

@jesse-dot-id commented on GitHub (Jan 24, 2024):

this is not supported yet, see also #415

I assume you have subscribed to some podcasts? I'm not seeing this playlist in my podcasts library

Oh, yes, my apologies. I should have thought to add that to my steps to replicate. I am subscribed to a couple dozen podcasts, and also I'm a YouTube Premium subscriber. I'm not sure if that makes a difference.

So, when I subscribe to podcasts and then click on Library, I have an "auto-playlist" that is generated by YouTube called "New Episodes" that is automatically populated with the last 100 episodes of my subscriptions.

image

When I click on the button for that playlist, I am redirected to: https://music.youtube.com/playlist?list=RDPN

I would expect that if I'm using an authorized account, I should be able to retrieve the items from that playlist via YTMusic.get_playlist.

The interesting thing that I've just discovered is that if I use the playlist ID "LM" for the "Liked Music" auto-generated playlist, the code functions perfectly. So the payload for "RDPN" must differ enough to warrant a YTMusic.get_podcast_playlist function, which is odd. I'm not sure why that would be the case. Podcasts and Music typically carry the same kinds of metadata.

<!-- gh-comment-id:1908041107 --> @jesse-dot-id commented on GitHub (Jan 24, 2024): > this is not supported yet, see also #415 > > I assume you have subscribed to some podcasts? I'm not seeing this playlist in my podcasts library Oh, yes, my apologies. I should have thought to add that to my steps to replicate. I am subscribed to a couple dozen podcasts, and also I'm a YouTube Premium subscriber. I'm not sure if that makes a difference. So, when I subscribe to podcasts and then click on Library, I have an "auto-playlist" that is generated by YouTube called "New Episodes" that is automatically populated with the last 100 episodes of my subscriptions. ![image](https://github.com/sigma67/ytmusicapi/assets/5571647/07e4d367-974c-4dfe-b689-a0994f69d487) When I click on the button for that playlist, I am redirected to: https://music.youtube.com/playlist?list=RDPN I would expect that if I'm using an authorized account, I should be able to retrieve the items from that playlist via YTMusic.get_playlist. The interesting thing that I've just discovered is that if I use the playlist ID "LM" for the "Liked Music" auto-generated playlist, the code functions perfectly. So the payload for "RDPN" must differ enough to warrant a YTMusic.get_podcast_playlist function, which is odd. I'm not sure why that would be the case. Podcasts and Music typically carry the same kinds of metadata.
Author
Owner

@sigma67 commented on GitHub (Jan 24, 2024):

I just added the first podcast from your screenshot and the RDPN playlist showed up immediately.

It seems it's a mix of the playlist view and the podcast view, so it'll require a new endpoint

<!-- gh-comment-id:1908312407 --> @sigma67 commented on GitHub (Jan 24, 2024): I just added the first podcast from your screenshot and the RDPN playlist showed up immediately. It seems it's a mix of the playlist view and the podcast view, so it'll require a new endpoint
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#380
No description provided.