· 6 years ago · Sep 01, 2019, 03:28 PM
1hey.
2
3as you might see from my profile I don't upload stuff here, it's way too open for my liking. (off topic) I am however a script kiddie at heart, so I would like to share a simple idea to automate uploading and sharing stuff here using megacmd.
4put megacmd in enviroment variables PATH if you are using windows.
5
6have qBittorrent execute this on torrent completion:
7[code]megaclient put "%F"[/code]
8you could put mplayer or vlc or something in your mega-put.bat if you want to play the releases first.
9
10run this autohotkey script every time storage space is running out
11[code]
12baseGmailUserName = your.email.handle
13currentRandom = % RegExReplace(RandomStr(), "\W", "i")
14currentGmail = %baseGmailUserName%+%currentRandom%@gmail.com
15RunWait, megaclient share -a --with=%baseGmailUserName%@gmail.com *
16RunWait, megaclient logout
17RunWait, megaclient signup %currentGmail% %currentGmail%
18Sleep, 10000
19Run, www.gmail.com
20WinWaitActive, Login - MEGA - Google Chrome,, 120
21 ; waiting two minutes for you to verify the link sent by email
22 ; this is the only user interaction needed
23RunWait, megaclient login %currentGmail% %currentGmail%
24FileAppend, `n%currentGmail%, %USERPROFILE%\Google Drive\megaMail.txt
25MsgBox % ComObjCreate("WScript.Shell").Exec("cmd.exe /q /c megaclient whoami -l").StdOut.ReadAll()
26ExitApp
27
28RandomStr(l = 8, i = 48, x = 122) { ; length, lowest and highest Asc value
29 Loop, %l% {
30 Random, r, i, x
31 s .= Chr(r)
32 }
33 Return, s
34}
35
36[/code]
37
38All this does is makes you stay in the command line, not having to poke around in the browser apart from verifying the email, and it just quietly works in the background.
39No need to keep track of login credentials for Mega accounts, you can manage everything from the one you share to; the first line here just pushes all folders(not the files) to your chosen email.
40It's easy, but I thought some people might not know it's possible to do.
41don't forget to set your gmail address on the first line of the script, not using the @gmail.com part, just the username
42
43also, a script to check for how much is stored on your current logged in account:
44[code]
45GigaBytesInRoot := % ComObjCreate("WScript.Shell").Exec("cmd.exe /q /c megaclient whoami -l | find ""ROOT""").StdOut.ReadAll()
46GigaBytesOccupied := SubStr(GigaBytesInRoot, 24, 5)
47GigaBytesOccupied := Round(GigaBytesOccupied)
48MsgBox, %GigaBytesOccupied% GB stored in root
49[/code]
50
51Edit 2: I changed it to gmail
52Edit 3: if anybody knows an email service that verifies links automatically, please let me know.
53Edit 4