Calling quvi_new creates a libcURL session handle. This handle is reused by libquvi to access the Internet until quvi_free is called. libcURL sets most of the initial values for the handle when it is created by calling curl_easy_init(3). libquvi will, additionally, make the following changes to the handle when quvi_new is called:
The scripts (e.g. Media script) may modify the cookie and HTTP header settings dynamically which may be required in order to access some of the resources, e.g. Media stream. For this reason, it may be necessary for the 3rd party applications using libquvi to reuse the current session handle in order to access these sources. The session handle may be queried using the quvi_get function.
The following functions will reset the session handle to its initial state when they are called:
Any cookie and header settings that were set by any of the scripts previously, will be lost when those functions are called.
A property that belongs to a medium, e.g. title. These are parsed and returned by a Media script.
A string value that is used to identify the Media stream. They are generated for each available media stream. They may vary per website.
The Media stream ID typically consists of:
A typical ID could look like:
$quality_$container_$encoding_$height(p)
Whether they are used in the Media stream ID depends on whether the website has made the data available, and whether the Media script parses the properties and uses them.
Sometimes these IDs may as simple as "hd" or "sd", although as of libquvi(-scripts) 0.9 the media scripts are expected to use the "standardized representation of the stream ID" whenever possible.
Example: Dailymotion
hq_mp4_h264_480p
Example: YouTube
Similar, but uses the container value instead of the video encoding value. It also uses the 'itag' value, which is specific to YouTube.
hd720_webm_i45_720p
A Media property that is specific to a Media stream. Like with Media property, these are parsed and returned by a Media script.
A stream of media, e.g. multimedia. Some websites provide >1 media streams for the hosted content, in which case the Media script will usually try to parse the URLs to these streams and return them to the library.
The best quality stream is determined and flagged as such by a Media script when there are >1 streams available. How the best quality stream is determined depends on the website and the Media script.
The library uses the keyword 'best' with quvi_media_stream_select to identify this stream.
This is whatever the Media script returns as the first stream. This stream is returned always.
The subtitle data format varies per website, e.g. YouTube uses a custom timed-text (TT) format for CCs and TTSes. Generally speaking, the applications may ignore this format as the API has been designed so that the library provides the data in the requested format.
An available subtitle language. Each Subtitle type consists of (available) languages.
A string value that is used to identify the Subtitle language. They are generated for each available language.
Either a closed-caption (CC) or a text-to-speech (TTS, sometimes referred to as "automatic captions"). Each subtitle consists of a varying number of available languages.
An Internet address to the media, e.g. "http://youtube.com/watch?v=foo". This URL should not be confused with Media stream URL.
An Internet address to the Media stream. This URL should not be confused with Media URL.
A collection of Media URL s.
A property of a script, that may be of either a Media script, a Playlist script, a Scan script or an Utility script.
An URL that has been "compressed", or "shortened", by a service such as is.gd or bit.ly .
A step, previously until libquvi 0.9, was called a "media stream URL verification process", during which the library would send an HTTP HEAD request to the server to query the content-type and the content-length. This step would also try to guess the file extension to the media from the content-type. This step took place immediately after returning a Media stream URL from a Media script.
The verification process step was removed in libquvi 0.9, but an additional function set was added to allow to querying this meta-info if necessary.