Skip to content

Instantly share code, notes, and snippets.

@amckinley
Created March 11, 2015 16:55
Show Gist options
  • Save amckinley/2eafbde6d6ee9ecd16be to your computer and use it in GitHub Desktop.
Save amckinley/2eafbde6d6ee9ecd16be to your computer and use it in GitHub Desktop.
import requests
import shutil
def main():
url_base = "http://wow.zamimg.com/images/hearthstone/cards/enus/animated/{}_premium.gif"
card_id = "EX1_067"
file_name = "data/card_images/{}.gif".format(card_id)
res = requests.get(url_base.format(card_id), stream=True)
if res.status_code == 200:
with open(file_name, 'wb') as f:
res.raw.decode_content = True
shutil.copyfileobj(res.raw, f)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment