meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.
MIT License
552 stars 135 forks source link

How to obtain images for rune categories? #259

Closed vivipiu closed 5 years ago

vivipiu commented 5 years ago

Hey, I couldn't find a way to get the image url for rune categories like Domination, Sorcery etc. Any idea how I can get it through cassiopeia?

Thanks!

jjmaldonis commented 5 years ago

Here's an example:

runes = cass.Runes(region="NA")
rune = runes[0]
print(rune.image.url)

Outputs: https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/Domination/Electrocute/Electrocute.png

Does that help?

vivipiu commented 5 years ago

It doesn't unfortunately since I'm looking for Domination's image url: https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/7200_Domination.png

jjmaldonis commented 5 years ago

Right now we unfortunately don't have these URLs in Cass, but you can find all the filenames in the runesReforged.json file in datadragon.

vivipiu commented 5 years ago

Awe, okay. Thank you for the help!

jjmaldonis commented 5 years ago

Hey you can now access these images from the rune path objects using .image_url. For example:

runes = cass.Runes(region="NA")
rune = runes[0]
url = rune.path.image_url