core

package
v0.0.0-...-27bd6c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtensionGroups = map[FileType][]string{
	TypeVideo: {
		".mp4", ".mkv", ".avi", ".mov", ".wmv", ".flv", ".webm", ".m4v",
		".mpg", ".mpeg", ".m2ts", ".mts", ".ts", ".m3u8", ".mpd", ".iso",
		".vob", ".3gp", ".ogv", ".ogg", ".qt", ".rm", ".rmvb", ".asf",
		".divx", ".xvid", ".264", ".265", ".hevc",
	},
	TypeMusic: {
		".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".opus", ".wma",
		".alac", ".ape", ".dsd", ".dff", ".dsf", ".mid", ".midi", ".ra",
		".voc", ".vox", ".aiff", ".au", ".snd", ".amr", ".awb", ".weba",
	},
	TypeImage: {
		".jpg", ".jpeg", ".png", ".gif", ".bmp", ".svg", ".webp", ".ico",
		".tiff", ".tif", ".raw", ".cr2", ".nef", ".arw", ".dng", ".heif",
		".heic", ".jfif", ".pjpeg", ".pjp", ".avif", ".apng", ".cur",
	},
	TypeDocument: {
		".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt",
		".rtf", ".odt", ".ods", ".odp", ".odg", ".csv", ".json", ".xml",
		".md", ".epub", ".mobi", ".azw", ".azw3", ".cbr", ".cbz", ".ps",
		".tex", ".log", ".ini", ".cfg", ".conf", ".yaml", ".yml",
	},
	TypeArchive: {
		".zip", ".rar", ".7z", ".tar", ".gz", ".bz2", ".xz", ".tgz",
		".tbz2", ".txz", ".zst", ".lzma", ".lz", ".lzh", ".cab", ".arj",
		".deb", ".rpm", ".pkg", ".msi", ".apk", ".ipa", ".jar", ".war",
	},
}

Functions

func DownloadFromCapturedJSON

func DownloadFromCapturedJSON(jsonFile string, maxConcurrent int) error

func InstallCertificate

func InstallCertificate() error

func RunHAD

func RunHAD()

func SetColor

func SetColor(c, t string) string

func ShowManualInstructions

func ShowManualInstructions()

func Size4Human

func Size4Human(b int64) string

Types

type AdaptiveBuffer

type AdaptiveBuffer struct {
	// contains filtered or unexported fields
}

func NewAdaptiveBuffer

func NewAdaptiveBuffer() *AdaptiveBuffer

func (*AdaptiveBuffer) GetSize

func (ab *AdaptiveBuffer) GetSize() int

func (*AdaptiveBuffer) Update

func (ab *AdaptiveBuffer) Update(speedMBps float64)

type CaptureConfig

type CaptureConfig struct {
	Port             string
	FileTypes        []FileType
	CustomExtensions []string
	Headers          map[string]string
	Cookie           string
	AutoDownload     bool
	OutputDir        string
	MinFileSize      int64
	MaxFileSize      int64
	ConfidenceLevel  int
	SaveToFile       string
	Verbose          bool
	CaptureBody      bool
	FilterDomain     string
	FilterPattern    string
}

type CaptureProxy

type CaptureProxy struct {
	// contains filtered or unexported fields
}

func NewCaptureProxy

func NewCaptureProxy(config *CaptureConfig) *CaptureProxy

func (*CaptureProxy) ExportLogs

func (cp *CaptureProxy) ExportLogs(format string, filename string) error

func (*CaptureProxy) GetCapturedItems

func (cp *CaptureProxy) GetCapturedItems() []CapturedItem

func (*CaptureProxy) GetRequestLogs

func (cp *CaptureProxy) GetRequestLogs() []RequestLog

func (*CaptureProxy) GetStats

func (cp *CaptureProxy) GetStats() map[string]interface{}

func (*CaptureProxy) Start

func (cp *CaptureProxy) Start() error

type CapturedItem

