Skip to content

Instantly share code, notes, and snippets.

@khoben
Created September 16, 2017 03:41
Show Gist options
  • Save khoben/1bdb2912f04e40e42752e2de3336d18e to your computer and use it in GitHub Desktop.
Save khoben/1bdb2912f04e40e42752e2de3336d18e to your computer and use it in GitHub Desktop.
Grab all twitch emotes by name
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