forked from tykayn/mapillary_download
correct typos, adapt chmod of bash scripts
Signed-off-by: Matthias <matthias@pebble>
This commit is contained in:
parent
7979c16033
commit
ef17b184e0
11
README.md
11
README.md
@ -3,9 +3,9 @@ Simple code to download images in one or several mapillary sequences. The images
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
### Setup env variables
|
### Setup env variables
|
||||||
copy the secret variables files to setup your maipllary dev token, and your panoramax OpenStreetMap token.
|
copy the secret variables files to setup your mapillary dev token, and your panoramax OpenStreetMap token.
|
||||||
```Shell
|
```Shell
|
||||||
cp secrets_variables_examples.sh secrets_variables.sh
|
cp secrets_variables_example.sh secrets_variables.sh
|
||||||
editor secrets_variables.sh
|
editor secrets_variables.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -13,10 +13,13 @@ editor secrets_variables.sh
|
|||||||
To avoid to download everything at once, this is a 2 steps process:
|
To avoid to download everything at once, this is a 2 steps process:
|
||||||
- 1/ We set a list of users for which we want to get the list of sequences to download, and get a bash script for each user.
|
- 1/ We set a list of users for which we want to get the list of sequences to download, and get a bash script for each user.
|
||||||
Change the list of users in the batch file `batch_get_username.sh`.
|
Change the list of users in the batch file `batch_get_username.sh`.
|
||||||
change the access token with your access token and the sequence ids with the ids of the sequences you want to download
|
|
||||||
```bash
|
```bash
|
||||||
usernames=( "someone_having_nice_pictures" "someone_else" "oh_look_a_these_usernames" ) # use real accounts, it might work better
|
usernames=( "someone_having_nice_pictures" "someone_else" "oh_look_a_these_usernames" ) # use real accounts, it might work better
|
||||||
```
|
```
|
||||||
|
then, execute:
|
||||||
|
```bash
|
||||||
|
./batch_get_username.sh
|
||||||
|
```
|
||||||
This will give you a few files that the other scripts will use to generate a script to download all sequences of each user. One user, one bash script generated.
|
This will give you a few files that the other scripts will use to generate a script to download all sequences of each user. One user, one bash script generated.
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +104,7 @@ python3 -m venv mly_venv
|
|||||||
source mly_venv/bin/activate
|
source mly_venv/bin/activate
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
Then you can run `python mapillary_download "MLY|xxxx|xxxxxxx" --sequence_ids xxxxxxxxxxx`
|
Then you can run `python mapillary_download.py "MLY|xxxx|xxxxxxx" --sequence_ids xxxxxxxxxxx`
|
||||||
When you're done with the script, simply run `deactivate` to exit the virtual environnement.
|
When you're done with the script, simply run `deactivate` to exit the virtual environnement.
|
||||||
|
|
||||||
On windows you can create a virtual environnement too, or use the prebuilt `mapillary_download.exe` available on the release page.
|
On windows you can create a virtual environnement too, or use the prebuilt `mapillary_download.exe` available on the release page.
|
||||||
|
2
batch_get_username.sh
Normal file → Executable file
2
batch_get_username.sh
Normal file → Executable file
@ -28,6 +28,8 @@ echo "---------- utilisateur: $username"
|
|||||||
|
|
||||||
if [ ! -f "out_$username.json" ]; then
|
if [ ! -f "out_$username.json" ]; then
|
||||||
bash find_user_id.sh $username
|
bash find_user_id.sh $username
|
||||||
|
#FIXME: find_user_id.sh is not part of this repo. maybe get_user.sh?
|
||||||
|
#FIXME: also check if file is empty?
|
||||||
fi
|
fi
|
||||||
# Vérifier si le fichier sequences_$username.txt existe
|
# Vérifier si le fichier sequences_$username.txt existe
|
||||||
if [ ! -f "sequences_$username.txt" ]; then
|
if [ ! -f "sequences_$username.txt" ]; then
|
||||||
|
@ -7,7 +7,7 @@ import argparse
|
|||||||
|
|
||||||
def parse_args(argv =None):
|
def parse_args(argv =None):
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--username', type=str, help='Username to get the sequences id of')
|
parser.add_argument('--username', type=str, help='Username to get the sequences id of', required=True)
|
||||||
parser.add_argument('--dev_token', type=str, help='Your mapillary developer token')
|
parser.add_argument('--dev_token', type=str, help='Your mapillary developer token')
|
||||||
parser.add_argument('--max_sequence', type=str, help='Username to get the sequences id of')
|
parser.add_argument('--max_sequence', type=str, help='Username to get the sequences id of')
|
||||||
|
|
||||||
|
0
get_user.sh
Normal file → Executable file
0
get_user.sh
Normal file → Executable file
@ -1,5 +1,7 @@
|
|||||||
# scripts common shared variables
|
# scripts common shared variables
|
||||||
# this is to copy as a file named "secrets_variables.sh" which is ignored in this git repo
|
# this is to copy as a file named "secrets_variables.sh" which is ignored in this git repo
|
||||||
|
|
||||||
|
# Mapillary:
|
||||||
|
# register an application at https://www.mapillary.com/dashboard/developers
|
||||||
|
# read permissions needed, all other fields can be random. copy the client token
|
||||||
export MAPILLARY_DEV_TOKEN="MLY|blahblah_replace_it"
|
export MAPILLARY_DEV_TOKEN="MLY|blahblah_replace_it"
|
||||||
|
Loading…
Reference in New Issue
Block a user