def __init__(self): """Create a new Download class instance.""" logger.debug("__init__") self.session = requests.session() self.sso_rest_client = RestClient(self.session, 'sso.garmin.com', 'sso') self.modern_rest_client = RestClient(self.session, 'connect.garmin.com', 'modern') self.activity_service_rest_client = RestClient.inherit(self.modern_rest_client, "proxy/activity-service/activity") self.download_service_rest_client = RestClient.inherit(self.modern_rest_client, "proxy/download-service/files") self.gc_config = GarminConnectConfigManager() self.download_days_overlap = self.gc_config.download_days_overlap()
def __init__(self): """Create a new Download class instance.""" logger.debug("__init__") self.session = requests.session() self.sso_rest_client = RestClient(self.session, 'sso.garmin.com', 'sso') self.modern_rest_client = RestClient(self.session, 'connect.garmin.com', 'modern') self.activity_service_rest_client = RestClient.inherit(self.modern_rest_client, "proxy/activity-service/activity") self.download_service_rest_client = RestClient.inherit(self.modern_rest_client, "proxy/download-service/files") self.gc_config = GarminConnectConfigManager() self.download_days_overlap = 3 # Existing donloaded data will be redownloaded and overwritten if it is within this number of days of now.