Cleanup
This commit is contained in:
parent
abd2fea76f
commit
322984be06
@ -33,12 +33,13 @@ class MediaType(enum.Enum):
|
|||||||
def download(url):
|
def download(url):
|
||||||
client = anki.sync.AnkiRequestsClient()
|
client = anki.sync.AnkiRequestsClient()
|
||||||
client.timeout = setting('webTimeout') / 1000
|
client.timeout = setting('webTimeout') / 1000
|
||||||
|
|
||||||
resp = client.get(url)
|
resp = client.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code != 200:
|
||||||
return client.streamContent(resp)
|
|
||||||
else:
|
|
||||||
raise Exception('{} download failed with return code {}'.format(url, resp.status_code))
|
raise Exception('{} download failed with return code {}'.format(url, resp.status_code))
|
||||||
|
|
||||||
|
client.streamContent(resp)
|
||||||
|
|
||||||
|
|
||||||
def api(*versions):
|
def api(*versions):
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
|
Loading…
Reference in New Issue
Block a user