Documentation
¶
Overview ¶
Package ipc is the link between the native messaging host and the app.
The app listens on a random 127.0.0.1 port and writes {port, token} to %APPDATA%\Velo\endpoint.json. Every request must carry the token, so web pages that probe localhost can't add downloads.
Index ¶
Constants ¶
const TokenHeader = "X-Velo-Token"
Variables ¶
This section is empty.
Functions ¶
func Call ¶
Call sends a command (add, list, pause, resume, show) to the running app and returns the raw JSON response.
func Dir ¶
func Dir() string
Dir is Velo's data folder: %APPDATA%\Velo, the "data" folder of a portable copy, or $VELO_HOME if set (tests).
func Portable ¶
Portable reports whether this is a portable copy (a file named "portable" next to the program) and returns the program's folder.
func RemoveEndpoint ¶
func RemoveEndpoint()
func WriteEndpoint ¶
Types ¶
type Endpoint ¶
func ReadEndpoint ¶
type Job ¶
type Job struct {
Type string `json:"type"`
URL string `json:"url"`
Referrer string `json:"referrer"`
Filename string `json:"filename"`
Cookies string `json:"cookies"`
UserAgent string `json:"userAgent"`
Kind string `json:"kind"` // "" = file, "hls" = video stream
Format string `json:"format"` // "", "1080p", "720p", "480p", "audio"
Title string `json:"title"` // page title, used to name videos
Source string `json:"source"` // "capture" = a download the browser started
Size int64 `json:"size"` // size the browser reported, if known
}