Created
November 10, 2020 21:34
-
-
Save skydevht/d91d1a94ce38a7464dce327bd07d3d4e to your computer and use it in GitHub Desktop.
Leagues of Legends Art
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://screensaver.riotgames.com/latest/content/data.json | |
jq -r -f filter.jq data.json > down.txt | |
aria2c -c -i down.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. as $contents #saving the original | |
|.locale.translations.en_US as $names #names of each champions | |
|.assetGroups # where the asset id are located | |
|map( | |
select(.tags|any(. == "champions")) | |
) # we select only the champions | |
|map( | |
. as $group | |
|.assets | |
|map( | |
{ | |
id: ., | |
group: $names[$group.nameTranslateId] | |
} | |
) | |
) | |
|flatten # we want a list of asset ids | |
|map( | |
.id as $assetId | |
|.group as $assetGroup | |
|$contents.assets | |
|map(select(.id == $assetId)) # TODO double loop there, reduce? | |
|.[0] | |
|.group = $assetGroup | |
) # getting the asset info | |
|map(select(.tags|any(. == "illustrations"))) # we only want the art | |
|map( | |
("http://screensaver.riotgames.com/latest/content/" + .url|gsub(" "; "%20")) as $link | |
|{ | |
group: .group, | |
link: $link | |
} | |
) # URL | |
|.[] # The items | |
|.link + "\n" + " dir=" + .group # Aria option |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment