Created
February 13, 2013 22:07
-
-
Save carlesso/4948807 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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