Documentation ¶
Index ¶
- Constants
- Variables
- func AddFile(Url, originalPath string) error
- func AddUrl(Url string) (string, error)
- func CalculatePath(Url string) (string, error)
- func CalculateURL(Path string) (string, error)
- func ClearCache() error
- func CloudProxyGetContent(Url string) (response string, err error)
- func CurrentFilePath() (string, error)
- func CurrentURL() (string, error)
- func DownloadFile(url, path string) error
- func GetFiles(repoType WallpaperRepoType, Url string) ([]string, error)
- func GetPlaylistsByPath(Path string) ([]string, error)
- func LoadPlaylists() (mappedPlaylists, error)
- func PrintCurrentWallpaperInfo() error
- func SanitizePlaylists()
- func SavePlaylists() error
- func SetFromFile(fp string) error
- func SetFromURL(Url string) error
- func SetRandom() error
- func SetRandomUntagged() error
- type CloudProxyCookie
- type CloudProxyResponse
- type CloudProxySolution
- type WallpaperCatagory
- type WallpaperRepo
- type WallpaperRepoType
- type WallpaperSubsection
Constants ¶
const ( Eyy_Indexer WallpaperRepoType = "eyy-indexer" // There is no catagory No_Catagory WallpaperCatagory = "NO CATAGORY" // May also include subcatagory "Roads" - could be moved to seperate Cityscapes WallpaperCatagory = "Cityscapes" Creepy WallpaperCatagory = "Creepy" Ancient WallpaperCatagory = "Ancient" AsiaRussia WallpaperCatagory = "Asia/Russia" Blurry WallpaperCatagory = "Blurry" Calm WallpaperCatagory = "Calm" Cyberpunk WallpaperCatagory = "Cyberpunk" Dark WallpaperCatagory = "Dark" Dreamy WallpaperCatagory = "Dreamy" Dystopian WallpaperCatagory = "Dystopian" Fantasy WallpaperCatagory = "Fantasy" Grainy WallpaperCatagory = "Grainy" Nature WallpaperCatagory = "Nature" Purple WallpaperCatagory = "Purple" Perspective WallpaperCatagory = "Perspective" Snow WallpaperCatagory = "Snow" Space WallpaperCatagory = "Space" Synthwave WallpaperCatagory = "Synthwave" Technology WallpaperCatagory = "Technology" Triangular WallpaperCatagory = "Triangular" VHS_Box_Art WallpaperCatagory = "VHS Box" Games WallpaperCatagory = "Games" )
Variables ¶
var ( ALL_CATAGORIES []WallpaperCatagory = []WallpaperCatagory{ Ancient, AsiaRussia, Blurry, Calm, Cityscapes, Creepy, Cyberpunk, Dark, Dreamy, Dystopian, Fantasy, Games, Grainy, Nature, No_Catagory, Perspective, Purple, Snow, Space, Synthwave, Technology, Triangular, VHS_Box_Art, } OnlineWallpapers []WallpaperRepo WallpaperDataIsValid = make(chan struct{}) )
var CloudProxyCookies []CloudProxyCookie
Cookies created in cloudproxy sessions
var ErrUnrecognisedWallpaperRepoType = fmt.Errorf("unrecognised wallpaper repo type")
var Playlists = make(mappedPlaylists)
Playlists created by user
Functions ¶
func CalculatePath ¶
Calculates the cache path for the given url
func CalculateURL ¶
Calculates the origin URL for the given cache path
func CloudProxyGetContent ¶
Uses cloudproxy (if availible on local port 8191) to get the content of a website. Does not solve captchas, only bypasses CloudFlare IUAM.
CloudProxy: https://github.com/NoahCardoza/CloudProxy
func CurrentFilePath ¶
func CurrentURL ¶
func DownloadFile ¶
download a file with HTTP GET and (if code 2xx) set the response as the contents of the path, if path doesnt exist. Otherwise you will get an error
func GetFiles ¶
func GetFiles(repoType WallpaperRepoType, Url string) ([]string, error)
Will get all download links to files located in the directory Ignores subdirectories.
func GetPlaylistsByPath ¶
Get the playlists that the file is in.
func LoadPlaylists ¶
func LoadPlaylists() (mappedPlaylists, error)
func PrintCurrentWallpaperInfo ¶
func PrintCurrentWallpaperInfo() error
func SanitizePlaylists ¶
func SanitizePlaylists()
remove duplicates from playlists, and remove empty playlists
func SavePlaylists ¶
func SavePlaylists() error
func SetFromFile ¶
func SetFromURL ¶
func SetRandomUntagged ¶
func SetRandomUntagged() error
Types ¶
type CloudProxyCookie ¶
type CloudProxyCookie struct { Name string `json:"name"` Value string `json:"value"` Domain string `json:"domain"` Path string `json:"path"` Expires float64 `json:"expires"` Size int `json:"size"` Httponly bool `json:"httpOnly"` Secure bool `json:"secure"` Session bool `json:"session"` Samesite string `json:"sameSite"` }
A browser cookie
type CloudProxyResponse ¶
type CloudProxyResponse struct { Solution *CloudProxySolution `json:"solution"` // "ok" or "error" Status string `json:"status"` // Error message Message string `json:"message"` Starttimestamp int64 `json:"startTimestamp"` Endtimestamp int64 `json:"endTimestamp"` // CloudProxy version Version string `json:"version"` }
type CloudProxySolution ¶
type CloudProxySolution struct { // URL requested URL string `json:"url"` // HTTP status from request Status int `json:"status"` // Headers in response Headers map[string]string `json:"headers"` // Raw text response of page Response string `json:"response"` // Our user-agent Useragent string `json:"userAgent"` // Cookies returned Cookies []CloudProxyCookie `json:"cookies"` }
Solution to a cloudproxy request
type WallpaperCatagory ¶
type WallpaperCatagory string
A catagory a wallpaper can have
func NewRandomURL ¶
func NewRandomURL(Exclude []WallpaperCatagory, Include []WallpaperCatagory) (string, WallpaperCatagory, error)
Returns a semi-random URL to a new wallpaper. Error if none can be found.
If Include and Exclude have any overlap, the overlapping catagories are not included. By default all catagories are included, however if `len(Include) > 0` then only the specified catagories are used.
type WallpaperRepo ¶
type WallpaperRepo struct { // A URL that contains all of the wallpapers. BaseWallpaperURL string `json:"BaseWallpaperURL"` // Subsections []WallpaperSubsection `json:"Subsections"` // Strings that can be appended to the base URL for access to uncatagorized sections. UncatagorizedPaths []string `json:"UncatagorizedPaths"` // The type of wallpaper repo Type WallpaperRepoType `json:"type"` }
type WallpaperRepoType ¶
type WallpaperRepoType string
type WallpaperSubsection ¶
type WallpaperSubsection struct { Catagory WallpaperCatagory `json:"Catagory"` URLs []string `json:"URLs"` }