mega.py icon indicating copy to clipboard operation
mega.py copied to clipboard

Import Public Folder

Open DorsiFlexionDev opened this issue 5 years ago • 4 comments

I want to access a certain file inside a public folder. Is there a method that returns an instance of public folder? I tried to use import_public_url(folder_url) but I get a KeyError: 'Url key missing'.

DorsiFlexionDev avatar Jun 29 '20 13:06 DorsiFlexionDev

Hello there! @DorsiFlexionDev I also had similar issue with this import_public_url() function. I dig into the source code of the module and I discovered that the part of parsing url is not updated to the current format of urls. The source code here splits the Decryption Key and the Link with "!", while today most of the links (if not all of them) use "#" between them. (Look at the function at line 191 in the source code of "src/mega.py". Another struggle - In the URL - it need a "#!" after the "mega.nz/folder/" or "mega.nz/file/" part in the URL. Same here, IDK why its like that, most of the links are not like that. So try to edit the module (which I didn't succeed in, or change how you enter your URLs. BTW, I also tried to use this function and it's still failed. I'll open a different discussion about that.

knowledgeorange avatar Jul 07 '20 08:07 knowledgeorange

Yup ! Same problem is arising while I am using it , Developers are requested to update this as soon as possible

Happy-Kunal avatar Nov 13 '20 13:11 Happy-Kunal

If anyone needs it, I've posted the code I used to get files from public folders on Stack Overflow.

BlueGreenMagick avatar Aug 03 '21 15:08 BlueGreenMagick

If anyone needs it, I've posted the code I used to get files from public folders on Stack Overflow.

thank you :+1:

Happy-Kunal avatar Aug 07 '21 17:08 Happy-Kunal