September 16, 2022 at 5:05 PM
from os import system
from json import loads
try:
from mega import Mega
except:
try:
system("pip install mega.py")
from mega import Mega
except:
print('Pip failed to install MEGA.PY')
exit()
def login(email, password):
mega = Mega()
handle = mega.login(email, password)
return handle
def getUserDetails(handle):
details = handle.get_user()
print(details)
def DownloadFile(handle, fn):
file = handle.find(fn)
m.download(file, '.')
def getFiles(handle):
files = m.get_files()
return files
credentails = loads(open("config.json", "r").read())
heandle = login(credentials["email"], credentials["pwd"])
# Now we can use the handle to apply operations, get data, add folders and more....
class MDownloader:
""" class to download stuff from mega.. """
pass
class MUploader:
""" class to upload files... """
passAnyone interested??
