sbtools/downloader.py
2016-08-06 15:00:05 +02:00

17 lines
861 B
Python
Executable file

#!/usr/bin/env python3
def argparser():
parser = argparse.ArgumentParser()
parser.add_argument("url", type=str, nargs="+", help="photo URL as copied from message window")
group = parser.add_mutually_exclusive_group()
group.add_argument("-s", "--sender", type=str, help="name of the sender, puts images into subdirectory")
group.add_argument("-g", "--get-urls", help="get URLs only, don't download", action="store_true")
group2 = parser.add_mutually_exclusive_group()
group2.add_argument("-S", "--shut-up", help="don't output any notices and warnings", action="store_true")
group2.add_argument("-v", "--verbose", help="more verbose output", action="store_true")
return parser.parse_args()
if __name__ == "__main__":
args = argparser()
for url in args.url:
phototools.processURL(url, args.sender, args.get_urls, args.verbose, args.shut_up)