From c88044a2607573e4d8a4408fad3792ce0a8cec97 Mon Sep 17 00:00:00 2001 From: Sam Hadow Date: Mon, 12 Feb 2024 21:30:17 +0100 Subject: [PATCH] currency fix --- src/aliexpress.py | 5 ++++- src/main.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/aliexpress.py b/src/aliexpress.py index d16a55d..03187d7 100644 --- a/src/aliexpress.py +++ b/src/aliexpress.py @@ -65,8 +65,11 @@ def check_item(settings_item): image_link = re.sub(r'jpg_[0-9]+x[0-9]+', "jpg_800x800", image_link) # get bigger image instead of preview break + # get currency + currency = elem[12] if (len(elem[12])>0) else elem[14] + # skuId, quantity, discount_percentage, price, currency, choice_delivery, image - extract[key] = {"skuid": elem[2], "quantity": elem[3], "discount_percentage": discount, "price": price, "currency": elem[12], "choice_delivery": is_choice, "image": image_link} + extract[key] = {"skuid": elem[2], "quantity": elem[3], "discount_percentage": discount, "price": price, "currency": currency, "choice_delivery": is_choice, "image": image_link} else: print(f'Failed to fetch target page. Status code: {target_page_response.status_code}') diff --git a/src/main.py b/src/main.py index d9a4569..75795e0 100644 --- a/src/main.py +++ b/src/main.py @@ -28,7 +28,10 @@ if __name__ == '__main__': # c_l = ["1005006062371246", ["Pr Tactile 62g x35"]] # print(check_item(c_l)) - c_l = ["1005005676358693", ["5x250mm 5pcs"]] + # c_l = ["1005005676358693", ["5x250mm 5pcs"]] + # print(check_item(c_l)) + + c_l = ["1005005824413309", ["00350"]] print(check_item(c_l)) # TODO : fix regex for this item