Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, json
- from time import time
- from urllib.parse import urlencode
- from hashlib import sha512
- if __name__ == '__main__':
- key = 'owo' # CHANGE IT
- secret = 'owo' # CHANGE IT
- contestId = int(input("contestId: "))
- data = urlencode({
- 'apiKey': key,
- 'contestId': contestId,
- # 'count': count,
- # 'from': 1,
- 'time': int(time())
- })
- methods = 'contest.status'
- apiSig = sha512(f'123456/{methods}?{data}#{secret}'.encode()).hexdigest()
- res = requests.get(f'https://codeforces.com/api/{methods}?{data}',params={'apiSig':'123456'+apiSig})
- # print(res)
- print(res.url)
- print(json.loads(res.text))
Add Comment
Please, Sign In to add comment