Documentation
¶
Overview ¶
Package unlockcheck provides streaming unlock detection functionality. This file contains the embedded csm.sh script for local execution. Script source: https://github.com/ECYCloud/check-stream-media All detection logic is embedded locally, no remote download required. Optimized for parallel execution to reduce detection time.
Package unlockcheck provides streaming unlock detection functionality. It checks various streaming services (Netflix, YouTube Premium, Disney+, etc.) and reports the results to the panel. Detection logic is 100% based on csm.sh script from: https://github.com/ECYCloud/check-stream-media The script is embedded locally and executed without remote download. NO FALLBACK - only uses the embedded csm.sh script for 100% accuracy.
Index ¶
- Constants
- func GetCSMScript() string
- func GetRegisteredNodeIDs() []int
- func HasNodeReported(nodeID int) bool
- func IsChecking() bool
- func MarkNodeReported(nodeID int)
- func RegisterNodeID(nodeID int)
- func ReleaseCheckLock()
- func SetCachedResults(results *UnlockCheckResults)
- func TryAcquireCheckLock() bool
- type Checker
- type UnlockCheckResults
Constants ¶
const CSM_SCRIPT = `` /* 21414-byte string literal not displayed */
CSM_SCRIPT contains the complete csm.sh script for unlock detection. This script is executed locally without downloading from remote. Uses parallel execution for faster detection (typically 10-15 seconds).
Variables ¶
This section is empty.
Functions ¶
func GetCSMScript ¶
func GetCSMScript() string
GetCSMScript returns the embedded CSM script content for external use
func GetRegisteredNodeIDs ¶
func GetRegisteredNodeIDs() []int
GetRegisteredNodeIDs returns all registered node IDs
func HasNodeReported ¶
HasNodeReported checks if a node has already reported in the current hour
func IsChecking ¶
func IsChecking() bool
IsChecking returns whether a check is currently in progress
func MarkNodeReported ¶
func MarkNodeReported(nodeID int)
MarkNodeReported marks a node as having reported in the current hour
func RegisterNodeID ¶
func RegisterNodeID(nodeID int)
RegisterNodeID registers a node ID for unlock check result sharing. All registered nodes will receive the same detection results.
func SetCachedResults ¶
func SetCachedResults(results *UnlockCheckResults)
SetCachedResults stores the results in global cache
func TryAcquireCheckLock ¶
func TryAcquireCheckLock() bool
TryAcquireCheckLock tries to acquire the lock for performing detection Returns true if this caller should perform the check, false if another node is already checking
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker performs unlock checks using embedded csm.sh script
func NewChecker ¶
NewChecker creates a new unlock checker
func (*Checker) RunAllChecks ¶
func (c *Checker) RunAllChecks() *UnlockCheckResults
RunAllChecks performs all unlock checks by executing embedded csm.sh script This ensures 100% consistency with the csm.sh detection logic NO FALLBACK - if script fails, returns Unknown for all services
type UnlockCheckResults ¶
type UnlockCheckResults struct {
YouTubePremium string `json:"YouTube_Premium"`
Netflix string `json:"Netflix"`
DisneyPlus string `json:"DisneyPlus"`
HBOMax string `json:"HBOMax"`
AmazonPrime string `json:"AmazonPrime"`
OpenAI string `json:"OpenAI"`
Gemini string `json:"Gemini"`
Claude string `json:"Claude"`
TikTok string `json:"TikTok"`
}
UnlockCheckResults represents all unlock check results
func GetCachedResults ¶
func GetCachedResults() *UnlockCheckResults
GetCachedResults returns cached results if still valid for the current hour, otherwise returns nil
func (*UnlockCheckResults) ToJSON ¶
func (r *UnlockCheckResults) ToJSON() string
ToJSON converts results to JSON string