Package main (v1.7.9) [up] [repository]

Index

Constants

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)

Functions

func GetServiceCertificate(licenseURL string) ([]byte, error)

Types

type ChallengeResponse

ChallengeResponse represents the API response for get_challenge

type ChallengeResponse struct {
	SessionID string   `json:"sessionId"`
	Data      string   `json:"data"`
	Keys      []KeyDTO `json:"keys,omitempty"`
}

type ContentKey

ContentKey represents a decryption key

type ContentKey struct {
	KID     []byte
	KeyType string
	Key     []byte
}

type KeyDTO

KeyDTO represents a key from the API response

type KeyDTO struct {
	KeyID string `json:"key_id"`
	Key   string `json:"key"`
}

type RemoteDevice

RemoteDevice represents a remote Widevine device

type RemoteDevice struct {
	APISessionID string
	InitData     string
	ServiceName  string
}

Functions

func NewRemoteDevice() *RemoteDevice

NewRemoteDevice creates a new RemoteDevice

Methods

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

type Session

Session holds session-related data

type Session struct {
	PSSH                    string
	SignedDeviceCertificate string
	PrivacyMode             bool
	Keys                    []ContentKey
}