From bb689bfd68a8edf3272b4ef4d9cfbfddd3f058ec Mon Sep 17 00:00:00 2001 From: Shivam Pandey Date: Mon, 8 Apr 2024 14:10:15 +0530 Subject: [PATCH] testing --- .github/workflows/main.yml | 3 +-- irctc-captcha-solver/app.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd8d67c..5409be7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,12 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - continue-on-error: true with: python-version: '3.11' cache: 'pip' # caching pip dependencies - run: | pip install -r irctc-captcha-solver/requirements.txt - python3 irctc-captcha-solver/app.py + python3 irctc-captcha-solver/app.py "" - name: Install Node.js and npm diff --git a/irctc-captcha-solver/app.py b/irctc-captcha-solver/app.py index 65886bc..c401ea9 100755 --- a/irctc-captcha-solver/app.py +++ b/irctc-captcha-solver/app.py @@ -33,8 +33,13 @@ def extract_text_from_image(base64_image): parser = argparse.ArgumentParser( description="Extract text from a base64 encoded image." ) - parser.add_argument("image", type=str, help="Base64 encoded image") + parser.add_argument( + "image", type=str, nargs="?", default="", help="Base64 encoded image" + ) args = parser.parse_args() - extracted_text = extract_text_from_image(args.image) - print(extracted_text) + if args.image == "": + print("No image provided") + else: + extracted_text = extract_text_from_image(args.image) + print(extracted_text)