Exemplo n.º 1
0
    def __init__(self, destination, processor_id):
        self.api = mega.MegaApi('vIJE2YwK')
        self.destination = destination
        self.event = threading.Event()
        self.log = logging.getLogger('processor')
        self.status = ProcessorStatus.IDLE
        self.processor_id = processor_id
        self._updates = queue.Queue()

        self.current_file_id = None
        self._files: typing.List[NodeWrapper] = []
Exemplo n.º 2
0
class DownloadProcessor(multiprocessing.Process):
        super().__init__(name='DownloadQueueProcessor', daemon=False)

        self.api = mega.MegaApi('vIJE2YwK')
        self.destination = destination
        self.event = threading.Event()
        self.log = logging.getLogger('processor')
        self.status = ProcessorStatus.IDLE
        self.processor_id = processor_id
        self._updates = queue.Queue()

        self.current_file_id = None
        self._files: typing.List[NodeWrapper] = []
Exemplo n.º 3
0
def one_shot(url, dest):
    os.makedirs(dest, exist_ok=True)

    api = mega.MegaApi(MEGA_API_KEY)
    processor = UrlProcessor(api)
    file_nodes = processor.process(url)

    processor = FileNodeDownloader(api)
    for fname, file_node in file_nodes:
        fname = os.path.join(dest, fname)

        file_listener = FileListener()
        processor.download(fname, file_node, file_listener)
        file_listener.wait()
Exemplo n.º 4
0
import mega

api = mega.MegaApi('test')
print(dir(api))
Exemplo n.º 5
0
def main():
    api = mega.MegaApi("test")
    pprint.pprint(dir(api))