From fb66ecc4fb6100acc7b18869146d7919bcd73124 Mon Sep 17 00:00:00 2001 From: ThaaoBlues Date: Fri, 24 Jun 2022 09:43:21 +0200 Subject: [PATCH 1/3] fix url error --- copypasta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copypasta.py b/copypasta.py index f11bb4d..dc95f7b 100644 --- a/copypasta.py +++ b/copypasta.py @@ -73,13 +73,13 @@ def check_exe_name(): # copypasta url -if is_hosts_file_modified(): +if not is_hosts_file_modified(): COPYPASTA_URL = "copypasta.me" if system() == "Windows" else "copypasta.me:21987" else: - COPYPASTA_URL = "127.0.0.1:21987" + COPYPASTA_URL = "http://127.0.0.1:21987" #necessary to update images (stack overflow) @app.after_request From 4ea50ae3351b3af6b171d1e1849638167111acfe Mon Sep 17 00:00:00 2001 From: ThaaoBlues Date: Fri, 24 Jun 2022 09:54:59 +0200 Subject: [PATCH 2/3] fixing urls problems --- copypasta.py | 4 ++-- util.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/copypasta.py b/copypasta.py index dc95f7b..33c4262 100644 --- a/copypasta.py +++ b/copypasta.py @@ -73,9 +73,9 @@ def check_exe_name(): # copypasta url -if not is_hosts_file_modified(): +if is_hosts_file_modified(): - COPYPASTA_URL = "copypasta.me" if system() == "Windows" else "copypasta.me:21987" + COPYPASTA_URL = "http://copypasta.me" if system() == "Windows" else "http://copypasta.me:21987" else: diff --git a/util.py b/util.py index 2c11a23..8bea395 100644 --- a/util.py +++ b/util.py @@ -297,12 +297,15 @@ def get_server_version(): def add_copypasta_port_redirect(): - + if system() == "Windows": - # re-put port redirect from 127.0.0.1:80 to 127.0.0.1:80 - run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=21987 connectaddress=127.0.0.1") - + # put port redirect from 127.0.0.1:21987 to 127.0.0.1:80 + try: + run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=21987 connectaddress=127.0.0.1") + except: + # feature that may crash sometimes, not essential + pass def remove_copypasta_port_redirect(): @@ -310,6 +313,8 @@ def remove_copypasta_port_redirect(): if system() == "Windows": # re-put port redirect from 127.0.0.1:80 to 127.0.0.1:80 - run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=80 connectaddress=127.0.0.1") - - \ No newline at end of file + try: + run("netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=80 connectaddress=127.0.0.1") + except: + # feature that may crash sometimes, not essential + pass \ No newline at end of file From f021e2aac094f50453ee15e0921891b35610cd35 Mon Sep 17 00:00:00 2001 From: ThaaoBlues Date: Fri, 24 Jun 2022 10:00:46 +0200 Subject: [PATCH 3/3] increment version --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index f5d2a58..6463e95 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.3 \ No newline at end of file +1.6.4 \ No newline at end of file