Return exported urls as dict of {id: url}.
This commit is contained in:
parent
400701f50d
commit
66c0c8f179
1 changed files with 4 additions and 4 deletions
|
@ -437,11 +437,11 @@ class Mega:
|
||||||
"Can't get a public link from that file "
|
"Can't get a public link from that file "
|
||||||
"(is this a shared file?)"
|
"(is this a shared file?)"
|
||||||
)
|
)
|
||||||
urls = []
|
urls = {}
|
||||||
for (file, public_handle) in zip(files, public_handles):
|
for (file, public_handle) in zip(files, public_handles):
|
||||||
decrypted_key = crypto.a32_to_base64(file['key'])
|
decrypted_key = crypto.a32_to_base64(file['key'])
|
||||||
url = f'{self.schema}://{self.domain}/#!{public_handle}!{decrypted_key}'
|
url = f'{self.schema}://{self.domain}/#!{public_handle}!{decrypted_key}'
|
||||||
urls.append(url)
|
urls[file['h']] = url
|
||||||
return urls
|
return urls
|
||||||
|
|
||||||
def _node_data(self, node):
|
def _node_data(self, node):
|
||||||
|
@ -646,9 +646,9 @@ class Mega:
|
||||||
node = self.find(path)
|
node = self.find(path)
|
||||||
|
|
||||||
node_data = self._node_data(node)
|
node_data = self._node_data(node)
|
||||||
is_file_node = node_data['t'] == NODE_TYPE_FILE
|
if node_data['t'] == NODE_TYPE_FILE:
|
||||||
if is_file_node:
|
|
||||||
return self.export_files(node)
|
return self.export_files(node)
|
||||||
|
|
||||||
if node:
|
if node:
|
||||||
try:
|
try:
|
||||||
# If already exported
|
# If already exported
|
||||||
|
|
Loading…
Reference in a new issue