From 128da6eb8f6148590db1b37b2600dd2efce8def0 Mon Sep 17 00:00:00 2001 From: Time Lord <8444252+sxx1314@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:46:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4env?= =?UTF-8?q?=E8=8E=B7=E5=8F=96ck,=E9=98=B2=E6=AD=A2=E8=AF=BB=E5=8F=96config?= =?UTF-8?q?=E5=8D=A1=E4=BD=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_qjd.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jd_qjd.py b/jd_qjd.py index ba526cdef..dafad15f4 100644 --- a/jd_qjd.py +++ b/jd_qjd.py @@ -171,6 +171,11 @@ def getCookie(self): global cookies ckfile = self.getckfile() try: + if "JD_COOKIE" in os.environ: + if len(os.environ["JD_COOKIE"]) > 10: + cookies = os.environ["JD_COOKIE"] + print("已获取并使用Env环境 Cookie") + if os.path.exists(ckfile): with open(ckfile, "r", encoding="utf-8") as f: cks = f.read() @@ -193,10 +198,7 @@ def getCookie(self): cks = "#多账号换行,以下示例:(通过正则获取此文件的ck,理论上可以自定义名字标记ck,也可以随意摆放ck)\n账号1【Curtinlv】cookie1;\n账号2【TopStyle】cookie2;" f.write(cks) f.close() - if "JD_COOKIE" in os.environ: - if len(os.environ["JD_COOKIE"]) > 10: - cookies = os.environ["JD_COOKIE"] - print("已获取并使用Env环境 Cookie") + except Exception as e: print(f"【getCookie Error】{e}") @@ -266,7 +268,7 @@ def iscookie(self): getCk = getJDCookie() getCk.getCookie() # 获取v4环境 特殊处理 -if os.path.exists(v4f): +if os.path.exists(v4f) and "JD_COOKIE" not in os.environ: try: with open(v4f, 'r', encoding='utf-8') as f: curenv = locals() From a79e4cdc56d70f58d3b8f68102e0cd1860706c03 Mon Sep 17 00:00:00 2001 From: Time Lord <8444252+sxx1314@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:50:01 +0800 Subject: [PATCH 2/4] Update jd_blueCoin.py --- jd_blueCoin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jd_blueCoin.py b/jd_blueCoin.py index 28e646058..f95c80352 100644 --- a/jd_blueCoin.py +++ b/jd_blueCoin.py @@ -104,6 +104,10 @@ def getCookie(self): global cookies ckfile = self.getckfile() try: + if "JD_COOKIE" in os.environ: + if len(os.environ["JD_COOKIE"]) > 10: + cookies = os.environ["JD_COOKIE"] + printT("已获取并使用Env环境 Cookie") if os.path.exists(ckfile): with open(ckfile, "r", encoding="utf-8") as f: cks = f.read() @@ -126,10 +130,6 @@ def getCookie(self): cks = "#多账号换行,以下示例:(通过正则获取此文件的ck,理论上可以自定义名字标记ck,也可以随意摆放ck)\n账号1【Curtinlv】cookie1;\n账号2【TopStyle】cookie2;" f.write(cks) f.close() - if "JD_COOKIE" in os.environ: - if len(os.environ["JD_COOKIE"]) > 10: - cookies = os.environ["JD_COOKIE"] - printT("已获取并使用Env环境 Cookie") except Exception as e: printT(f"【getCookie Error】{e}") @@ -200,7 +200,7 @@ def iscookie(self): getCk.getCookie() # 获取v4环境 特殊处理 -if os.path.exists(v4f): +if os.path.exists(v4f) and "JD_COOKIE" not in os.environ: try: with open(v4f, 'r', encoding='utf-8') as f: curenv = locals() @@ -575,4 +575,4 @@ def start(): if '成功兑换' in msg_info: send(script_name, msg_info) except: - pass \ No newline at end of file + pass From 91b58e626d6091115ae77993c0cc96dfce3b5225 Mon Sep 17 00:00:00 2001 From: Time Lord <8444252+sxx1314@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:51:59 +0800 Subject: [PATCH 3/4] Update jd_cashHelp.py --- jd_cashHelp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jd_cashHelp.py b/jd_cashHelp.py index fa528f4de..a9ccb6e9b 100644 --- a/jd_cashHelp.py +++ b/jd_cashHelp.py @@ -113,6 +113,10 @@ def getCookie(self): global cookies ckfile = self.getckfile() try: + if "JD_COOKIE" in os.environ: + if len(os.environ["JD_COOKIE"]) > 10: + cookies = os.environ["JD_COOKIE"] + print("已获取并使用Env环境 Cookie") if os.path.exists(ckfile): with open(ckfile, "r", encoding="utf-8") as f: cks = f.read() @@ -135,10 +139,6 @@ def getCookie(self): cks = "#多账号换行,以下示例:(通过正则获取此文件的ck,理论上可以自定义名字标记ck,也可以随意摆放ck)\n账号1【Curtinlv】cookie1;\n账号2【TopStyle】cookie2;" f.write(cks) f.close() - if "JD_COOKIE" in os.environ: - if len(os.environ["JD_COOKIE"]) > 10: - cookies = os.environ["JD_COOKIE"] - print("已获取并使用Env环境 Cookie") except Exception as e: print(f"【getCookie Error】{e}") @@ -209,7 +209,7 @@ def iscookie(self): getCk.getCookie() # 获取v4环境 特殊处理 -if os.path.exists(v4f): +if os.path.exists(v4f) and "JD_COOKIE" not in os.environ: try: with open(v4f, 'r', encoding='utf-8') as f: curenv = locals() From 8a3e9ba6536848e806ebe925c2b5a4ff8dcdb6f8 Mon Sep 17 00:00:00 2001 From: Time Lord <8444252+sxx1314@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:53:10 +0800 Subject: [PATCH 4/4] Update jd_jxgc_tuan.py --- jd_jxgc_tuan.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jd_jxgc_tuan.py b/jd_jxgc_tuan.py index 6f216c1dd..a607b6322 100644 --- a/jd_jxgc_tuan.py +++ b/jd_jxgc_tuan.py @@ -111,6 +111,10 @@ def getCookie(self): global cookies ckfile = self.getckfile() try: + if "JD_COOKIE" in os.environ: + if len(os.environ["JD_COOKIE"]) > 10: + cookies = os.environ["JD_COOKIE"] + print("已获取并使用Env环境 Cookie") if os.path.exists(ckfile): with open(ckfile, "r", encoding="utf-8") as f: cks = f.read() @@ -133,10 +137,6 @@ def getCookie(self): cks = "#多账号换行,以下示例:(通过正则获取此文件的ck,理论上可以自定义名字标记ck,也可以随意摆放ck)\n账号1【Curtinlv】cookie1;\n账号2【TopStyle】cookie2;" f.write(cks) f.close() - if "JD_COOKIE" in os.environ: - if len(os.environ["JD_COOKIE"]) > 10: - cookies = os.environ["JD_COOKIE"] - print("已获取并使用Env环境 Cookie") except Exception as e: print(f"【getCookie Error】{e}") @@ -207,7 +207,7 @@ def iscookie(self): getCk.getCookie() # 获取v4环境 特殊处理 -if os.path.exists(v4f): +if os.path.exists(v4f) and "JD_COOKIE" not in os.environ: try: with open(v4f, 'r', encoding='utf-8') as f: curenv = locals() @@ -591,4 +591,4 @@ def start(): except: pass if __name__ == '__main__': - start() \ No newline at end of file + start()