#!/usr/bin/env python3

# SPDX-FileCopyrightText: 2025 Robin Vobruba <hoijui.quaero@gmail.com>
#
# SPDX-License-Identifier: Unlicense

import os
import sys
try:
    from urllib.request import urlretrieve
except ImportError:
    from urllib import urlretrieve
try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse

argc = len(sys.argv)
dl_url = sys.argv[1]
dl_file = sys.argv[2] if argc > 2 else os.path.basename(urlparse(dl_url).path)

urlretrieve(dl_url, dl_file)
