Remove "unknown download error" prefix

The reason for the error is known and is returned.
This commit is contained in:
Cadence Ember 2021-04-28 00:08:07 +12:00
parent 7737ea3ba5
commit e3595a455e
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
1 changed files with 6 additions and 1 deletions

View File

@ -184,8 +184,13 @@ def extract_video(id):
"error": "Received unexpected status code {}.".format(e.exc_info[1].code)
}
else:
if e.exc_info and e.exc_info[1]:
message = str(e.exc_info[1])
message = message.replace("Video unavailable\n", "") # Remove redundant lead string, if present
else:
message = "Unknown extraction error."
result = {
"error": "Unknown download error: {}".format(e.exc_info[1])
"error": message
}
except Exception: