Created
March 11, 2015 16:55
-
-
Save amckinley/2eafbde6d6ee9ecd16be to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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