type CapturedItem struct {
	URL          string
	FileType     FileType
	Extension    string
	Size         int64
	Title        string
	SourceURL    string
	Timestamp    time.Time
	Confidence   int
	Method       string
	StatusCode   int
	Headers      map[string]string
	RequestBody  []byte
	ResponseBody []byte
}

type DiskCache

type DiskCache struct {
	// contains filtered or unexported fields
}

func NewDiskCache

func NewDiskCache(maxSize int64) *DiskCache

func (*DiskCache) FlushToFile

func (dc *DiskCache) FlushToFile(file *os.File)

func (*DiskCache) Read

func (dc *DiskCache) Read(offset int64, length int) ([]byte, bool)

func (*DiskCache) Write

func (dc *DiskCache) Write(offset int64, data []byte)

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

type File

type File struct {
	Name   string  `xml:"name,attr"`
	Size   int64   `xml:"size"`
	Hashes []Hash  `xml:"hash"`
	URLs   []URL   `xml:"url"`
	Pieces []Piece `xml:"pieces"`
}

type File4

type File4 struct {
	Name string `xml:"name,attr"`
	Size int64  `xml:"size"`
	URLs []URL4 `xml:"url"`
}

type FileStatus

type FileStatus struct {
	Name           string
	Size           int64
	SizeFormatted  string
	Done           int64
	Total          int64
	Status         string
	StartTime      time.Time
	EndTime        time.Time
	TotalThreads   int
	ActiveThreads  int
	DoneThreads    int
	ThreadProgress []int64
	BufferSize     int
	// contains filtered or unexported fields
}

type FileType

type FileType string
const (
	TypeVideo    FileType = "video"
	TypeMusic    FileType = "music"
	TypeImage    FileType = "image"
	TypeDocument FileType = "document"
	TypeArchive  FileType = "archive"
	TypeAll      FileType = "all"
)

type GlobalStatus

type GlobalStatus struct {
	// contains filtered or unexported fields
}

func NewGlobalStatus

func NewGlobalStatus() *GlobalStatus

type Hash

type Hash struct {
	Type string `xml:"type,attr"`
	Data string `xml:",chardata"`
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) SetVerbose

func (l *Logger) SetVerbose(v bool)

func (*Logger) Success

func (l *Logger) Success(format string, args ...interface{})

func (*Logger) Warning

func (l *Logger) Warning(format string, args ...interface{})
type Metalink struct {
	XMLName xml.Name `xml:"metalink"`
	Files   []File   `xml:"file"`
}

type Metalink4

type Metalink4 struct {
	XMLName xml.Name `xml:"metalink"`
	Files   []File4  `xml:"file"`
}

type NetrcEntry

type NetrcEntry struct {
	Machine  string
	Login    string
	Password string
}

type Piece

type Piece struct {
	Length int    `xml:"length,attr"`
	Type   string `xml:"type,attr"`
	Hash   string `xml:",chardata"`
}

type RPCCommand

type RPCCommand struct {
	ID     string                 `json:"id"`
	Method string                 `json:"method"`
	Params map[string]interface{} `json:"params"`
}

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RPCResponse

type RPCResponse struct {
	ID     string      `json:"id"`
	Result interface{} `json:"result,omitempty"`
	Error  *RPCError   `json:"error,omitempty"`
}

type RPCServer

type RPCServer struct {
	// contains filtered or unexported fields
}

func NewRPCServer

func NewRPCServer(global *GlobalStatus) *RPCServer

func (*RPCServer) Start

func (rpc *RPCServer) Start(addr string) error

func (*RPCServer) Stop

func (rpc *RPCServer) Stop() error

type RequestLog

type RequestLog struct {
	Method      string
	URL         string
	Host        string
	Path        string
	QueryParams map[string]string
	Headers     map[string]string
	Body        string
	Timestamp   time.Time
}

type Session

type Session struct {
	URL      string
	Path     string
	Size     int64
	Ranges   [][2]int64
	FileName string
	Progress []int64
}

type URL

type URL struct {
	Location string `xml:"location,attr"`
	URL      string `xml:",chardata"`
	Priority int    `xml:"priority,attr"`
}

type URL4

type URL4 struct {
	URL string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL