f
This commit is contained in:
@@ -2499,7 +2499,7 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
|
||||
raw_manifest = metadata.get("manifest")
|
||||
if not raw_manifest:
|
||||
# When piping directly from the HIFI search table, we may only have a track id.
|
||||
# When piping directly from the Tidal search table, we may only have a track id.
|
||||
# Fetch track details from the proxy so downstream stages can decode the manifest.
|
||||
try:
|
||||
already = bool(metadata.get("_tidal_track_details_fetched"))
|
||||
@@ -2518,7 +2518,7 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
|
||||
if candidate_path:
|
||||
m = re.search(
|
||||
r"hifi:(?://)?track[\\/](\d+)",
|
||||
r"tidal:(?://)?track[\\/](\d+)",
|
||||
str(candidate_path),
|
||||
flags=re.IGNORECASE,
|
||||
)
|
||||
@@ -2626,7 +2626,7 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
except Exception:
|
||||
pass
|
||||
log(
|
||||
f"[hifi] JSON manifest for track {metadata.get('trackId') or metadata.get('id')} had no playable urls",
|
||||
f"[tidal] JSON manifest for track {metadata.get('trackId') or metadata.get('id')} had no playable urls",
|
||||
file=sys.stderr,
|
||||
)
|
||||
except Exception as exc:
|
||||
@@ -2637,7 +2637,7 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
except Exception:
|
||||
pass
|
||||
log(
|
||||
f"[hifi] Failed to parse JSON manifest for track {metadata.get('trackId') or metadata.get('id')}: {exc}",
|
||||
f"[tidal] Failed to parse JSON manifest for track {metadata.get('trackId') or metadata.get('id')}: {exc}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return None
|
||||
@@ -2658,7 +2658,7 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
pass
|
||||
try:
|
||||
log(
|
||||
f"[hifi] Decoded manifest is not an MPD XML for track {metadata.get('trackId') or metadata.get('id')} (mime {manifest_mime or 'unknown'})",
|
||||
f"[tidal] Decoded manifest is not an MPD XML for track {metadata.get('trackId') or metadata.get('id')} (mime {manifest_mime or 'unknown'})",
|
||||
file=sys.stderr,
|
||||
)
|
||||
except Exception:
|
||||
@@ -2681,13 +2681,13 @@ def resolve_tidal_manifest_path(item: Any) -> Optional[str]:
|
||||
# Persist as .mpd for DASH manifests.
|
||||
ext = "mpd"
|
||||
|
||||
manifest_dir = Path(tempfile.gettempdir()) / "medeia" / "hifi"
|
||||
manifest_dir = Path(tempfile.gettempdir()) / "medeia" / "tidal"
|
||||
try:
|
||||
manifest_dir.mkdir(parents=True, exist_ok=True)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
filename = f"hifi-{track_safe}-{identifier_safe[:24]}.{ext}"
|
||||
filename = f"tidal-{track_safe}-{identifier_safe[:24]}.{ext}"
|
||||
target_path = manifest_dir / filename
|
||||
try:
|
||||
with open(target_path, "wb") as fh:
|
||||
|
||||
Reference in New Issue
Block a user