Skip to content

Instantly share code, notes, and snippets.

@Ehsanul-Hoque
Last active April 5, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ehsanul-Hoque/7174e42ea310eca03e60214a2a3405c5 to your computer and use it in GitHub Desktop.
Save Ehsanul-Hoque/7174e42ea310eca03e60214a2a3405c5 to your computer and use it in GitHub Desktop.
Python code for generating release apk automatically (Part 4)
import requests
# ...
# Function for downloading icon
def downloadIcon(item_dict):
print('\nDOWNLOADING icon file...')
url = item_dict[constants.JSON_KEY_APP_ICON]
try:
r = requests.get(url, allow_redirects=True)
with open(constants.APP_ICON_FILE, 'wb') as file_object:
file_object.write(r.content)
print('Icon file downloaded.')
return True
except:
print('Icon file download failed!')
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment