import requests
import time
import random
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36"
}
def getrandom():
return random.uniform(1,5)#生成一个指定范围内的浮点数
def get_id():
url = "https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js"
res = requests.get(url,headers=headers).json()
lol_list = res["hero"]
list1 = []
for lol in lol_list:
list1.append(lol["heroId"])
return list1
def get_skins(lol_lists):
for i in lol_lists:
sec = getrandom()
time.sleep(sec)
print("--have sleep -- = -- %lf" %sec)
url = "https://game.gtimg.cn/images/lol/act/img/js/hero/{}.js".format(i)
response = requests.get(url, headers=headers).json()
skins_list = response["skins"]
Python 获取LOL皮肤
于 2022-07-02 00:57:23 首次发布