Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.30 KB | None | 0 0
  1. #https://acs-garena.leagueoflegends.com/v1/stats/player_history/VN/183140652?begIndex=0&endIndex=20
  2. #https://acs-garena.leagueoflegends.com/v1/stats/game/VN/2973642237
  3. #https://acs-garena.leagueoflegends.com/v1/players?name=zeper&region=VN
  4. #!/usr/bin/python3
  5. aid = 204818346#263524087
  6. import requests, json, sys, time
  7. block = 0
  8. history = []
  9. print("accountId : "+str(aid))
  10. print("summonerName : "+str(aid))
  11. while True:
  12.     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)
  13.     if res['games']['games'] == []:
  14.         break      
  15.     for item in res['games']['games'][::-1]:
  16.         data = {
  17.             "gameId": item['gameId'],
  18.             "gameCreation" : item['gameCreation'],
  19.             "summonerName" : item['participantIdentities'][0]['player']['summonerName']
  20.         }
  21.         if len(history)==0 or data['summonerName'] != history[-1]['summonerName']:
  22.             history.append(data)   
  23.             print("", item['gameId'], "",  time.strftime('%d.%m.%Y %H:%M:%S', time.gmtime(25200+item['gameCreation']/1000.0)), "", data['summonerName'])       
  24.             #print(item['gameId']);
  25.        
  26.     block += 1
  27.     if block % 5 == 0:
  28.         print("progress : "+str(block*20))
  29. with open(str(aid)+".json", "w") as fh:
  30.     json.dump(history, fh)
  31.  
  32. #183140652 zEpEr
  33. #263524087 Cun <3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement