Auth Cache
This commit is contained in:
parent
b5ca577151
commit
96748fb97f
4 changed files with 6 additions and 6 deletions
6
.github/workflows/python-app.yml
vendored
6
.github/workflows/python-app.yml
vendored
|
|
@ -36,11 +36,11 @@ jobs:
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
# Cache cookie.json
|
# Cache cookie.json
|
||||||
- name: Cache app/temp/cookie.json
|
- name: Cache app/temp/auth
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/cookie.json
|
path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth
|
||||||
key: ${{ runner.os }}-cookie-${{ hashFiles('app/temp/cookie.json') }}
|
key: ${{ runner.os }}-cookie-${{ hashFiles('/home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cookie-
|
${{ runner.os }}-cookie-
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ cl.get_settings()
|
||||||
|
|
||||||
json.dump(
|
json.dump(
|
||||||
cl.get_settings(),
|
cl.get_settings(),
|
||||||
open(f'{ROOT}/temp/cookies.json', 'w')
|
open(f'{ROOT}/temp/auth/cookies.json', 'w')
|
||||||
)
|
)
|
||||||
|
|
||||||
print("🍪 | Account information was successfully retrieved.")
|
print("🍪 | Account information was successfully retrieved.")
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ else:
|
||||||
MLSV_YMD = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')
|
MLSV_YMD = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')
|
||||||
|
|
||||||
print("🍪 | Retrieving saved account information.")
|
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")
|
cl.set_proxy("socks5h://localhost:9999")
|
||||||
|
|
||||||
print("🍪 | Account information was successfully retrieved.")
|
print("🍪 | Account information was successfully retrieved.")
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ cd ${BOT_ROOT}
|
||||||
|
|
||||||
|
|
||||||
# If doesn't have temp/cookies.json, create it
|
# 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
|
python3 library/init-auth.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue