Code Monkey home page Code Monkey logo

playlistanalyzer's People

Contributors

levinmat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

playlistanalyzer's Issues

Only extracting first 100 songs from large Playlists

Hi, thanks for this awesome tool!

I noticed it only extracts the first 100 songs from any given playlists into the .csv file, since it does not go through the different spotipy pages.

Adding the following lines in the def write_csv did the trick for me:

        data = playlist['tracks']
        results = data['items']
    	while data['next']:
        	data = sp.next(data)
        	results.extend(data['items'])

        print(len(playlist['tracks']['items']))

        for item in playlist['tracks']['items']:
            track = item['track'] 
            if (track['id'] is not None):     
                track_id = track['id'].encode('utf-8')          
                song_name = track['name'].encode('utf-8')
                primary_artist = track['artists'][0]['name'].encode('utf-8') # Just the primary/first artist
                album = track['album']['name'].encode('utf-8')
    			
                metadata[track_id] = {'name': song_name, 'artist': primary_artist, 'album': album}

Now it traverses through the different pages, I have tested this for playlists which contained over 1500 songs.

However, it is still not possible to generate another playlist with more than 100 songs, since the Spotfiy API won't let you add more than 100 songs at once, so that has to be split up as well.

No Instructions on Redirect URI

Got everything working up to the redirect URI.

Not having used the Spotify API properly before, I am curious what redirect URI I should use.
If I use localhost or (one of) my own domain(s) it does not seem to work.

What URI was used in your testing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.