Skip to content

Instantly share code, notes, and snippets.

@skydevht
Created November 10, 2020 21:34
Show Gist options
  • Save skydevht/d91d1a94ce38a7464dce327bd07d3d4e to your computer and use it in GitHub Desktop.
Save skydevht/d91d1a94ce38a7464dce327bd07d3d4e to your computer and use it in GitHub Desktop.
Leagues of Legends Art
wget http://screensaver.riotgames.com/latest/content/data.json
jq -r -f filter.jq data.json > down.txt
aria2c -c -i down.txt
. 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