- Install megatools using Homebrew
brew install megatools
- Create a
mega.rc
file in your home directory or in the current working directory. The contents of the file in shown below
[Login]
Username = your@email
Password = yourpassword
[Network]
# 1MiB/s
SpeedLimit = 1024
# Use over TOR or any socks5 proxy
Proxy = socks5://127.0.0.1:9050
ParallelTransfers = 2
- Using default
/usr/local/bin
directory for binary files andmega.rc
file in current working directory.
from megatools import Mega
m = Mega()
- Passing binary directory path and
mega.rc
location.
from megatools import Mega
m = Mega(megaPath='/usr/local/bin/', configPath='/Users/jay/mega.rc')
m.df('/Root')
To display used or free space in gigabytes,
m.df('/Root', 'g')
m.ls('/Root/Games')
m.put('/Users/jay/Desktop/test.pdf', '/Root')
m.rm('/Root/Games')
m.md('/Root/Codes')
Upload contents of a folder to the remote server. The remote directory should have been created using the .md
method.
m.copy('/Users/jay/Desktop/Codes', '/Root/Codes')
m.copy('/Users/jay/Desktop/Codes', '/Root/Codes', download=True)
m.get('/Root/Documents/test.pdf')
m.url('/Root/Documents/test.pdf')
m.dl('https://mega.nz/#!2eoEhAaS!olmfrMsNeyLiifXu6D6ps9CD7ePYSYGCSjEYAoiQl4')