mirror of
https://github.com/glomatico/gamdl.git
synced 2026-06-13 04:05:14 +03:00
Add song codec flavor mappings and properties
This commit is contained in:
@@ -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",
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user