Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://acs-garena.leagueoflegends.com/v1/stats/player_history/VN/183140652?begIndex=0&endIndex=20
- #https://acs-garena.leagueoflegends.com/v1/stats/game/VN/2973642237
- #https://acs-garena.leagueoflegends.com/v1/players?name=zeper®ion=VN
- #!/usr/bin/python3
- aid = 204818346#263524087
- import requests, json, sys, time
- block = 0
- history = []
- print("accountId : "+str(aid))
- print("summonerName : "+str(aid))
- while True:
- res = json.loads(requests.get("https://acs-garena.leagueoflegends.com/v1/stats/player_history/VN/"+str(aid)+"?begIndex="+str(block*20)+"&endIndex="+str(block*20+20)).text)
- if res['games']['games'] == []:
- break
- for item in res['games']['games'][::-1]:
- data = {
- "gameId": item['gameId'],
- "gameCreation" : item['gameCreation'],
- "summonerName" : item['participantIdentities'][0]['player']['summonerName']
- }
- if len(history)==0 or data['summonerName'] != history[-1]['summonerName']:
- history.append(data)
- print("", item['gameId'], "", time.strftime('%d.%m.%Y %H:%M:%S', time.gmtime(25200+item['gameCreation']/1000.0)), "", data['summonerName'])
- #print(item['gameId']);
- block += 1
- if block % 5 == 0:
- print("progress : "+str(block*20))
- with open(str(aid)+".json", "w") as fh:
- json.dump(history, fh)
- #183140652 zEpEr
- #263524087 Cun <3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement