Skip to content

Instantly share code, notes, and snippets.

@carlesso
Created February 13, 2013 22:07
Show Gist options
  • Save carlesso/4948807 to your computer and use it in GitHub Desktop.
Save carlesso/4948807 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from mega import Mega
import argparse
parser = argparse.ArgumentParser(description='Mega.py download utility')
parser.add_argument('-i', '--input-file', action='store', dest='input_file', help="get urls from input file")
parser.add_argument('urls', action='store', nargs='*', help='an url from mega.co.nz to be downloaded')
args = parser.parse_args()
mega = Mega()
if args.input_file is not None:
for url in open(args.input_file).readlines():
if url.startswith("#"):
continue
mega.download_url(url)
elif args.urls is not None:
for url in args.urls:
mega.download_url(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment