Fix parse_url returning string.
This commit is contained in:
parent
d208e5697b
commit
17c0b74da1
1 changed files with 3 additions and 3 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue