From 0d2f1c4ef20a34d78f8246e4f317bacfee43fb18 Mon Sep 17 00:00:00 2001 From: Thomas Gurung Date: Tue, 5 Nov 2024 16:07:55 +0000 Subject: [PATCH] Updating PR --- cloudinary_cli/utils/api_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cloudinary_cli/utils/api_utils.py b/cloudinary_cli/utils/api_utils.py index 2367817..a8d22bb 100644 --- a/cloudinary_cli/utils/api_utils.py +++ b/cloudinary_cli/utils/api_utils.py @@ -13,6 +13,7 @@ from cloudinary_cli.utils.json_utils import print_json, write_json_to_file from cloudinary_cli.utils.utils import log_exception, confirm_action, get_command_params, merge_responses, \ normalize_list_params, ConfigurationError, print_api_help, duplicate_values +import re PAGINATION_MAX_RESULTS = 500 @@ -116,10 +117,11 @@ def upload_file(file_path, options, uploaded=None, failed=None): verbose = logger.getEffectiveLevel() < logging.INFO try: - size = path.getsize(file_path) upload_func = uploader.upload - if size > 20000000: - upload_func = uploader.upload_large + if not re.match(r'^https?://', file_path): + size = path.getsize(file_path) + if size > 20000000: + upload_func = uploader.upload_large result = upload_func(file_path, **options) disp_path = _display_path(result) disp_str = f"as {result['public_id']}" if not disp_path \