/
/
/
1"""Constants for the nicovideo provider in Music Assistant."""
2
3from __future__ import annotations
4
5from enum import Enum
6from typing import TYPE_CHECKING
7
8from music_assistant_models.enums import ContentType
9
10if TYPE_CHECKING:
11 from typing import Literal
12
13
14class ApiPriority(Enum):
15 """Priority levels for nicovideo API calls."""
16
17 HIGH = "high"
18 LOW = "low"
19
20
21# Network constants
22NICOVIDEO_USER_AGENT = "Music Assistant/1.0"
23
24# Note: "Domand" is the actual spelling used in niconico's API (not a typo).
25# This appears in API endpoints like https://asset.domand.nicovideo.jp/ and throughout
26# their media delivery system (WatchMediaDomand, WatchMediaDomandVideo, WatchMediaDomandAudio, etc.)
27DOMAND_BID_COOKIE_NAME = "domand_bid"
28
29# Audio format constants based on niconico official specifications
30# Sources:
31# - https://qa.nicovideo.jp/faq/show/21908
32# - https://qa.nicovideo.jp/faq/show/5685
33NICOVIDEO_CONTENT_TYPE = ContentType.MP4
34NICOVIDEO_CODEC_TYPE = ContentType.AAC
35NICOVIDEO_AUDIO_CHANNELS = 2 # Stereo (2ch)
36NICOVIDEO_AUDIO_BIT_DEPTH = 16 # 16-bit (confirmed from downloaded video analysis)
37
38# Content filtering constants
39# Default behavior for sensitive content handling
40SENSITIVE_CONTENTS: Literal["mask", "filter"] = "mask"
41