Documentation
¶
Index ¶
- Variables
- func DownloadFromCapturedJSON(jsonFile string, maxConcurrent int) error
- func InitDefaults()
- func InstallCertificate() error
- func RunHAD()
- func ShowManualInstructions()
- func Size4Human(n int64) string
- type AdaptiveBuffer
- type BWScheduleConfig
- type BandwidthSchedule
- type CaptureConfig
- type CaptureProxy
- type CapturedItem
- type DownloadQueue
- type DownloadTask
- type Downloader
- type File
- type File4
- type FileMetadata
- type FileStatus
- type FileType
- type GlobalStatus
- type HLSDownloader
- type Hash
- type HistoryEntry
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) SetVerbose(v bool)
- func (l *Logger) Success(format string, args ...interface{})
- func (l *Logger) Warning(format string, args ...interface{})
- type MagnetInfo
- type Metalink
- type Metalink4
- type MirrorResult
- type MirrorTestResult
- type Notifier
- type Piece
- type PostProcessor
- type QueueItem
- type RPCCommand
- type RPCError
- type RPCResponse
- type RPCServer
- type RequestLog
- type Session
- type SessionInfo
- type SmartMirrorSelector
- type URL
- type URL4
- type WebDAVDownloader
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", }, }
View Source
var LogHook func(level, msg string)
Functions ¶
func InitDefaults ¶
func InitDefaults()
func InstallCertificate ¶
func InstallCertificate() error
func ShowManualInstructions ¶
func ShowManualInstructions()
func Size4Human ¶
Types ¶
type AdaptiveBuffer ¶
type AdaptiveBuffer struct {
// contains filtered or unexported fields
}
func (*AdaptiveBuffer) Size ¶
func (ab *AdaptiveBuffer) Size() int
func (*AdaptiveBuffer) Update ¶
func (ab *AdaptiveBuffer) Update(speedMBps float64)
type BWScheduleConfig ¶
type BandwidthSchedule ¶
func (*BandwidthSchedule) IsActive ¶
func (bs *BandwidthSchedule) IsActive() bool
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
DedupeWindow time.Duration
MaxCaptured int
}
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, 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 `json:"url"`
FileType FileType `json:"file_type"`
Extension string `json:"extension"`
Size int64 `json:"size"`
Title string `json:"title"`
SourceURL string `json:"source_url"`
Timestamp time.Time `json:"timestamp"`
Confidence int `json:"confidence"`
Method string `json:"method"`
StatusCode int `json:"status_code"`
ContentType string `json:"content_type"`
Headers map[string]string `json:"headers,omitempty"`
Downloaded bool `json:"downloaded"`
DownloadPath string `json:"download_path,omitempty"`
}
type DownloadQueue ¶
type DownloadQueue struct {
// contains filtered or unexported fields
}
func NewDownloadQueue ¶
func NewDownloadQueue() *DownloadQueue
func (*DownloadQueue) Add ¶
func (q *DownloadQueue) Add(u string, priority int)
func (*DownloadQueue) Len ¶
func (q *DownloadQueue) Len() int
func (*DownloadQueue) LoadFromFile ¶
func (q *DownloadQueue) LoadFromFile(path string) error
func (*DownloadQueue) Pop ¶
func (q *DownloadQueue) Pop() (QueueItem, bool)
type DownloadTask ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func (*Downloader) Pause ¶
func (dl *Downloader) Pause()
func (*Downloader) Run ¶
func (dl *Downloader) Run()
type FileMetadata ¶
type FileMetadata struct {
FileName string `json:"file_name"`
Size int64 `json:"size"`
SizeHuman string `json:"size_human"`
Extension string `json:"extension"`
ContentType string `json:"content_type"`
Resumable bool `json:"resumable"`
Checksum string `json:"checksum_hint,omitempty"`
LastMod string `json:"last_modified,omitempty"`
}
func FetchFileMetadata ¶
func FetchFileMetadata(rawURL string, client *http.Client) (*FileMetadata, error)
type FileStatus ¶
type GlobalStatus ¶
type GlobalStatus struct {
// contains filtered or unexported fields
}
func NewGlobalStatus ¶
func NewGlobalStatus() *GlobalStatus
func (*GlobalStatus) PauseAllFiles ¶
func (gs *GlobalStatus) PauseAllFiles() int
func (*GlobalStatus) PauseFile ¶
func (gs *GlobalStatus) PauseFile(name string) error
func (*GlobalStatus) PausedFiles ¶
func (gs *GlobalStatus) PausedFiles() []*FileStatus
func (*GlobalStatus) RemoveFile ¶
func (gs *GlobalStatus) RemoveFile(name string) error
func (*GlobalStatus) ResumeFile ¶
func (gs *GlobalStatus) ResumeFile(name string) (rawURL string, size int64, err error)
type HLSDownloader ¶
type HLSDownloader struct {
// contains filtered or unexported fields
}
func NewHLSDownloader ¶
func NewHLSDownloader(rawURL, outPath, fileName string, client *http.Client, gs *GlobalStatus, notifier *Notifier) *HLSDownloader
func (*HLSDownloader) Download ¶
func (h *HLSDownloader) Download() error
type HistoryEntry ¶
type HistoryEntry struct {
GID string `json:"gid"`
FileName string `json:"file_name"`
Size int64 `json:"size"`
SizeHuman string `json:"size_human"`
URL string `json:"url"`
Status string `json:"status"`
Added time.Time `json:"added"`
Finished time.Time `json:"finished"`
AvgSpeed string `json:"avg_speed"`
Duration string `json:"duration"`
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) SetVerbose ¶
type MagnetInfo ¶
type MirrorResult ¶
type MirrorTestResult ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() *Notifier
type PostProcessor ¶
type PostProcessor struct {
// contains filtered or unexported fields
}
func NewPostProcessor ¶
func NewPostProcessor(notifier *Notifier) *PostProcessor
func (*PostProcessor) Run ¶
func (pp *PostProcessor) Run(filePath string)
type RPCCommand ¶
type RPCResponse ¶
type RPCResponse struct {
ID interface{} `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
type RequestLog ¶
type SessionInfo ¶
type SessionInfo struct {
File string `json:"file"`
FileName string `json:"file_name"`
URL string `json:"url"`
Size int64 `json:"size"`
SizeHuman string `json:"size_human"`
Downloaded int64 `json:"downloaded"`
DownloadedHuman string `json:"downloaded_human"`
Progress float64 `json:"progress"`
Mirrors int `json:"mirrors"`
Checksum string `json:"checksum,omitempty"`
Algorithm string `json:"algorithm,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
type SmartMirrorSelector ¶
type SmartMirrorSelector struct {
// contains filtered or unexported fields
}
func NewSmartMirrorSelector ¶
func NewSmartMirrorSelector(urls []string, client *http.Client) *SmartMirrorSelector
func (*SmartMirrorSelector) Best ¶
func (s *SmartMirrorSelector) Best() string
func (*SmartMirrorSelector) ReportFailure ¶
func (s *SmartMirrorSelector) ReportFailure(url string)
func (*SmartMirrorSelector) ShouldRetest ¶
func (s *SmartMirrorSelector) ShouldRetest(url string) bool
func (*SmartMirrorSelector) TestAll ¶
func (s *SmartMirrorSelector) TestAll()
type WebDAVDownloader ¶
type WebDAVDownloader struct {
// contains filtered or unexported fields
}
func NewWebDAVDownloader ¶
func NewWebDAVDownloader(baseURL, user, pass string, client *http.Client, gs *GlobalStatus) *WebDAVDownloader
func (*WebDAVDownloader) DownloadAll ¶
func (w *WebDAVDownloader) DownloadAll(path string)
func (*WebDAVDownloader) DownloadFile ¶
func (w *WebDAVDownloader) DownloadFile(path, fileName string, size int64)
func (*WebDAVDownloader) List ¶
func (w *WebDAVDownloader) List(path string) ([]webdavResponse, error)
Click to show internal directories.
Click to hide internal directories.