$(".cart-info__promo").on("keyup input", (function () {
var t;
if (t = $(this).val(), $.ajax({
type: "GET",
url: "../db/promo.php",
data: {
promocode: t
},
async: !1,
dataType: "json",
success: function (t) {
s = t
}
}), "true" == s.isCorect) {
if (o.isPromo) return;
$(".cart-info__price-price").addClass("promo-done"),
o.promo = o.price * (1 - s.procent / 100),
$(".cart-info__price-promo").text(`$ {
o.promo
}
$ {
o.currency
}`),
o.isPromo = !0
} else $(".cart-info__price-price").removeClass("promo-done"),
$(".cart-info__price-promo").text(""),
o.isPromo = !1
}))
import sys
import os
import twocaptcha
import base64
import requests
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
def get_as_base64(url):
return base64.b64encode(requests.get(url).content).decode('utf-8')
api_key = os.getenv('APIKEY_2CAPTCHA', 'API')
solver = twocaptcha.TwoCaptcha(api_key)
url = 'https://www.impex-jp.com/zip/part-search/check.html?v=60c7c9a0c71a0'
try:
result = solver.normal(get_as_base64(url))
print(result)
except Exception as e:
sys.exit(e)
else:
sys.exit('solved: ' + str(result))