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