mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
38
modules/mapterhorn_mirror/debug.py
Executable file
38
modules/mapterhorn_mirror/debug.py
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/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,
|
||||
]
|
||||
)
|
||||
Reference in New Issue
Block a user