Resolve the current dump URL by reading the 'current' pointer.
(base_url)
| 58 | |
| 59 | |
| 60 | def resolve_dump_url(base_url): |
| 61 | """Resolve the current dump URL by reading the 'current' pointer.""" |
| 62 | result = subprocess.run( |
| 63 | ["curl", "-sfL", f"{base_url}/current"], |
| 64 | capture_output=True, |
| 65 | text=True, |
| 66 | ) |
| 67 | if result.returncode != 0: |
| 68 | raise RuntimeError(f"Failed to fetch {base_url}/current") |
| 69 | date = result.stdout.strip() |
| 70 | url = f"{base_url}/{date}" |
| 71 | logger.info("Using dump: %s", url) |
| 72 | return url |
| 73 | |
| 74 | |
| 75 | def download_file(url, dest_path): |