mapillary-downloader 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/PKG-INFO +2 -2
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/README.md +1 -1
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/pyproject.toml +1 -1
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/__main__.py +1 -1
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/downloader.py +2 -2
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/worker.py +12 -19
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/LICENSE.md +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/__init__.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/client.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/exif_writer.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/ia_meta.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/logging_config.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/tar_sequences.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/utils.py +0 -0
- {mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/webp_converter.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mapillary_downloader
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.1
|
4
4
|
Summary: Download your Mapillary data before it's gone
|
5
5
|
Author-email: Gareth Davidson <gaz@bitplane.net>
|
6
6
|
Requires-Python: >=3.10
|
@@ -63,7 +63,7 @@ mapillary-downloader --token YOUR_TOKEN --username SOME_USERNAME --output ./down
|
|
63
63
|
| `--quality` | 256, 1024, 2048 or original | `original` |
|
64
64
|
| `--bbox` | `west,south,east,north` | `None` |
|
65
65
|
| `--webp` | Convert to WebP (saves ~70% space) | `False` |
|
66
|
-
| `--workers` | Number of parallel download workers | CPU count
|
66
|
+
| `--workers` | Number of parallel download workers | Half of CPU count |
|
67
67
|
| `--no-tar` | Don't tar sequence directories | `False` |
|
68
68
|
|
69
69
|
The downloader will:
|
@@ -33,7 +33,7 @@ mapillary-downloader --token YOUR_TOKEN --username SOME_USERNAME --output ./down
|
|
33
33
|
| `--quality` | 256, 1024, 2048 or original | `original` |
|
34
34
|
| `--bbox` | `west,south,east,north` | `None` |
|
35
35
|
| `--webp` | Convert to WebP (saves ~70% space) | `False` |
|
36
|
-
| `--workers` | Number of parallel download workers | CPU count
|
36
|
+
| `--workers` | Number of parallel download workers | Half of CPU count |
|
37
37
|
| `--no-tar` | Don't tar sequence directories | `False` |
|
38
38
|
|
39
39
|
The downloader will:
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/downloader.py
RENAMED
@@ -25,14 +25,14 @@ class MapillaryDownloader:
|
|
25
25
|
output_dir: Base directory to save downloads
|
26
26
|
username: Mapillary username (for collection directory)
|
27
27
|
quality: Image quality (for collection directory)
|
28
|
-
workers: Number of parallel workers (default: cpu_count)
|
28
|
+
workers: Number of parallel workers (default: half of cpu_count)
|
29
29
|
tar_sequences: Whether to tar sequence directories after download (default: True)
|
30
30
|
"""
|
31
31
|
self.client = client
|
32
32
|
self.base_output_dir = Path(output_dir)
|
33
33
|
self.username = username
|
34
34
|
self.quality = quality
|
35
|
-
self.workers = workers if workers is not None else os.cpu_count()
|
35
|
+
self.workers = workers if workers is not None else max(1, os.cpu_count() // 2)
|
36
36
|
self.tar_sequences = tar_sequences
|
37
37
|
|
38
38
|
# If username and quality provided, create collection directory
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/worker.py
RENAMED
@@ -4,7 +4,6 @@ import tempfile
|
|
4
4
|
from pathlib import Path
|
5
5
|
import requests
|
6
6
|
from requests.exceptions import RequestException
|
7
|
-
import time
|
8
7
|
from mapillary_downloader.exif_writer import write_exif_to_image
|
9
8
|
from mapillary_downloader.webp_converter import convert_to_webp
|
10
9
|
|
@@ -54,29 +53,23 @@ def download_and_convert_image(image_data, output_dir, quality, convert_webp, ac
|
|
54
53
|
final_path = jpg_path
|
55
54
|
|
56
55
|
# Download image
|
56
|
+
# No retries for CDN images - they're cheap, just skip failures and move on
|
57
57
|
session = requests.Session()
|
58
58
|
session.headers.update({"Authorization": f"OAuth {access_token}"})
|
59
59
|
|
60
|
-
max_retries = 10
|
61
|
-
base_delay = 1.0
|
62
60
|
bytes_downloaded = 0
|
63
61
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
if attempt == max_retries - 1:
|
76
|
-
return (image_id, 0, False, f"Download failed: {e}")
|
77
|
-
|
78
|
-
delay = base_delay * (2**attempt)
|
79
|
-
time.sleep(delay)
|
62
|
+
try:
|
63
|
+
# 60 second timeout for entire download (connection + read)
|
64
|
+
response = session.get(image_url, stream=True, timeout=60)
|
65
|
+
response.raise_for_status()
|
66
|
+
|
67
|
+
with open(jpg_path, "wb") as f:
|
68
|
+
for chunk in response.iter_content(chunk_size=8192):
|
69
|
+
f.write(chunk)
|
70
|
+
bytes_downloaded += len(chunk)
|
71
|
+
except RequestException as e:
|
72
|
+
return (image_id, 0, False, f"Download failed: {e}")
|
80
73
|
|
81
74
|
# Write EXIF metadata
|
82
75
|
write_exif_to_image(jpg_path, image_data)
|
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/__init__.py
RENAMED
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/client.py
RENAMED
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/exif_writer.py
RENAMED
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/ia_meta.py
RENAMED
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/logging_config.py
RENAMED
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/tar_sequences.py
RENAMED
File without changes
|
File without changes
|
{mapillary_downloader-0.3.0 → mapillary_downloader-0.3.1}/src/mapillary_downloader/webp_converter.py
RENAMED
File without changes
|