Created
September 16, 2017 03:41
-
-
Save khoben/1bdb2912f04e40e42752e2de3336d18e to your computer and use it in GitHub Desktop.
Grab all twitch emotes by name
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
import urllib.request | |
import os | |
import json | |
JSON_EMOTE_LIST_URL = 'https://twitchemotes.com/api_cache/v2/global.json' | |
if not os.path.exists('./emotes'): | |
os.makedirs('./emotes') | |
emotes = json.load(urllib.request.urlopen(JSON_EMOTE_LIST_URL)) | |
for code, emote in emotes['emotes'].items(): | |
emote_url = emotes['template']['large'].replace('{image_id}', str(emote['image_id'])) | |
urllib.request.urlretrieve(emote_url, | |
'./emotes/' + code + '.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment