Skip to content

Commandline arguments

Wojciech Siewierski edited this page Oct 6, 2015 · 6 revisions

Commandline arguments

You might want to read the README first.

GENERAL OPTIONS

-f --from <string>

Tell glyrc where you want to get your metadata from.
You can get a full list of providers for each getter by running glyrc -L
The string you can pass here looks like this example for cover:

  • lastfm;google
    This would query lastfm and google
    Alternatively you may use the string all in it:
  • all;-lastfm;
    All providers except lastfm (therefore the minus) are used.
    By default all built-in providers are used.
-w --write <directory>

The directory where glyr will output the found items.
By default everything is written to the current working directory.
There are three special files:

  • stdout
    Outputs file to stdout
  • stderr
    Outputs file to stderr
  • null
    Outputs item nowhere

If the given path is instead a regular filename, it will save the item at this exact path.
For example: --write /tmp/cover.png → write to /tmp/cover.png even with —number > 1

-n --number <num>

How many items should be delivered, by default only one item is searched.
The number of results is not guaranteed to be num, but should be at max. num
A value of 0 will cause libglyr to deliver everything it finds.

-t --lang <langcode>

Some providers offer localized content, or content only being available in certain countries.
Examples are: last.fm, amazon and google.
The language is given in ISO 639-1 codes like ‘de’ or ‘en’.
Alternatively you can set it to ‘auto’, which will cause libglyr
to guess your language by your locale.
This is the default behavior.

-o --only-lang

Only query providers that offer language-specific content. (Only useful with —lang)

-z --fuzzyness <integer>

libglyr features fuzzy matching to enhance searchresults.
Look at the string “Carl” and the accidentally misstyped version “Kalr”:
Those strings will be compares using the Levenshtein distance which basically counts
the number of edit, substitute and delete operations to transfrom “Carl” into “Kalr”.
The distance in this case is 3 since three substitutions are needed.
The fuzzyness parameter is the maximum distance two strings may have to match.
A high distance (like about 10) matches even badly misstyped strings, but also introduces bad results.
Low settings however will omit some good results.

The default values is currently 4.
To be more secure some correction is applied:

  • Adele – 19
  • Adele – 21
  • lv-distance = 2 which is <= 4
  • But since the lv-distance is the same as the length “21” it won’t match.

The easiest way to prevent this, is to tag your music.

-q --qsratio <float>

A float in the range [0.0..1.0].
It tells libglyr how to weight quality and speed.
A value of 0.0 prefers fast providers, 1.0 high-quality providers.
The default is 0.85.

-x --plugmax <integer>

The maximum number of items a provider may retrieve.
Use this to split up your search over several sources.
{color:red}Note: This might be removed in future releases.

NETWORK OPTIONS

-p --parallel <integer>

How many providers may be queried in parallel,
this is not necessarily the number of actual parallel downloads.
The default is 0 where glyr will adjust this value itself.

-u --useragent <string>

The useragent that is used during HTTP requests.
This should be not empty, since it may break some providers.

-r --redirects <integer>

The number of redirects that are allowed.
A value of 0 is possible but might break some providers.

-m --timeout <integer>

The maximum number of seconds to wait till a connection is canceled.
Generally, you shouldn’t use this anyway.

-k --proxy <proxystring>

The proxy to use, if any.
It is passed in the form: [protocol://][user:pass@]yourproxy.domain[:port]
Example:

  • Proxy.fh-hof.de:3128
  • http://hman:rootroot@godserve.com:666

Since internally libcurl is used the proxy may also read from env_vars like http_proxy automagically.

PROVIDER SPECIFIC OPTIONS

-d --download

For the getters cover and artistphoto only.
Will cause to libglyr to download found images,
which is also the default.

-D --skip-download

For the getters cover and artistphoto only.
Do not download images, but return the full URL to them.
This makes libglyr act a bit like a search engine.

-a --artist <string>

The artist you want to search for, it is needed for every getter.
Libglyr will apply some basic formatting to strip things like “feat. XYZ

-b --album <string>

The album you want to search for, it is needed for the following getters:

  • cover
  • albumreview
  • tracklist

Optional for these:

  • tags
  • relations

Libglyr will apply some basic formatting to strip things like “CD01”

-t --title <string>

The songtitle you want to search for, it is needed for the following getters:

  • lyrics
  • similarsongs

Optional for these:

  • tags
  • relations

Libglyr will apply some basic formatting to strip things like “feat. (remix blahblah)”

-e --maxsize <integer>

For the getters cover and artistphoto only.
The maximum size an image may have, assuming it to be quadratic.

-i --minsize <integer>

For the getters cover and artistphoto only.
The minimum size an image may have, assuming it to be quadratic.

-F --formats <formatstring>

For the getters cover and artistphoto only.
The allowed formats for images, in a comma separated list.
Example:

  • “png;jpeg”
  • “png;jpeg;tiff;jpg;” (default)

‘jpeg’ and ‘jpg’ because some websites return strange mimetypes (should be ‘jpeg’ only)

-8 --force-utf8

For textitems only.
Some providers (like_metrolyrics_) might return text with strange encodings,
that can not be converted to regular UTF8, but might return a subset of UTF8.
This options forces libglyr to prohibit those.

DATABASE OPTIONS

-c --cache <dir>

Cache all items you search in a file called metadata.db in the directory

.
If you ask for this item more than once it gets fetched from the cache, which is obviously much faster.
cache select [Query]

Selects data from the cache; you can use any other option behind this.
Example: Search for two items in cache and print them.
glyrc cache select lyrics -a Knorkator -t 'A' -n 2 --cache /tmp them

cache delete [Query]

Deletes data from the cache; you can use any other option behind this.
Example: Delete artist/album
glyrc cache delete cover -a Equilibrium -b Sagas --cache /tmp

cache list

Lists all data in the cache.
Example:
glyrc cache list --cache /tmp

MISC OPTIONS

-j --callback <cmd>

Whenever a item is retrieved the command cmd is executed.
The command might contain the special string ‘’ that is
expanded with the path to the item at runtime.

Examples:

  • cat <path>; echo
    Prints the items to the terminal.
  • rm <path>
    same as -w null
-L --list

List all compiled in providers and the corresponding getter.

-v --verbosity <integer>

The verbosity level that is used by libglyr:

  • 0: No output, but fatal errors.
  • 1: Basic warnings.
  • 2: Normal informal output
  • 3: Basic debug output
  • 4: Full debug output
-h --help

The very short version of this text.

-V --version

Print version string and exit.