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

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://cloud.ocrsdk.com/processImage?exportFormat=xml%2CpdfTextAndImages&language=English #75

Open
laneschmidt opened this issue May 23, 2019 · 2 comments

Comments

@laneschmidt
Copy link

I used two methods:

  1. the following code (from the ABBYY PyPi page at https://pypi.org/project/ABBYY/):
from ABBYY import CloudOCR

ocr = CloudOCR(application_id=<my_app_id>, password=<my_abbyy_password>)
pdf = open('blah.pdf', 'rb')
file = {pdf.name: pdf}

result = ocr.process_and_download(
  file,
  exportFormat='xml,pdfTextAndImages',
  language='English'
)

print(result)

the value used above in <my_app_id> was the value found on the Application Settings page of my Abbyy Cloud OCR SDK Console, as described here: https://abbyy.technology/en:products:cloud-ocr:where_can_i_find_the_appid

which resulted in

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://cloud.ocrsdk.com/processImage?exportFormat=xml%2CpdfTextAndImages&language=English
  1. the method suggested at this page (https://www.ocrsdk.com/documentation/quick-start-guide/python-ocr-sdk/) and running the command (after setting ABBYY_APPID and ABBY_PWD):

python process.py -pdf blah.pdf result.txt

which results in

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://cloud-westus.ocrsdk.com/processImage?language=English&exportFormat=pdfSearchable

My guess would be some sort of authentication issue. I'm not sure if I'm using the right application ID, but I'm not sure what else I'd use.

@Dmitry-Me
Copy link
Contributor

Most likely you either failed to specify a password or used the wrong password. Where does the password you use come from?

@laneschmidt
Copy link
Author

laneschmidt commented May 30, 2019

I used the password given through email received by Abbyy. I tried getting a new password from Abbyy but that didn't work. I moved on to use another cloud OCR service so I won't be coming back to this issue.

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

2 participants