From e0a24b62090551fa0f79eaea64ad34a56e3e569f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 19 Dec 2020 00:31:37 -0300 Subject: Add support to HTTP requests. Python2.7 for Android is... not very good for HTTPS requests, that's all =/ --- game/01_init.rpy | 7 +++++++ game/03_init.rpy | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'game') diff --git a/game/01_init.rpy b/game/01_init.rpy index 15e8b2a..0a71d63 100644 --- a/game/01_init.rpy +++ b/game/01_init.rpy @@ -129,6 +129,13 @@ init -3 python: time.sleep(delta) return + # IF Then Else (IFTE) + def ifte(ifs, then, elses): + if (ifs): + return then + else: + return elses + # Global classes # We need to override standard list method. Original by Triptych (stackoverflow) diff --git a/game/03_init.rpy b/game/03_init.rpy index 9524dfa..2db95cd 100644 --- a/game/03_init.rpy +++ b/game/03_init.rpy @@ -252,7 +252,7 @@ init python: f=open(get_path(addr), "w") stdout("Downloading additional file: %s" % img.replace(" ", "_")) try: - x=requests.get("https://%s/assets/%s?token=%s" % (HOST, img.replace(" ", "_"), get_token()), verify=False) # , timeout=8.0 → Need to handle sudden death + x=requests.get("%s://%s/assets/%s?token=%s" % (ifte(persistent.ssl_enabled, "https", "http"), HOST, img.replace(" ", "_"), get_token()), verify=False) # , timeout=8.0 → Need to handle sudden death except: # Oh noes - something went *terribly* wrong traceback.print_exc() -- cgit v1.2.3-70-g09d2