Fix parse_url returning string.

This commit is contained in:
voussoir 2022-06-03 18:54:15 -07:00
parent d208e5697b
commit 17c0b74da1
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -388,10 +388,10 @@ class Mega:
if '/file/' in url: if '/file/' in url:
# V2 URL structure # V2 URL structure
url = url.replace(' ', '') url = url.replace(' ', '')
file_id = re.findall(r'\W\w\w\w\w\w\w\w\w\W', url)[0][1:-1] public_handle = 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() id_index = re.search(public_handle, url).end()
key = url[id_index + 1:] key = url[id_index + 1:]
return f'{file_id}!{key}' return (public_handle, key)
elif '!' in url: elif '!' in url:
match = re.findall(r'/#F?!(.*)!(.*)', url) match = re.findall(r'/#F?!(.*)!(.*)', url)
if not match: if not match: