#coding = utf-8
import requests
import os
list_all = []
header = {'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) Chrome/65.0.3325.181'}
all_hero_url = "https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js"
hero_list = requests.get(url=all_hero_url,headers = header)
all_data = hero_list.json()
all_url = all_data["hero"]
for i in all_url:
list_all.append(i["heroId"])
for i in list_all:
skin_all = "https://game.gtimg.cn/images/lol/act/img/js/hero/"+str(i)+".js?ts=2871670"
skin_req = requests.get(url=skin_all,headers = header)
all_skin = skin_req.json()["skins"]
for i in all_skin:
if i["mainImg"] =="":
continue
else:
eve_skin = requests.get(i["mainImg"], headers=header)
with open("./英雄联盟皮肤/" + str(i["name"]).replace("/","") + ".jpg", "wb") as e:
e.write(eve_skin.content)
if os.path.exists("./英雄联盟皮肤/" + str(i["name"]).replace("/","") + ".jpg"):
print("该皮肤已经存在")
else:
print("正在下载" + str(i["name"]).replace("/", "") + ".jpg")
英雄联盟皮肤获取
最新推荐文章于 2024-09-16 21:12:47 发布