Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 401 with latest version #55

Open
JB-CHAUVIN opened this issue Jun 2, 2021 · 5 comments
Open

Error 401 with latest version #55

JB-CHAUVIN opened this issue Jun 2, 2021 · 5 comments

Comments

@JB-CHAUVIN
Copy link

Hello,

I cloned the repository right now, and got a 401 error when running the script :

jbchauvin@MacBook-Pro ~/P/t/doctoshotgun> ./doctoshotgun.py Paris [email protected]
Password:

Traceback (most recent call last):
File "/Users/jbchauvin/Projets/tmp/doctoshotgun/./doctoshotgun.py", line 506, in
sys.exit(Application().main())
File "/Users/jbchauvin/Projets/tmp/doctoshotgun/./doctoshotgun.py", line 437, in main
patients = docto.get_patients()
File "/Users/jbchauvin/Projets/tmp/doctoshotgun/./doctoshotgun.py", line 227, in get_patients
self.master_patient.go()
File "/usr/local/lib/python3.9/site-packages/woob/browser/url.py", line 98, in go
r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method, headers=headers or {})
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 911, in location
response = self.open(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 898, in open
return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 790, in open
return super(DomainBrowser, self).open(req, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 531, in open
response = self.session.send(preq,
File "/Users/jbchauvin/Projets/tmp/doctoshotgun/./doctoshotgun.py", line 57, in send
return callback(self, resp)
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 527, in inner_callback
self.raise_for_status(response)
File "/usr/local/lib/python3.9/site-packages/woob/browser/browsers.py", line 560, in raise_for_status
raise ClientError(http_error_msg, response=response)
woob.browser.exceptions.ClientError: 401 Client Error: Unauthorized

@nicolaus-hee
Copy link
Contributor

Possibly related to #37 and/or #46?

@rbignon
Copy link
Owner

rbignon commented Jun 11, 2021

It may be implemented now, can you test?

@Herrner
Copy link

Herrner commented Jun 21, 2021

The TFA-Code doesn't seem to work for me either. I'm getting

/home/kai/PycharmProjects/doctoshotgun/venv/bin/python /home/kai/PycharmProjects/doctoshotgun/doctoshotgun.py de hamburg [email protected] -z -d --dry-run
Password: 
2021-06-21 11:56:34,665:DEBUG:urllib3.connectionpool::connectionpool.py:971:_new_conn Starting new HTTPS connection (1): www.doctolib.de:443
2021-06-21 11:56:34,964:DEBUG:urllib3.connectionpool::connectionpool.py:452:_make_request https://www.doctolib.de:443 "GET /sessions/new HTTP/1.1" 200 None
2021-06-21 11:56:35,041:INFO:browser::browsers.py:369:save_response Response saved to 09a3132eb5f74a95a7340f09ebf95ee2
2021-06-21 11:56:35,045:DEBUG:browser::browsers.py:894:internal_callback Unable to handle https://www.doctolib.de/sessions/new
2021-06-21 11:56:35,879:DEBUG:urllib3.connectionpool::connectionpool.py:452:_make_request https://www.doctolib.de:443 "POST /login.json HTTP/1.1" 401 None
2021-06-21 11:56:35,883:INFO:browser::browsers.py:369:save_response Response saved to 721b2f9fe0b341f9b8c5fb59ba9910ee
Wrong login/password

The password is ok and works on the website with 2FA.

@jmeyerdo
Copy link

Same for me:
Traceback (most recent call last):
File "./doctoshotgun.py", line 632, in
sys.exit(Application().main())
File "./doctoshotgun.py", line 537, in main
patients = docto.get_patients()
File "./doctoshotgun.py", line 260, in get_patients
self.master_patient.go()
File "/usr/local/lib/python3.6/site-packages/woob/browser/url.py", line 98, in go
r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method, headers=headers or {})
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 911, in location
response = self.open(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 898, in open
return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 790, in open
return super(DomainBrowser, self).open(req, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 539, in open
is_async=is_async)
File "./doctoshotgun.py", line 60, in send
return callback(self, resp)
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 527, in inner_callback
self.raise_for_status(response)
File "/usr/local/lib/python3.6/site-packages/woob/browser/browsers.py", line 560, in raise_for_status
raise ClientError(http_error_msg, response=response)
woob.browser.exceptions.ClientError: 401 Client Error: Unauthorized

Does your comments mean the script is not usable without TFA? For weblogin this is not needed for my account.

@gitolicious
Copy link
Collaborator

I am getting 2FA requests for every run of the script nowadays, but the implementation works flawlessly and with the --code CLI argument the code is reusable for multiple runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants