/
/
/
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"
8
9# Pandora Error Code Categories
10# Authentication and authorization failures
11AUTH_ERRORS = {12, 13, 1001, 1002, 1003}
12# Missing stations, tracks, or other media
13NOT_FOUND_ERRORS = {4, 5, 1006}
14# Temporary service unavailability
15UNAVAILABLE_ERRORS = {1, 9, 10, 34, 1000}
16
17# Pandora API Error Code Descriptions
18PANDORA_ERROR_CODES = {
19 0: "Internal error",
20 1: "Maintenance mode",
21 2: "URL parameter missing method",
22 3: "URL parameter missing auth_token",
23 4: "URL parameter missing partner_id",
24 5: "URL parameter missing user_id",
25 6: "Secure protocol required",
26 7: "Certificate required",
27 8: "Parameter type mismatch",
28 9: "Parameter missing",
29 10: "Parameter value invalid",
30 11: "API version not supported",
31 12: "Invalid username",
32 13: "Invalid password",
33 14: "Listener not authorized",
34 15: "Partner not authorized",
35 1000: "Read only mode",
36 1001: "Invalid auth token",
37 1002: "Invalid partner login",
38 1003: "Listener not authorized",
39 1004: "Partner not authorized",
40 1005: "Station limit reached",
41 1006: "Station does not exist",
42 1009: "Device not found",
43 1010: "Partner not authorized",
44 1011: "Invalid username",
45 1012: "Invalid password",
46 1023: "Device model invalid",
47 1035: "Explicit pin incorrect",
48 1036: "Explicit pin malformed",
49 1037: "Device already associated to account",
50 1039: "Device not found",
51}
52