yannickcarer / endomondo-export

Export the most recent Endomondo workouts as TCX files.
31 stars 21 forks source link

Add proxy support #6

Open dtrillo opened 9 years ago

dtrillo commented 9 years ago

With an easy modification, you can introduce support for proxy.

Modify the Endomondo class for init with this code:

def __init__(self, email=None, password=None, proxy=''):
    self.auth_token = None
    self.request = requests.session()
    if proxy:
        self.request.proxies = {"http": proxy, "https": proxy}
    self.request.headers['User-Agent'] = self.get_user_agent()
    if email and password:
        self.auth_token = self.request_auth_token(email, password)

Adding this doesn't affect the result