Skip to content

Commit

Permalink
feat: formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
kierankihn committed Dec 22, 2023
1 parent c4b6b12 commit 7e75526
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ def checkin():
"""
for luoguCookie in config.get('token'):

headers={'Cookie': '__client_id=' + luoguCookie.get('__client_id') + '; _uid=' + str(luoguCookie.get('_uid')) + ';',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'}
headers = {'Cookie': '__client_id=' + luoguCookie.get('__client_id') + '; _uid=' + str(luoguCookie.get('_uid')) + ';',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'}

response=requests.get('https://www.luogu.com.cn/index/ajax_punch', headers=headers)
response = requests.get('https://www.luogu.com.cn/index/ajax_punch', headers=headers)

res=json.loads(response.content)
res = json.loads(response.content)

infoLogger.info('Checking in: uid = ' + str(luoguCookie.get('_uid')))

if (response.status_code != 200):
errorLogger.error('Check in failed, error message:\n' + response)
else:
if (res.get('code') == 200):
infoLogger.info('Check in successful!')
infoLogger.info('Checked in successfully!')
if (res.get('code') == 201):
infoLogger.info('Already checked in today.')

Expand Down

0 comments on commit 7e75526

Please sign in to comment.