/
/
1"""Constants for the Tidal music provider."""
2
3# API URLs
4from typing import Final
5
6BASE_URL = "https://api.tidal.com/v1"
7BASE_URL_V2 = "https://api.tidal.com/v2"
8OPEN_API_URL = "https://openapi.tidal.com/v2"
9BROWSE_URL = "https://tidal.com/browse"
10RESOURCES_URL = "https://resources.tidal.com/images"
11# Base host for the /pages/* feed.
12WEB_BASE_URL = "https://tidal.com/v1"
13SESSIONS_URL = f"{BASE_URL}/sessions"
14
15# Authentication
16TOKEN_TYPE = "Bearer"
17AUTH_URL = "https://auth.tidal.com/v1/oauth2"
18LOGIN_URL = "https://login.tidal.com/authorize"
19REDIRECT_URI = "https://tidal.com/android/login/auth"
20
21# API paths (relative to BASE_URL unless used with an explicit base_url)
22PLAYLISTS = "playlists"
23PAGES_MIX = "pages/mix"
24FAVORITES_ARTISTS = "favorites/artists"
25FAVORITES_ALBUMS = "favorites/albums"
26FAVORITES_TRACKS = "favorites/tracks"
27FAVORITES_PLAYLISTS = "favorites/playlists"
28FAVORITES_MIXES = "favorites/mixes"
29
30# Setup flow: key of the pasted post-login ("Page Not Found") redirect URL
31CONF_OOPS_URL = "oops_url"
32
33# Config keys
34CONF_AUTH_TOKEN = "auth_token"
35CONF_REFRESH_TOKEN = "refresh_token"
36CONF_USER_ID = "user_id"
37CONF_EXPIRY_TIME = "expiry_time"
38CONF_COUNTRY_CODE = "country_code"
39CONF_SESSION_ID = "session_id"
40CONF_QUALITY = "quality"
41
42# API defaults
43DEFAULT_LIMIT: Final[int] = 50
44
45# Cache keys
46CACHE_CATEGORY_DEFAULT: Final[int] = 0
47CACHE_CATEGORY_RECOMMENDATIONS: Final[int] = 1
48CACHE_CATEGORY_ISRC_MAP: Final[int] = 2
49
50# Virtual playlist IDs
51FAVORITE_TRACKS_PLAYLIST_ID: Final[str] = "favorite_tracks"
52