Fix export_files response of only one file.

This commit is contained in:
voussoir 2021-08-31 01:29:38 -07:00
parent 3507b72eb5
commit 46ce080a7f
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -611,6 +611,9 @@ class Mega:
self._api_request(request)
request = [self.draft_get_file_link(node) for node in nodes]
response = self._api_request(request)
# When there's only one file
if isinstance(response, str) and response.startswith('https://mega'):
response = [response]
url_map = {node['h']: url for (node, url) in zip(nodes, response)}
return url_map