Usage
With the library properly installed, you need to initialize UMD by using umd.New
passing any metadata or callback (if needed, otherwise just pass nil
). Then, with the newly Umd
object you can call the method FindExtractor
passing that URL that you want to query.
UMD will automatically detect what site/content you're trying to fetch media information; if the URL is not supported, then it will return an error.
If everything goes well and UMD detects the URL returning a suitable extractor, you can use the methods below:
QueryMedia()
The method QueryMedia
is an async function that returns immediately after the query is started. To get the result of the query, you need to use the Response
object.
Response object
The response represents the result of the query. It contains many fields, the most important are:
Url
: The URL that was queried.Media
: An array ofMedia
objects founds during the query.Done
: Is a channel that emits a signal when the query is finished;nil
if it completes successfully, otherwise it will contain an error.