[GH-ISSUE #9] Episode (podcast) info #7

Closed
opened 2026-02-27 19:06:25 +03:00 by kerem · 26 comments
Owner

Originally created by @noembryo on GitHub (Dec 12, 2024).
Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/9

This is more of a question (or a feature request).
Is it possible to get info from an episode link like https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk?

Anyway, thank you for your library and your time.
It's been a life saver.. 👍

Originally created by @noembryo on GitHub (Dec 12, 2024). Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/9 This is more of a question (or a feature request). Is it possible to get info from an episode link like `https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk`? Anyway, thank you for your library and your time. It's been a life saver.. 👍
kerem closed this issue 2026-02-27 19:06:25 +03:00
Author
Owner

@Aran404 commented on GitHub (Dec 12, 2024):

The current API does not support it. I'll add this feature request to my TODO. Thanks.

<!-- gh-comment-id:2538999983 --> @Aran404 commented on GitHub (Dec 12, 2024): The current API does not support it. I'll add this feature request to my TODO. Thanks.
Author
Owner

@noembryo commented on GitHub (Dec 12, 2024):

Thank you..

<!-- gh-comment-id:2539006561 --> @noembryo commented on GitHub (Dec 12, 2024): Thank you..
Author
Owner

@Aran404 commented on GitHub (Dec 12, 2024):

Do you think it would be more suitable to make a "PublicInfo" class that has all the paginators that don't require authentication? Or just keep it in it's respectable file?

<!-- gh-comment-id:2539202180 --> @Aran404 commented on GitHub (Dec 12, 2024): Do you think it would be more suitable to make a "PublicInfo" class that has all the paginators that don't require authentication? Or just keep it in it's respectable file?
Author
Owner

@noembryo commented on GitHub (Dec 12, 2024):

Yes, I think one class could be really handy.. 💯

<!-- gh-comment-id:2539566118 --> @noembryo commented on GitHub (Dec 12, 2024): Yes, I think one class could be really handy.. 💯
Author
Owner

@Aran404 commented on GitHub (Dec 12, 2024):

I thought that as well, I'll just point to the function in the original class to have backwards compatibility.

<!-- gh-comment-id:2539583153 --> @Aran404 commented on GitHub (Dec 12, 2024): I thought that as well, I'll just point to the function in the original class to have backwards compatibility.
Author
Owner

@noembryo commented on GitHub (Dec 12, 2024):

Great! Waiting for the update.. 😃

<!-- gh-comment-id:2539611854 --> @noembryo commented on GitHub (Dec 12, 2024): Great! Waiting for the update.. 😃
Author
Owner

@Aran404 commented on GitHub (Dec 14, 2024):

I've added the suggestions you requested, please test and let me know if there any issues.

<!-- gh-comment-id:2542807454 --> @Aran404 commented on GitHub (Dec 14, 2024): I've added the suggestions you requested, please test and let me know if there any issues.
Author
Owner

@noembryo commented on GitHub (Dec 14, 2024):

Nice.. It is almost a drop-in replacement, but has a few differences.

  • Importing PublicPlaylist from public and doing info = play_list.get_playlist_info(limit=343)["data"]["playlistV2"] produces an error, but if I import from spotapi.playlist it works.
    To fix it I have to do
    info = play_list.get_playlist_info(limit=343)
    info = info["data"]["playlistV2"]
  • Importing PublicAlbum from public and doing info = album.get_album_info(limit=343)["data"]["albumUnion"] produces an error, but if I import from spotapi.album it works.
    To fix it I have to do info = album.get_album_info()["data"]["albumUnion"]

Trying to get the playlist info using info = list(Public().playlist_info(url))[0] works fine and I can get all the items with items = [item for sublist in info for item in sublist["items"]], but unfortunately info does not include the playlist's title that I previously got with info["name"]
The same applies to the albums. Getting the items with info = Public().album_info(url) returns a generator for the album items, but there is no way to get the album's title that I use to get with alb_title = info["name"].

For the podcast part now.
I had no success with the test link I use.

  • If I use the info = Public().podcast_episode_info(url), I get a generator with this {'data': {'episodeUnionV2': {'__typename': 'GenericError'}}, 'extensions': {}} in it.
  • If I use this
        info = Public().podcast_info(url)
        for i in info:
            print(i)
I get an `IndexError: list index out of range`

These are my first observations. I'll keep investigating.. 🤓
🙏

<!-- gh-comment-id:2543122340 --> @noembryo commented on GitHub (Dec 14, 2024): Nice.. It is almost a drop-in replacement, but has a few differences. - Importing `PublicPlaylist` from `public` and doing `info = play_list.get_playlist_info(limit=343)["data"]["playlistV2"]` produces an error, but if I import from `spotapi.playlist` it works. To fix it I have to do ``` info = play_list.get_playlist_info(limit=343) info = info["data"]["playlistV2"] ``` - Importing `PublicAlbum` from `public` and doing `info = album.get_album_info(limit=343)["data"]["albumUnion"]` produces an error, but if I import from `spotapi.album` it works. To fix it I have to do `info = album.get_album_info()["data"]["albumUnion"]` Trying to get the playlist info using `info = list(Public().playlist_info(url))[0]` works fine and I can get all the items with `items = [item for sublist in info for item in sublist["items"]]`, but unfortunately `info` does not include the playlist's title that I previously got with `info["name"]` The same applies to the albums. Getting the items with `info = Public().album_info(url)` returns a generator for the album items, but there is no way to get the album's title that I use to get with `alb_title = info["name"]`. For the podcast part now. I had no success with the [test link I use](https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk). - If I use the `info = Public().podcast_episode_info(url)`, I get a generator with this `{'data': {'episodeUnionV2': {'__typename': 'GenericError'}}, 'extensions': {}}` in it. - If I use this ``` info = Public().podcast_info(url) for i in info: print(i) ``` I get an `IndexError: list index out of range` These are my first observations. I'll keep investigating.. 🤓 🙏
Author
Owner

@Aran404 commented on GitHub (Dec 14, 2024):

Well, Public provides the paginators of the objects which has stayed the same from Version 1.1.1 and Version 1.1.2. I think you are confusing pagination (which parses the information somewhat) and getting the raw data. Also Public is a class full of static methods so what you'd do is Public.(methodhere).

<!-- gh-comment-id:2543173402 --> @Aran404 commented on GitHub (Dec 14, 2024): Well, Public provides the paginators of the objects which has stayed the same from Version 1.1.1 and Version 1.1.2. I think you are confusing pagination (which parses the information somewhat) and getting the raw data. Also Public is a class full of static methods so what you'd do is Public.(methodhere).
Author
Owner

@noembryo commented on GitHub (Dec 14, 2024):

Well, my bad. Although Public.podcast_episode_info(url) uses the class' static method and Public().podcast_episode_info(url) uses one instance's static method, the outcome is the same generator with the same error.
And since I'm using the library in a somewhat wrong way, can you please tell me what is the intended way to get the data for a playlist, an album or a podcast?

Thank you for your help..

<!-- gh-comment-id:2543182248 --> @noembryo commented on GitHub (Dec 14, 2024): Well, my bad. Although `Public.podcast_episode_info(url)` uses the class' static method and `Public().podcast_episode_info(url)` uses one instance's static method, the outcome is the same generator with the same error. And since I'm using the library in a somewhat wrong way, can you please tell me what is the intended way to get the data for a playlist, an album or a podcast? Thank you for your help..
Author
Owner

@Aran404 commented on GitHub (Dec 14, 2024):

To get the raw data, just use it the normal way by importing the specific class you want to use. Public just acts as an atlas to the underlying methods.

<!-- gh-comment-id:2543183187 --> @Aran404 commented on GitHub (Dec 14, 2024): To get the raw data, just use it the normal way by importing the specific class you want to use. Public just acts as an atlas to the underlying methods.
Author
Owner

@noembryo commented on GitHub (Dec 14, 2024):

A, OK.
Did you see the podcast's error?

<!-- gh-comment-id:2543183712 --> @noembryo commented on GitHub (Dec 14, 2024): A, OK. Did you see the podcast's error?
Author
Owner

@Aran404 commented on GitHub (Dec 14, 2024):

Yes I did, Issue #10 mentions it, will work up a fix when I'm home.

<!-- gh-comment-id:2543193494 --> @Aran404 commented on GitHub (Dec 14, 2024): Yes I did, Issue #10 mentions it, will work up a fix when I'm home.
Author
Owner

@noembryo commented on GitHub (Dec 14, 2024):

Oh, thank you. I'll monitor it there.. 🙏

<!-- gh-comment-id:2543194296 --> @noembryo commented on GitHub (Dec 14, 2024): Oh, thank you. I'll monitor it there.. 🙏
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

Yes I did, Issue #10 mentions it, will work up a fix when I'm home.

Is the fix that you mention there published?
Because I can't see an update..

<!-- gh-comment-id:2543836736 --> @noembryo commented on GitHub (Dec 15, 2024): > Yes I did, Issue #10 mentions it, will work up a fix when I'm home. Is the fix that you mention there published? Because I can't see an update..
Author
Owner

@Aran404 commented on GitHub (Dec 15, 2024):

Yeah it is.

<!-- gh-comment-id:2543924700 --> @Aran404 commented on GitHub (Dec 15, 2024): Yeah it is.
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

Yeah it is.

Well, the most recent release I see, is the 1.1.2, but this is the one I got more than a couple of days ago.
Looking at the dates though, it seems that this 1.1.2 was released yesterday.
Should I remove and re-install the same version?

<!-- gh-comment-id:2543938301 --> @noembryo commented on GitHub (Dec 15, 2024): > Yeah it is. Well, the most recent release I see, is the 1.1.2, but this is the one I got more than a couple of days ago. Looking at the dates though, it seems that this 1.1.2 was released yesterday. Should I remove and re-install the same version?
Author
Owner

@afkarxyz commented on GitHub (Dec 15, 2024):

Yeah it is.

Well, the most recent release I see, is the 1.1.2, but this is the one I got more than a couple of days ago. Looking at the dates though, it seems that this 1.1.2 was released yesterday. Should I remove and re-install the same version?

I think he hasn't bumped to version 1.1.3, I downloaded the repository manually without going through pip.

<!-- gh-comment-id:2543939192 --> @afkarxyz commented on GitHub (Dec 15, 2024): > > Yeah it is. > > Well, the most recent release I see, is the 1.1.2, but this is the one I got more than a couple of days ago. Looking at the dates though, it seems that this 1.1.2 was released yesterday. Should I remove and re-install the same version? I think he hasn't bumped to version 1.1.3, I downloaded the repository manually without going through pip.
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

Thank you. 🙏
I'll try with the re-install..

<!-- gh-comment-id:2543939574 --> @noembryo commented on GitHub (Dec 15, 2024): Thank you. 🙏 I'll try with the re-install..
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

Nope, still the same error.
Tried uninstalling and re-installing from PyPi
Tried uninstalling and installing from GitHub

I must be doing something wrong.
How can I get the raw data for an episode like this https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk?

<!-- gh-comment-id:2543943212 --> @noembryo commented on GitHub (Dec 15, 2024): Nope, still the same error. Tried uninstalling and re-installing from PyPi Tried uninstalling and installing from GitHub I must be doing something wrong. How can I get the raw data for an episode like this `https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk`?
Author
Owner

@afkarxyz commented on GitHub (Dec 15, 2024):

Nope, still the same error. Tried uninstalling and re-installing from PyPi Tried uninstalling and installing from GitHub

I must be doing something wrong. How can I get the raw data for an episode like this https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk?

You can try my project here https://github.com/afkarxyz/spotifyapis or go directly here https://spotifyapis.vercel.app/

<!-- gh-comment-id:2543944462 --> @afkarxyz commented on GitHub (Dec 15, 2024): > Nope, still the same error. Tried uninstalling and re-installing from PyPi Tried uninstalling and installing from GitHub > > I must be doing something wrong. How can I get the raw data for an episode like this `https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk`? You can try my project here https://github.com/afkarxyz/spotifyapis or go directly here https://spotifyapis.vercel.app/
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

You can try my project here https://github.com/afkarxyz/spotifyapis or go directly here https://spotifyapis.vercel.app/

I see that you're using the paginators from Public, but I was looking for a way to do it like I get the raw playlist data.
Something like

        pod = Podcast(client=client)
        info = pod.get_episode(url)

I'll have to read more of your project later, but I was hopping for 2-3 lines of code that get the podcast's data..

<!-- gh-comment-id:2543946493 --> @noembryo commented on GitHub (Dec 15, 2024): > You can try my project here https://github.com/afkarxyz/spotifyapis or go directly here https://spotifyapis.vercel.app/ I see that you're using the paginators from `Public`, but I was looking for a way to do it like I get the raw playlist data. Something like ``` pod = Podcast(client=client) info = pod.get_episode(url) ``` I'll have to read more of your project later, but I was hopping for 2-3 lines of code that get the podcast's data..
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

@afkarxyz Also trying to get the info for my testcase from https://spotifyapis.vercel.app/ returns a 404..

<!-- gh-comment-id:2543971882 --> @noembryo commented on GitHub (Dec 15, 2024): @afkarxyz Also trying to get the info for my [testcase](https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk) from https://spotifyapis.vercel.app/ returns a 404..
Author
Owner

@afkarxyz commented on GitHub (Dec 15, 2024):

@afkarxyz Also trying to get the info for my testcase from https://spotifyapis.vercel.app/ returns a 404..

Try this https://spotifyapis.vercel.app/episode/5CZlLoGOibAGX9oLh26YEk

<!-- gh-comment-id:2543976219 --> @afkarxyz commented on GitHub (Dec 15, 2024): > @afkarxyz Also trying to get the info for my [testcase](https://open.spotify.com/episode/5CZlLoGOibAGX9oLh26YEk) from https://spotifyapis.vercel.app/ returns a 404.. Try this https://spotifyapis.vercel.app/episode/5CZlLoGOibAGX9oLh26YEk
Author
Owner

@noembryo commented on GitHub (Dec 15, 2024):

So, how can I get this too?

Edit: A, got it.. The ID..

<!-- gh-comment-id:2543979204 --> @noembryo commented on GitHub (Dec 15, 2024): So, how can I get this too? Edit: A, got it.. The ID..
Author
Owner

@Aran404 commented on GitHub (Dec 15, 2024):

Sorry about that, 1.1.3 is out now on PyPi.

<!-- gh-comment-id:2543981767 --> @Aran404 commented on GitHub (Dec 15, 2024): Sorry about that, 1.1.3 is out now on PyPi.
Sign in to join this conversation.
No labels
pull-request
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/SpotAPI#7
No description provided.