Spaces:
Paused
Paused
File size: 690 Bytes
4691839 72aa956 4691839 4f2a8be 4691839 | 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 | import os
import shutil
from mega import Mega
from others import *
def download_mega(name, directory, url):
if not os.path.exists(directory):
os.makedirs(directory)
mega = Mega()
m = mega.login()
# Download the file to a temporary location
file = m.download_url(url, dest_filename=name)
# Rename the file and move it to the specified directory
filename = os.path.join(directory, file)
shutil.move(file, filename)
return filename
def mega_dl(url, judul):
judul = judul + '.mp4'
download = '/home/user/app/Mega'
filename = download_mega(judul, download, url)
output_file = convert_videos(720, download)
return output_file
|