From b6732958c999c96269aa8c8a353981b2e8176f11 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sun, 31 Dec 2023 21:09:47 +0530 Subject: [PATCH] feat: download mcaptcha cli and setup mcaptcha server for testing --- scripts/create_captcha.py | 114 ++++++++++++++++++++++++++++++++++++++ scripts/download-cli.sh | 34 ++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 scripts/create_captcha.py create mode 100755 scripts/download-cli.sh diff --git a/scripts/create_captcha.py b/scripts/create_captcha.py new file mode 100644 index 0000000..45128bf --- /dev/null +++ b/scripts/create_captcha.py @@ -0,0 +1,114 @@ +# SPDX-FileCopyrightText: 2023 Aravinth Manivannan +# +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +import sys +from urllib.parse import urlparse, urlunparse, urlencode, parse_qsl +from requests import Session + + +def clean_url(url): + parsed = urlparse(url) + return urlunparse((parsed.scheme, parsed.netloc, "", "", "", "")) + + +def set_path(url: str, path: str) -> str: + parsed = urlparse(url) + return urlunparse((parsed.scheme, parsed.netloc, path, "", "", "")) + + +def help(): + print("Usage: create_captcha.py