import json import os import subprocess import time def encrpte_to_jspl(fingerprint_json): dir = os.path.dirname(__file__) # print(fingerprint_json) _timestamp = int(time.time()) p = subprocess.Popen(['node', dir + '/jspl_encoder.js', fingerprint_json, str(_timestamp)], stdout=subprocess.PIPE) encrypted_fingerprint = p.stdout.read() _result = encrypted_fingerprint.decode('utf-8') return _result if __name__ == '__main__': fingerprint = { "nddc": 1, "r3n": 33, "exp8": 0, "uid": None, "bci": True, "bcl": 0.8, "bct": "Infinity", "bdt": "Infinity", "dp0": False, "ucdv": False, "wdifrm": False, "iwgl": "undefined", "npmtm": False, "wdif": False, "wdifpnh": 2800984568, "lg": "fr-FR", "isb": False, "idp": True, "crt": 0, "vnd": "Google Inc.", "bid": "NA", "med": "defined", "pltod": False, "csssp": "", "awe": False, "phe": False, "dat": False, "nm": False, "geb": False, "sqt": False, "pf": "Linux armv81", "hc": 8, "br_oh": 745, "br_ow": 393, "ua": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36", "wbd": False, "ts_mtp": 5, "mob": True, "lgs": ["fr-FR", "en-US", "zh-CN", "zh", "fr", "en"], "dvm": 4, "hcovdr": False, "plovdr": False, "ftsovdr": False, "orf": "debug", "ttst": 0.8517814137469564, "br_w": 393, "br_h": 745, "br_iw": 513, "br_ih": 847, "ars_w": 393, "ars_h": 876, "rs_w": 393, "rs_h": 876, "rs_cd": 24, "pr": 2.75, "so": "portrait-primary", "vco": "", "vcots": False, "vch": "probably", "vchts": True, "vcw": "probably", "vcwts": True, "vc3": "maybe", "vc3ts": False, "vcmp": "", "vcmpts": False, "vcq": "", "vcqts": False, "vc1": "probably", "vc1ts": True, "cssS": "3.93,0.39,12.24,9.75,5.64,10.98,13.46,2.19,6.51", "css0": "7,75,0", "css1": "9.74354,0.354646,-0.00922698,0.000685511,0.203723,-5.61673,-0.755238,0.0561098,-0.0279023,0.481607,-10.9534,0.813777,-0.375565,6.48243,-147.433,11.9534", "cssH": "15px", "plu": "", "plgod": False, "plg": 0, "plgne": "NA", "plgre": "NA", "plgof": "NA", "plggt": "NA", "mmt": "empty", "bchk": "3223aeb6721e0d0917e792818d193ac88dcd62fad5cad7bf7a2b2b473ecf58ee60f018dbdb1a5832e8dc6528387b0745971dbcd82387261e9a4e3f", "nt_tcp": 0, "nt_dns": 0, "nt_rd": 0, "nt_irt": -29.600000008940697, "nt_rt": 1129, "nt_tls": 6.700000002980232, "nt_ttf": 1166.7000000029802, "nt_swt": 22.900000005960464, "nt_csd": 411060, "nt_nhp": "h2", "nt_rdc": 0, "nt_it": "navigation", "nt_prs": 6.700000002980232, "nt_esc": 0, "nt_ttrd": None, "nt_le": 3.0999999940395355, "nt_dcle": 141.79999999701977, "nt_di": 1415.2000000029802, "nt_dc": 2862.6000000089407, "ccsT": "Error\nat S (https://d.digital.hermes/tags.js:173:22)\nat Un.C (https://d.digital.hermes/tags.js:1252:41\nat nrWrapper (https://www.hermes.com/fr/fr/category/femme/Sacs%20et%20pochettes%20pour%20Femme%20_%20Herme%CC%80s%20France.html:7:13468)", "ccsB": "tags.js:1252:41 at nrWrapper (sac-p-tit-arcon-H085871CKAO.html:7:13468)", "ccsH": "1050544242", "ccsV": ",993b46baf0942a343b7e6b02fa3f8eef64727f077d3b0055af56e6994dcaf046", "muev": False, "pro_t": True, "wglo": True, "prso": True, "wbst": True, "psn": True, "edp": True, "addt": True, "wsdc": True, "ccsr": True, "nuad": True, "bcda": True, "idn": True, "capi": True, "svde": True, "vpbq": True, "mq": "aptr:coarse,ahvr:none", "aco": "probably", "acots": False, "acmp": "probably", "acmpts": True, "acw": "probably", "acwts": False, "acma": "maybe", "acmats": False, "acaa": "probably", "acaats": True, "ac3": "", "ac3ts": False, "acf": "probably", "acfts": False, "acmp4": "maybe", "acmp4ts": False, "acmp3": "probably", "acmp3ts": False, "acwm": "maybe", "acwmts": False, "ocpt": False, "ckwa": False, "spwn": False, "emt": False, "bfr": False, "tz": -120, "hdn": False, "xt1": False, "cdhf": False, "eva": 33, "cokys": ",loadTimes,csi,app", "ecpc": False, "nhi": ",64,true,Nexus 5,Android,6.0,138.0.7204.184,false", "k_lyts": 48, "k_lytk": "kg20va`l\u00a7'w8mh.71pdfoqcn[zy365x/\\,-4bt9siu=j;r]e", "emd": "k:ai,vi,ao", "wwl": False, "glvd": "Google Inc. (ARM)", "glrd": "ANGLE (ARM,Mali-G57 MC2,OpenGL ES 3.2)", "tzp": "Europe/Paris", "isf": True, "isf2": False, "dt": False, "fph": 416468867, "jset": 1754750959 } fingerprint_json = json.dumps(fingerprint) print(encrpte_to_jspl(fingerprint_json))