mega.py
mega.py copied to clipboard
struct.error while decrypting the file_key
While i did not find a way to to download a file from a public folder with one mega method, i had to do it using the code from StackOverflow: https://stackoverflow.com/questions/64488709/how-can-i-list-the-contents-of-a-mega-public-folder-by-its-shared-url-using-meg I,ve downloaded the nodes list with ids and encrypted keys of the files. But when i try to decrypt them, i get an error:
Why should we even bother with this decryptyng stuff, dealing with public folders?
Ooooh, i did it. I had to rewrite _download_file method and use methods of BlueGreenMagick from StackOverflow to simply download a file from public folder. By the way there is a wrong indent of the last block in _download_file. It tries to move a file before it is downloaded and released by a tempfile.NamedTemporaryFile context manager. It's better to put it otside of the CM.