const ( Host = "https://widevinel1apil.vercel.app" SecretKey = "free_l1_widevine_key" Username = "free_l1_user_api" )
Hardcoded configuration values from YAML (only the ones actually used)
func GetServiceCertificate(licenseURL string) ([]byte, error)
ChallengeResponse represents the API response for get_challenge
type ChallengeResponse struct { SessionID string `json:"sessionId"` Data string `json:"data"` Keys []KeyDTO `json:"keys,omitempty"` }
ContentKey represents a decryption key
type ContentKey struct { KID []byte KeyType string Key []byte }
KeyDTO represents a key from the API response
type KeyDTO struct { KeyID string `json:"key_id"` Key string `json:"key"` }
RemoteDevice represents a remote Widevine device
type RemoteDevice struct { APISessionID string InitData string ServiceName string }
func NewRemoteDevice() *RemoteDevice
NewRemoteDevice creates a new RemoteDevice
func (rd *RemoteDevice) GetLicenseChallenge(session *Session, service string) ([]byte, error)
GetLicenseChallenge retrieves a license challenge from the remote API Returns the challenge bytes, or nil if keys were cached (check session.Keys)
func (rd *RemoteDevice) ParseLicense(session *Session, licenseRes []byte) error
ParseLicense parses the license response and extracts keys
func (rd *RemoteDevice) SetServiceCertificate(session *Session, certificate []byte)
SetServiceCertificate applies a service certificate to the session
Session holds session-related data
type Session struct { PSSH string SignedDeviceCertificate string PrivacyMode bool Keys []ContentKey }