diff --git a/.gitignore b/.gitignore index ccd110d..81f6745 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ __pycache__/ build/ dist/ *.spec -secrets_variables.sh \ No newline at end of file +secrets_variables.sh +script_bash_get* diff --git a/mapillary_download.py b/mapillary_download.py index 6b16554..ffdc8e8 100644 --- a/mapillary_download.py +++ b/mapillary_download.py @@ -22,7 +22,7 @@ session.mount("https://", HTTPAdapter(max_retries=retries_strategies)) def parse_args(argv=None): parser = argparse.ArgumentParser() - parser.add_argument("access_token", type=str, help="Your mapillary access token") + parser.add_argument("--access_token", type=str, help="Your mapillary access token") parser.add_argument( "--sequence_ids", type=str, @@ -47,6 +47,12 @@ def parse_args(argv=None): default=None, help="How many images you want to download", ) + parser.add_argument( + "--username", + type=str, + default=None, + help="The username to separate sequences for each user", + ) parser.add_argument( "--overwrite", default=False, @@ -231,7 +237,7 @@ if __name__ == "__main__": with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor: for i, image_data in enumerate(images_data): # create a folder for each unique sequence ID to group images by sequence - path_destination = os.path.join(args.destination, image_data["sequence_id"]) + path_destination = os.path.join(args.destination, args.username, image_data["sequence_id"]) if not os.path.exists(path_destination): os.makedirs(path_destination) date_time_image_filename = (