diff options
| author | iCraze <39101269+iCrazeiOS@users.noreply.github.com> | 2025-09-17 14:47:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-17 14:47:49 +0100 |
| commit | 4ecedd292060750d9eebf1c98476cb20c5515cdf (patch) | |
| tree | 794249efbd8697fe7a1a5eef262cf7704dd35bcd | |
| parent | fed4cc133114d8bf4adf41df66cb10367d67417c (diff) | |
| download | tidal-dl-ng-4ecedd292060750d9eebf1c98476cb20c5515cdf.tar.gz | |
Fix edge case with repository_url parsing
| -rw-r--r-- | tidal_dl_ng/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tidal_dl_ng/__init__.py b/tidal_dl_ng/__init__.py index ea5d5ea..14b0281 100644 --- a/tidal_dl_ng/__init__.py +++ b/tidal_dl_ng/__init__.py @@ -36,7 +36,14 @@ def metadata_project() -> ProjectInformation: else: try: meta_info = importlib.metadata.metadata(name_package()) - result = ProjectInformation(version=meta_info["Version"], repository_url=meta_info["Home-page"]) + + repo_url = meta_info["Home-page"] + if not repo_url: + urls = meta_info.get_all("Project-URL") + # attempt to parse, else use hardcoded fallback + repo_url = next((url.split(", ")[1] for url in urls if url.startswith("Repository")), "https://github.com/exislow/tidal-dl-ng") + + result = ProjectInformation(version=meta_info["Version"], repository_url=repo_url) except: result = ProjectInformation(version="0.0.0", repository_url="https://anerroroccur.ed/sorry/for/that") |
