From 96748fb97fd8ca750ac80bf6df13523554edb673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=94=EB=83=A5?= Date: Sun, 2 Feb 2025 14:12:18 +0900 Subject: [PATCH] Auth Cache --- .github/workflows/python-app.yml | 6 +++--- app/library/init-auth.py | 2 +- app/run.py | 2 +- app/run.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0f5b5f4..aa77283 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,11 +36,11 @@ jobs: ${{ runner.os }}-pip- # Cache cookie.json - - name: Cache app/temp/cookie.json + - name: Cache app/temp/auth uses: actions/cache@v3 with: - path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/cookie.json - key: ${{ runner.os }}-cookie-${{ hashFiles('app/temp/cookie.json') }} + path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth + key: ${{ runner.os }}-cookie-${{ hashFiles('/home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth') }} restore-keys: | ${{ runner.os }}-cookie- diff --git a/app/library/init-auth.py b/app/library/init-auth.py index ca3e16b..5afcec6 100644 --- a/app/library/init-auth.py +++ b/app/library/init-auth.py @@ -21,7 +21,7 @@ cl.get_settings() json.dump( cl.get_settings(), - open(f'{ROOT}/temp/cookies.json', 'w') + open(f'{ROOT}/temp/auth/cookies.json', 'w') ) print("🍪 | Account information was successfully retrieved.") diff --git a/app/run.py b/app/run.py index 28c4a9b..9df6c87 100644 --- a/app/run.py +++ b/app/run.py @@ -19,7 +19,7 @@ else: MLSV_YMD = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d') print("🍪 | Retrieving saved account information.") -cl = Client(json.load(open('./temp/cookies.json'))) +cl = Client(json.load(open('./temp/auth/cookies.json'))) cl.set_proxy("socks5h://localhost:9999") print("🍪 | Account information was successfully retrieved.") diff --git a/app/run.sh b/app/run.sh index 3a165bf..a6bac7e 100644 --- a/app/run.sh +++ b/app/run.sh @@ -15,7 +15,7 @@ cd ${BOT_ROOT} # If doesn't have temp/cookies.json, create it -if [ ! -f "./temp/cookies.json" ]; then +if [ ! -f "./temp/auth/cookies.json" ]; then python3 library/init-auth.py fi