libquvi
Parsing playlist properties

libquvi supports parsing a playlist properties (e.g. media URLs), these may be accessed using the Playlist property functions.

The available pl_script collection determines which websites are supported by the library.

Note
Using any of the QUVI_PLAYLIST_MEDIA_PROPERTY_* values with quvi_playlist_get will cause the library to advance to the first media item in the list. This will make quvi_playlist_media_next function to continue from the second media stream, not the first one as one might expect.

For example:

abort_if_error();
{
char *p_id, *m_url;
quvi_playlist_get(qp, QUVI_PLAYLIST_PROPERTY_ID, &p_id);
/* Advances the playlist media list, starting from the first. */
quvi_playlist_get(qp, QUVI_PLAYLIST_MEDIA_PROPERTY_URL, &m_url);
/* Would now continue from second media item in the list. */
while (quvi_playlist_media_next(qp) == QUVI_TRUE)
quvi_playlist_get(qp, QUVI_PLAYLIST_MEDIA_PROPERTY_URL, &m_url);
}

Where as:

abort_if_error();
{
char *p_id, *m_url;
quvi_playlist_get(qp, QUVI_PLAYLIST_PROPERTY_ID, &p_id);
/* Would start from the first stream in the list. */
while (quvi_playlist_media_next(qp) == QUVI_TRUE)
quvi_playlist_get(qp, QUVI_PLAYLIST_MEDIA_PROPERTY_URL, &m_url);
}

Alternatively, call quvi_playlist_media_reset after the quvi_playlist_get call.

Example

This example parses a playlist, then queries the media properties for each found media URL.

abort_if_error();
{
char *s;
quvi_playlist_get(qp, QUVI_PLAYLIST_PROPERTY_ID, &s);
while (quvi_playlist_media_next(qp) == QUVI_TRUE)
{
quvi_playlist_get(qp, QUVI_PLAYLIST_MEDIA_PROPERTY_URL, &s);
abort_if_error();
{
abort_if_error();
/* ... */
qm = NULL;
}
quvi_playlist_get(qp, QUVI_PLAYLIST_PROPERTY_TITLE, &s);
}
}
quvi_playlist_free(qp); /* Release when done using it. */
qp = NULL;
See Also
Parsing media properties
QuviPlaylistProperty