def __init__(self, data): self.data = data app = App() app.collection_exporter = ExFmTracks app.collection_exporter_params = { 'username': config['exfm']['username'], 'password': config['exfm']['password'], 'limit': None } self.exporter = app.collection_exporter(**app.collection_exporter_params)
app.collection_importer = LastFmLibraryTracks else: print("Set --source=loved|library") raise Exception("Invalid argument: source. Should be loved|library") app.collection_importer_params = { 'api_key': config['lastfm']['api_key'], 'api_secret': config['lastfm']['api_secret'], 'username': config['lastfm']['username'], 'limit': int(limit or 0) or None, 'resume': resume } # if dest == "grooveshark": # app.collection_exporter = GrooveSharkTracks # app.collection_exporter_params = { # 'api_key': config['grooveshark']['api_key'], # 'api_secret': config['grooveshark']['api_secret'], # 'username': config['grooveshark']['username'], # 'password': config['grooveshark']['password'], # 'limit': None # } # else: app.collection_exporter = ExFmTracks app.collection_exporter_params = { 'username': config['exfm']['username'], 'password': config['exfm']['password'], 'limit': None } app.run()
app.collection_importer_params = { 'api_key': config['lastfm']['api_key'], 'api_secret': config['lastfm']['api_secret'], 'username': config['lastfm']['username'], 'limit': None } if limit is not None: try: app.collection_importer_params['limit'] = int(limit) except Exception as e: print("invalid limit:", e) if dest == "grooveshark": app.collection_exporter = GrooveSharkTracks app.collection_exporter_params = { 'api_key': config['grooveshark']['api_key'], 'api_secret': config['grooveshark']['api_secret'], 'username': config['grooveshark']['username'], 'password': config['grooveshark']['password'], 'limit': None } else: app.collection_exporter = ExFmTracks app.collection_exporter_params = { 'username': config['exfm']['username'], 'password': config['exfm']['password'], 'limit': None } app.run()