失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 一键获取LOL英雄联盟所有英雄技能图片

一键获取LOL英雄联盟所有英雄技能图片

时间:2024-05-17 20:06:38

相关推荐

一键获取LOL英雄联盟所有英雄技能图片

0x1获取游戏数据

http://127.0.0.1:2999/liveclientdata/allgamedata

0x2获取英雄数据

/images/lol/act/img/js/heroList/hero_list.js

0x3获取技能数据

/images/lol/act/img/js/hero/{英雄的heroId}.js

0x0脚本源码

import requestsimport jsonheaders = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36',}def alllist():"""获取所有英雄"""url = "/images/lol/act/img/js/heroList/hero_list.js"try:r = requests.get(url=url, headers=headers,)r.raise_for_status()r.encoding = r.apparent_encodingprint(r.text)return r.textexcept:return '操作异常'def dw_png(url):try:r = requests.get(url=url, headers=headers, )print(1)r.raise_for_status()print(2)r.encoding = r.apparent_encodingprint(url[url.rfind('/'):-1])filename= "./img"+url[url.rfind('/'):]print("文件名为:" + filename)# file_handle = open(filename, mode='w')open(filename, 'wb').write(r.content)print(4)# file_handle.write(r.content)# file_handle.close()print("下载完成:"+filename)return r.textexcept:print('下载图片操作异常')def getdata(heroid):url = "/images/lol/act/img/js/hero/"+heroid+".js"try:r = requests.get(url=url, headers=headers, )r.raise_for_status()r.encoding = r.apparent_encodingfile_handle = open(heroid + '.json', mode='w')file_handle.write(r.text)file_handle.close()# print(r.text)data = json.loads(r.text)for i in data["spells"]:if i["spellKey"]=="q" or i["spellKey"]=="w" or i["spellKey"]=="e" or i["spellKey"]=="r":print("开始下载任务:"+i["abilityIconPath"])dw_png(i["abilityIconPath"])return r.textexcept:return '操作异常'def zhaohaunsh():print("开始处理召唤师技能图片")list=["https://ossweb-/images/lol/img/spell/SummonerBarrier.png","https://ossweb-/images/lol/img/spell/SummonerBoost.png","https://ossweb-/images/lol/img/spell/SummonerDot.png","https://ossweb-/images/lol/img/spell/SummonerExhaust.png","https://ossweb-/images/lol/img/spell/SummonerFlash.png","https://ossweb-/images/lol/img/spell/SummonerHaste.png","https://ossweb-/images/lol/img/spell/SummonerHeal.png","https://ossweb-/images/lol/img/spell/SummonerMana.png","https://ossweb-/images/lol/img/spell/SummonerPoroRecall.png","https://ossweb-/images/lol/img/spell/SummonerPoroThrow.png","https://ossweb-/images/lol/img/spell/SummonerSmite.png","https://ossweb-/images/lol/img/spell/SummonerSnowball.png","https://ossweb-/images/lol/img/spell/SummonerTeleport.png"]for i in list:print("开始下载任务:" + i)dw_png(i)if __name__ == '__main__':zhaohaunsh()LOL_list = json.loads(alllist())for i in LOL_list["hero"]:id = i["heroId"]getdata(id)

如果觉得《一键获取LOL英雄联盟所有英雄技能图片》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。