summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2025-09-30 22:28:32 +0200
committerGitHub <noreply@github.com>2025-09-30 22:28:32 +0200
commit723417b9bb49f268262e6eded2504053610aab24 (patch)
tree4d0de3a3629b936352b2501f3a3da53440f5f7b9
parente52e17a8f5c2ec232f4e962656cd577d548a5143 (diff)
parent4ecedd292060750d9eebf1c98476cb20c5515cdf (diff)
downloadtidal-dl-ng-723417b9bb49f268262e6eded2504053610aab24.tar.gz
Merge pull request #537 from iCrazeiOS/master
Fix edge case with repository_url parsing
-rw-r--r--tidal_dl_ng/__init__.py9
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")