Code Monkey home page Code Monkey logo

megatools-python's Introduction

MEGA-Tools Python

MacOS

  1. Install megatools using Homebrew
brew install megatools 
  1. 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

How to

Creating default instance

  1. Using default /usr/local/bin directory for binary files and mega.rc file in current working directory.
from megatools import Mega
m = Mega()
  1. Passing binary directory path and mega.rc location.
from megatools import Mega
m = Mega(megaPath='/usr/local/bin/', configPath='/Users/jay/mega.rc')

Usage

Show total available, used, or free space in the cloud. Default unit is in megabytes (MB).

m.df('/Root')

To display used or free space in gigabytes,

m.df('/Root', 'g')

List directories.

m.ls('/Root/Games')

Upload a file.

m.put('/Users/jay/Desktop/test.pdf', '/Root')

Remove a file or directory.

m.rm('/Root/Games')

Make a directory.

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')

Download contents of a remote folder to a local folder.

m.copy('/Users/jay/Desktop/Codes', '/Root/Codes', download=True)

Download a remote file.

m.get('/Root/Documents/test.pdf')

Get file download link.

m.url('/Root/Documents/test.pdf')

Download file using the mega link.

m.dl('https://mega.nz/#!2eoEhAaS!olmfrMsNeyLiifXu6D6ps9CD7ePYSYGCSjEYAoiQl4')

megatools-python's People

Contributors

jayluxferro avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.