From 17c0b74da1c90b32b29ffe88f14d7f3defe186e5 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 3 Jun 2022 18:54:15 -0700 Subject: [PATCH] Fix parse_url returning string. --- src/mega/mega.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mega/mega.py b/src/mega/mega.py index c7bd38a..c2a50f5 100644 --- a/src/mega/mega.py +++ b/src/mega/mega.py @@ -388,10 +388,10 @@ class Mega: if '/file/' in url: # V2 URL structure url = url.replace(' ', '') - file_id = re.findall(r'\W\w\w\w\w\w\w\w\w\W', url)[0][1:-1] - id_index = re.search(file_id, url).end() + public_handle = re.findall(r'\W\w\w\w\w\w\w\w\w\W', url)[0][1:-1] + id_index = re.search(public_handle, url).end() key = url[id_index + 1:] - return f'{file_id}!{key}' + return (public_handle, key) elif '!' in url: match = re.findall(r'/#F?!(.*)!(.*)', url) if not match: