i'm trying to automate the processing of videos I have on Mega using MegaCMD with python.
The idea is for my computer to download a video locally, process it, and then upload the file to my Mega account.
Im having some trouble with downloading the video through the subprocess command in PowerShell. The download never seems to complete until I close the MegaCMD server using the Windows Task Manager. After that the file type ".getxfer.4528.1.mega" becomes the video. But the idea is to be able to automate the process as i don't have enough space to store all the videos on my computer.
Here is my code in jupyter-notebook:
import subprocess
link = 'https://mega.nz/file/...'
cmds = ['$env:PATH += ";$env:LOCALAPPDATA\MEGAcmd"','mega-get '+link]
encoding = 'latin1'
p = subprocess.Popen('powershell.exe', stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for cmd in cmds:
p.stdin.write(cmd.encode("utf-8") + b"\n")
p.stdin.close()
print(p.stdout.read())
If anyone has any ideas on how to fix the problem it would be a great help!
Note: I dont use the Mega library of python because the videos contain sensitive research material and the account has double 2AF authentication and the library does not have the option to access it that way. Thats why im using Mega