From c2391c6dd19e5a6eef178057664840a52afc7111 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 16 Jan 2023 22:33:11 +0100 Subject: [PATCH] Skip ssl verify --- lidlplus/__main__.py | 8 +++++++- setup.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lidlplus/__main__.py b/lidlplus/__main__.py index 3c5e4c3..5c7e5df 100755 --- a/lidlplus/__main__.py +++ b/lidlplus/__main__.py @@ -4,6 +4,7 @@ """ import argparse import json +import os import sys from getpass import getpass from pathlib import Path @@ -24,6 +25,7 @@ def get_arguments(): parser.add_argument("-p", "--password", help="Lidl Plus login password") parser.add_argument("--2fa", choices=["phone", "email"], default="phone", help="set 2fa method") parser.add_argument("-r", "--refresh-token", help="refresh token to authenticate") + parser.add_argument("--skip-verify", help="skip ssl verification", action="store_true") subparser = parser.add_subparsers(title="commands", metavar="command", required=True) auth = subparser.add_parser("auth", help="authenticate and get refresh_token") auth.add_argument("auth", help="authenticate and get refresh_token", action="store_true") @@ -52,13 +54,17 @@ def check_auth(): def lidl_plus_login(args): """handle authentication""" + if not args.get("refresh_token"): + check_auth() + if args.get("skip_verify"): + os.environ["WDM_SSL_VERIFY"] = "0" + os.environ["CURL_CA_BUNDLE"] = "" language = args.get("language") or input("Enter your language (DE, EN, ...): ") country = args.get("country") or input("Enter your country (de, at, ...): ") if args.get("refresh_token"): return LidlPlusApi(language, country, args.get("refresh_token")) username = args.get("username") or input("Enter your lidl plus username (phone number): ") password = args.get("password") or getpass("Enter your lidl plus password: ") - check_auth() lidl_plus = LidlPlusApi(language, country) try: text = f"Enter the verify code you received via {args['2fa']}: " diff --git a/setup.py b/setup.py index 845c150..efedba2 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ }, license="MIT", classifiers=[ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: MIT License", "Natural Language :: English",