Add song codec flavor mappings and properties

This commit is contained in:
Rafael Moraes
2026-05-20 16:57:34 -03:00
parent 97086adfbe
commit 67bdfe8584
2 changed files with 19 additions and 0 deletions
+7
View File
@@ -94,3 +94,10 @@ ARTIST_AUTO_SELECT_STR_MAP = {
"top-songs": "Top Songs",
"music-videos": "Music Videos",
}
SONG_CODEC_FLAVOR_MAP = {
"aac-web": "28:ctrp256",
"aac-he-web": "32:ctrp64",
"aac-fps-web": "30:cbcp256",
"aac-he-fps-web": "34:cbcp64",
}
+12
View File
@@ -6,6 +6,7 @@ from .constants import (
FOURCC_MAP,
MEDIA_RATING_STR_MAP,
MEDIA_TYPE_STR_MAP,
SONG_CODEC_FLAVOR_MAP,
)
@@ -47,6 +48,9 @@ class MediaFileFormat(Enum):
class SongCodec(Enum):
AAC_WEB = "aac-web"
AAC_HE_WEB = "aac-he-web"
# doesnt work with wrapper, gives ckc error
# AAC_FPS_WEB = "aac-fps-web"
# AAC_HE_FPS_WEB = "aac-he-fps-web"
AAC = "aac"
AAC_HE = "aac-he"
AAC_BINAURAL = "aac-binaural"
@@ -62,6 +66,14 @@ class SongCodec(Enum):
def is_web(self) -> bool:
return self.value.endswith("-web")
@property
def flavor(self) -> str | None:
return SONG_CODEC_FLAVOR_MAP.get(self.value)
@property
def is_cenc(self) -> bool:
return self.flavor is not None and "ctrp" in self.flavor
class MusicVideoCodec(Enum):
H264 = "h264"