-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmegaauth.py
44 lines (31 loc) · 1.08 KB
/
megaauth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from mega import Mega # importing
import glob, os
from fsplit.filesplit import Filesplit
fs = Filesplit()
inp1=int(input("Enter the split size in KB: "))
fs.split(file="./output/data.file", split_size=inp1*1000, output_dir="./output/divided")
os.remove("./output/data.file")
print("Files are divided, Please check output/divided folder")
mega = Mega() # creating instance of mega
print("\nPlease wait, logging in .....")
m = mega.login("email", "password") #email id and passwor of www.mega.nz
print("login done !! ")
filename=[]
os.chdir("./output/divided")
for file in glob.glob("*.file"):
filename.append(file)
print("No. of division created:",len(filename))
print("Uploading file in progress ....")
for i in range(len(filename)):
file_upload=filename[i]
file = m.upload(file_upload)
link=m.get_upload_link(file)
print("\nLink of file :",link)
os.remove(filename[i])
'''for i in range(len(filename)):
os.remove(filename[i])'''
file = m.upload("fs_manifest.csv")
link=m.get_upload_link(file)
print("Link of manifest :",link)
print("\n\n")
os.remove("fs_manifest.csv")