Added node type info
This commit is contained in:
parent
9866c2b4cb
commit
1ee5601f10
1 changed files with 12 additions and 3 deletions
15
mega.py
15
mega.py
|
@ -21,9 +21,9 @@ class Mega(object):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def login(class_, email, password):
|
def login(class_, email, password):
|
||||||
inst = class_()
|
instance = class_()
|
||||||
inst.login_user(email, password)
|
instance.login_user(email, password)
|
||||||
return inst
|
return instance
|
||||||
|
|
||||||
|
|
||||||
def login_user(self, email, password):
|
def login_user(self, email, password):
|
||||||
|
@ -227,6 +227,15 @@ class Mega(object):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def process_file(self, file):
|
def process_file(self, file):
|
||||||
|
"""
|
||||||
|
Process a file...
|
||||||
|
Possible node types are:
|
||||||
|
0: File
|
||||||
|
1: Dir
|
||||||
|
2: Special - Root/Cloud drive
|
||||||
|
3: Special - Inbox
|
||||||
|
4: Special - Trash
|
||||||
|
"""
|
||||||
if file['t'] == 0 or file['t'] == 1:
|
if file['t'] == 0 or file['t'] == 1:
|
||||||
key = file['k'][file['k'].index(':') + 1:]
|
key = file['k'][file['k'].index(':') + 1:]
|
||||||
key = decrypt_key(base64_to_a32(key), self.master_key)
|
key = decrypt_key(base64_to_a32(key), self.master_key)
|
||||||
|
|
Loading…
Reference in a new issue