From ecb1986646083d5871601a10e10eb22dbebb0c4a Mon Sep 17 00:00:00 2001 From: whatever127 <46111995+whatever127@users.noreply.github.com> Date: Thu, 7 May 2020 19:42:14 +0200 Subject: [PATCH] Add automatic cookie replacement in case current one expires --- shared/main.php | 4 ++-- shared/utils.php | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/shared/main.php b/shared/main.php index b34efac..74ce99f 100644 --- a/shared/main.php +++ b/shared/main.php @@ -1,6 +1,6 @@ (ConfigChanged|CookieExpired)<\/ErrorCode>/', $out)) { + $oldCookie = uupEncryptedData(); + @unlink(dirname(__FILE__).'/cookie.json'); + $postData = str_replace($oldCookie, uupEncryptedData(), $postData); + + return sendWuPostRequest($url, $postData); + } + $outDecoded = html_entity_decode($out); preg_match('/.*?<\/NewCookie>|.*?<\/GetCookieResult>/', $outDecoded, $cookieData);