Documentation
¶
Overview ¶
This package is mostly a rewrite of https://github.com/SegoCode/swd/blob/main/swd.go which was provided via GitHub under The Unlicence
Index ¶
- Constants
- func CheckAvailable(resource any) (string, []error)
- func DownloadResource(id int, output io.Writer) error
- func ExtractResource(r resource.Resource, dir, game string, verbose bool) (string, error)
- func GetBreadcrumbs(url string) ([]string, error)
- func GetGame(id any) (string, error)
- func GetResourceTitle(url string) (string, error)
- func IsCollection(url string) (bool, error)
- func WorkshopIDFromURL[T ~string](url T) (int, error)deprecated
- func WorkshopIDToURL[T constraints.Integer](id T) (string, bool)deprecated
Constants ¶
const ENDPOINT string = "https://node05.steamworkshopdownloader.io/prod//api/"
Variables ¶
This section is empty.
Functions ¶
func CheckAvailable ¶
Checks if a resource is available.
Param `resource` is an int for its Workshop ID or a string for its Workshop URL.
func DownloadResource ¶
Writes Workshop resource by ID to given Writer.
func ExtractResource ¶
Extracts things that match "dir/id - (downloaded title).zip" where dir is a given directory and id is the given Workshop ID.
Deletes the archive if successful.
func GetBreadcrumbs ¶ added in v1.0.1
At the top of a Workshop page theres "breadcrumbs" which look like "Game > Workshop > Collections > User's Workshop". This function looks for thos "breadcrumbs" then gives them like []string{ "Game", "Workshop", "Collections", "User's Workshop" }
func GetGame ¶
Gets the game from a steam workshop ID or URL. Arg "id" accepts int or string, where the former is the ID and the latter is the full URL.
func GetResourceTitle ¶
Gets the Workshop title from the page given.
func IsCollection ¶
Returns true if the given page is a URL.
At the top of a Workshop page theres "breadcrumbs" which look like "Game > Workshop > Collections > User's Workshop". This function checks if "Collection" is in those breadcrumbs.
func WorkshopIDFromURL
deprecated
func WorkshopIDToURL
deprecated
func WorkshopIDToURL[T constraints.Integer](id T) (string, bool)
Deprecated: use utils.WorkshopIDToURL
Converts a Workshop ID to a Workshop URL
Types ¶
This section is empty.