0

Can we access podcasts from spotify using python spotipy library? If yes, Please explain.

I've the following code:

import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import os

proxy = 'http:...'

os.environ['http_proxy'] = proxy 
os.environ['HTTP_PROXY'] = proxy
os.environ['https_proxy'] = proxy
os.environ['HTTPS_PROXY'] = proxy

client_id = ""
client_secret = ""



birdy_uri = 'spotify:artist:2WX2uTcsvV5OnS0inACecP'
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
spotify = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
results = spotify.artist_albums(birdy_uri, album_type='album')
albums = results['items']
while results['next']:
    results = spotify.next(results)
    albums.extend(results['items'])

for album in albums:
    print(album['name'])

This code gives me only the albums list of the artist. But I need podcasts of it?

1 Answers1

0

It does what you say. If you want podcasts, you should use spotify.show(...) instead of spotify.artist_albums(...). Beware that spotify.show is currently not in the release version of spotipy, so you have to install the library from GitHub, see this to do so.

XPhyro
  • 400
  • 1
  • 5
  • 13