/
/
/
1"""Constants for the Pandora music provider."""
2
3# API Endpoints
4API_BASE = "https://www.pandora.com/api/v1"
5LOGIN_ENDPOINT = f"{API_BASE}/auth/login"
6STATIONS_ENDPOINT = f"{API_BASE}/station/getStations"
7PLAYLIST_FRAGMENT_ENDPOINT = f"{API_BASE}/playlist/getFragment"
8PLAYBACK_RESUMED_ENDPOINT = f"{API_BASE}/station/playbackResumed"
9
10# Pandora Error Code Categories
11# Authentication and authorization failures
12AUTH_ERRORS = {12, 13, 1001, 1002, 1003}
13# Missing stations, tracks, or other media
14NOT_FOUND_ERRORS = {4, 5, 1006}
15# Temporary service unavailability
16UNAVAILABLE_ERRORS = {1, 9, 10, 34, 1000}
17
18# Pandora API Error Code Descriptions
19PANDORA_ERROR_CODES = {
20 0: "Internal error",
21 1: "Maintenance mode",
22 2: "URL parameter missing method",
23 3: "URL parameter missing auth_token",
24 4: "URL parameter missing partner_id",
25 5: "URL parameter missing user_id",
26 6: "Secure protocol required",
27 7: "Certificate required",
28 8: "Parameter type mismatch",
29 9: "Parameter missing",
30 10: "Parameter value invalid",
31 11: "API version not supported",
32 12: "Invalid username",
33 13: "Invalid password",
34 14: "Listener not authorized",
35 15: "Partner not authorized",
36 1000: "Read only mode",
37 1001: "Invalid auth token",
38 1002: "Invalid partner login",
39 1003: "Listener not authorized",
40 1004: "Partner not authorized",
41 1005: "Station limit reached",
42 1006: "Station does not exist",
43 1009: "Device not found",
44 1010: "Partner not authorized",
45 1011: "Invalid username",
46 1012: "Invalid password",
47 1023: "Device model invalid",
48 1035: "Explicit pin incorrect",
49 1036: "Explicit pin malformed",
50 1037: "Device already associated to account",
51 1039: "Device not found",
52}
53
54RETRY_REASON_AUTH = "auth"
55RETRY_REASON_STREAM_VIOLATION = "stream_violation"
56
57CONF_TAKEOVER_ACTION = "takeover_stream"
58CONF_QUALITY = "quality"
59QUALITY_HIGH = "high"
60QUALITY_STANDARD = "standard"
61
62ACCOUNT_FLAG_HIGH_QUALITY = "highQualityStreamingAvailable"
63