Skip to content

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

@laneschmidt

Description

@laneschmidt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions