mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
39 lines
680 B
Python
Executable File
39 lines
680 B
Python
Executable File
#!/usr/bin/env -S uv run --script
|
|
# /// script
|
|
# requires-python = ">=3.13"
|
|
# dependencies = [
|
|
#
|
|
# ]
|
|
# ///
|
|
import subprocess
|
|
from pathlib import Path
|
|
from urllib.parse import urlparse
|
|
|
|
|
|
rclone_config = Path('../../config/rclone.conf')
|
|
|
|
url = 'https://download.mapterhorn.com/planet.pmtiles'
|
|
|
|
# Parse URL properly
|
|
parsed = urlparse(url)
|
|
base_url = f'{parsed.scheme}://{parsed.netloc}'
|
|
path = parsed.path.lstrip('/')
|
|
|
|
destination = '.'
|
|
|
|
subprocess.run(
|
|
[
|
|
'rclone',
|
|
'ls',
|
|
'--http-url',
|
|
base_url,
|
|
f':http:{path}',
|
|
# destination,
|
|
'--dump',
|
|
'headers',
|
|
'-vv',
|
|
'--config',
|
|
rclone_config,
|
|
]
|
|
)
|