mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
postprocess: return und if we cant get the right language
This commit is contained in:
parent
a9c579ba5f
commit
80992f8664
@ -40,8 +40,11 @@ class postprocess(object):
|
||||
try:
|
||||
r = post(url, data=dumps(payload), headers=headers, timeout=30) # Note: reasonable timeout i guess? svtplay-dl is mainly used while multitasking i presume, and it is heroku after all (fast enough)
|
||||
if r.status_code == codes.ok:
|
||||
response = r.json()
|
||||
return response['language']
|
||||
try:
|
||||
response = r.json()
|
||||
return response['language']
|
||||
except TypeError:
|
||||
return 'und'
|
||||
else:
|
||||
log.error("Server error appeared. Setting language as undetermined.")
|
||||
return 'und'
|
||||
|
Loading…
Reference in New Issue
Block a user