split get_id_from_public_handle

master
Christian Kornacker 2013-05-06 17:50:40 +02:00
parent 24f44137a1
commit 08b76baced
1 changed files with 5 additions and 1 deletions

View File

@ -276,9 +276,13 @@ class Mega(object):
#get node data #get node data
#TODO fix this function #TODO fix this function
node_data = self.api_request({'a': 'f', 'f': 1, 'p': public_handle}) node_data = self.api_request({'a': 'f', 'f': 1, 'p': public_handle})
return self.get_id_from_node_data(node_data)
def get_id_from_node_data(self, node_data):
#determine node id
node_id = None node_id = None
#determine node id
for i in node_data['f']: for i in node_data['f']:
if i['h'] is not u'': if i['h'] is not u'':
node_id = i['h'] node_id = i['h']