Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

296 297 hires mqa #300

Merged
merged 4 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def test_video_quality_defaults_to_best(session):
assert session.video_quality == "HIGH"


@pytest.mark.parametrize(
"quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES", "HI_RES_LOSSLESS"]
)
@pytest.mark.parametrize("quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES_LOSSLESS"])
def test_manually_set_audio_quality_is_preserved(session, quality):
session.audio_quality = quality
assert session.audio_quality == quality
Expand Down
14 changes: 4 additions & 10 deletions tidalapi/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Quality(str, Enum):
low_96k: str = "LOW"
low_320k: str = "HIGH"
high_lossless: str = "LOSSLESS"
hi_res: str = "HI_RES"
hi_res_lossless: str = "HI_RES_LOSSLESS"
default: str = low_320k

Expand Down Expand Up @@ -86,7 +85,7 @@ def __str__(self) -> str:


class MediaMetadataTags(str, Enum):
hires_lossless: str = "HIRES_LOSSLESS"
hi_res_lossless: str = "HIRES_LOSSLESS"
lossless: str = "LOSSLESS"
dolby_atmos: str = "DOLBY_ATMOS"

Expand Down Expand Up @@ -442,7 +441,7 @@ def is_hi_res_lossless(self) -> bool:
try:
if (
self.media_metadata_tags
and MediaMetadataTags.hires_lossless in self.media_metadata_tags
and MediaMetadataTags.hi_res_lossless in self.media_metadata_tags
):
return True
except:
Expand Down Expand Up @@ -478,9 +477,7 @@ class Stream:

track_id: int = -1
audio_mode: str = AudioMode.stereo # STEREO, DOLBY_ATMOS
audio_quality: str = (
Quality.low_320k
) # LOW, HIGH, LOSSLESS, HI_RES, HI_RES_LOSSLESS
audio_quality: str = Quality.low_320k # LOW, HIGH, LOSSLESS, HI_RES_LOSSLESS
manifest_mime_type: str = ""
manifest_hash: str = ""
manifest: str = ""
Expand Down Expand Up @@ -592,10 +589,7 @@ def __init__(self, stream: Stream):
self.file_extension = self.get_file_extension(self.urls[0], self.codecs)

def get_urls(self) -> [str]:
if self.is_mpd:
return self.urls
else:
return self.urls[0]
return self.urls

def get_hls(self) -> str:
if self.is_mpd:
Expand Down
Loading