Last active
January 12, 2020 00:44
-
-
Save krruzic/598a8a5a952828e25673f555a00e8b75 to your computer and use it in GitHub Desktop.
Smash Ultimate renders courtesy of WarChamp7
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
from bs4 import BeautifulSoup | |
import requests | |
homepage = requests.get("https://apps.warchamp7.com/smash/rosterUlt/") | |
hp_soup = BeautifulSoup(homepage.text, features="lxml") | |
characters = hp_soup.find(id="IconList").find_all("label") | |
names = ["_".join(character["for"].split("_")[1:]) for character in characters] | |
portraits = {} | |
for name in names[0:-1]: # remove random | |
print(f'Saving CSS renders for: {name}') | |
portraits[name] = [f'https://apps.warchamp7.com/smash/rosterUlt/ult/chara_1_{name}_0{i}.png' for i in range(0,8)] | |
for idx, portrait in enumerate(portraits[name]): | |
img = requests.get(portrait) | |
with open(f'assets/{name}_0{idx}.png', 'wb') as f: | |
f.write(img.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mkdir assets/ && python ssbu_css.py