Created
December 1, 2015 19:40
-
-
Save davedash/ff1ff080cbf32690c5ec to your computer and use it in GitHub Desktop.
get all your playlists out of rdio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rdioapi import Rdio | |
__author__ = 'davedash' | |
CLIENT_ID='' | |
CONSUMER_SECRET='' | |
def main(): | |
r = Rdio(CLIENT_ID, CONSUMER_SECRET, {}) | |
print r.begin_authentication() | |
r.complete_authentication() | |
playlists = r.getPlaylists() | |
flat_playlists = playlists['owned'] + playlists['subscribed'] + playlists['favorites'] + playlists['collab'] | |
playlist_keys = [k['key'] for k in flat_playlists] | |
for key in playlist_keys: | |
data = r.get(keys=key, extras='tracks') | |
print '# ', data[key]['name'] | |
for track in data[key]['tracks']: | |
print u'* {artist} :: {track}'.format(artist=track['artist'], track=track['name']) | |
# [u'radioKey', u'baseIcon', u'canDownloadAlbumOnly', u'radio', u'artistUrl', u'duration', | |
# u'dynamicIcon', u'album', u'isClean', u'albumUrl', u'shortUrl', u'albumArtist', u'canStream', | |
# u'embedUrl', u'type', u'gridIcon', u'price', u'trackNum', u'albumArtistKey', u'key', u'icon', | |
# u'canSample', u'name', u'isExplicit', u'artist', u'url', u'icon400', u'artistKey', u'canDownload', | |
# u'length', u'canTether', u'albumKey'] | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment