Exemplo n.º 1
0
def main(options, args):
    """Run all the things."""
    pc = PlaylistCreator()
    if not pc.authenticated:
        logger.error(
            'You need to authenticate by running `python playlist_helper/authenticate.py` first'
        )
        sys.exit(1)

    user = pc.get_user(username=options['username'],
                       email=options['email'],
                       uid_key=options['uid_key'])
    if user is None:
        print 'No user found for %s %s' % (options['username'],
                                           options['email'])
        exit(1)
    makedirs('dumps/%s' % user['username'])
    dump_comments(user, pc.list_comments(user))
    dump_iterable(user, 'favorite_artists', pc.get_favorite_artists(user))
    dump_iterable(user, 'favorite_labels', pc.get_favorite_labels(user))
    dump_iterable(user, 'favorite_stations', pc.get_favorite_stations(user))

    user['_playlists'] = set()
    for playlist in pc.list_playlists(user):
        dump_playlist(user, playlist)
Exemplo n.º 2
0
def main(options, args):
    logger.debug('Options: %s', options)
    pc = PlaylistCreator()
    if not pc.authenticated:
        logger.error('You need to authenticate by running `python playlist_helper/authenticate.py` first')
        sys.exit(1)

    user = pc.get_user(username=options['username'], email=options['email'])
    if user is None:
        print 'No user found for %s %s' % (options['username'], options['email'])
        exit(1)

    makedirs('dumps/%s' % user['username'])
    dump_comments(user, pc.list_comments(user))
    dump_iterable(user, 'favorite_artists', pc.get_favorite_artists(user))
    dump_iterable(user, 'favorite_labels', pc.get_favorite_labels(user))
    dump_iterable(user, 'favorite_stations', pc.get_favorite_stations(user))
    for playlist in pc.list_playlists(user):
        dump_playlist(user, playlist)
Exemplo n.º 3
0
def main(options, args):
    """Run all the things."""
    pc = PlaylistCreator()
    if not pc.authenticated:
        logger.error("You need to authenticate by running `python playlist_helper/authenticate.py` first")
        sys.exit(1)

    user = pc.get_user(username=options["username"], email=options["email"], uid_key=options["uid_key"])
    if user is None:
        print "No user found for %s %s" % (options["username"], options["email"])
        exit(1)
    makedirs("dumps/%s" % user["username"])
    dump_comments(user, pc.list_comments(user))
    dump_iterable(user, "favorite_artists", pc.get_favorite_artists(user))
    dump_iterable(user, "favorite_labels", pc.get_favorite_labels(user))
    dump_iterable(user, "favorite_stations", pc.get_favorite_stations(user))

    user["_playlists"] = set()
    for playlist in pc.list_playlists(user):
        dump_playlist(user, playlist)