简体   繁体   中英

How do I download file on Mega since it does not work using urllib.urlretrieve?

When I try urllib.urlretrieve(url) is does not work as expected and returns nothing when I try it on MEGA How could I :

  • Download a file using python (windows)
  • Upload a file using python (windows)

Thanks

Mega is encrypted client-side, using js, so your only option might be to use a headless browser like phantomjs . or the provided c++ sdk

This library is deprecated since April 28, 2018, but if you only need download a file still works with python 2.7

You can install it with this command:

pip install mega.py

Here is an example:

from mega import Mega

mega = Mega()

m = mega.login()

m.download_url('https://mega.nz/#!EBZCXCjZ!tCUNt4nempTV9PQi4Rq6RFuDIU8t_87gXdFxJmmqFKo')

Also you can see the project on Github .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM