11 Jun 2018

Help Extended

  1. Strategies for filling metadata
    1. Clip properties mapping
    2. Clip title parsing
  2. Metadata overriding
  3. Properties overriding

Metadata

Strategies for filling metadata

Component provides two strategies for filling metadata. First one is to map clip properties to metadata fields as is. Second one is to parse the clip title to extract metadata out of it. Clip properties mapping is the default strategy, because it gives consistent results for all clips. However if you mostly or always play music from Youtube, consider the clip title parsing strategy.

Clip properties mapping

For tracks representing video clips this approach is straightforward: use channel name as %artist% and original clip title on the site as %title%.

Tracks, representing feeds, have more metadata fields, because in addition to the feed properties it contains info about number of clips in the feed and current position.

MetadataInfo about search portionInfo about playlist portion
%title%search query stringplaylist title
%album%"Search""Playlist"
%album_artist%"Youtube"title of the channel where this playlist comes from
%tracknumber%index that would have the first clip obtained from this portion of the feed
%totaltracks%number of search resultsnumber of clips in the playlist
%discnumber%index of this feed portion, like page number for search results on the site
%totaldiscs%total number of feed portions
Additionally track duration represents number of items in this portion, one second equals to one item. Well, it is more convenient than it sounds.

Clip title parsing

In context of metadata, there are not much you can rely on when getting the clip from video site. The only useful text available is the clip name given to it by the person who uploaded the clip. And many music videos have title of the form similar to "%artist% - %title%" e.g. "Manowar - Mountains".

Option Clip title parsing rule (Preferences Tools Youtube Source Features Miscellaneous) adds possibility to split clip title to multiple metadata fields. By default there are three predefined rules. Below is their description in the order of appearance in the list:

  1. use whole clip title as track title
  2. use text part before first '-' character as artist name and other text as track title.
    For example, Queen - Bohemian Rhapsody will have artist "Queen" and title "Bohemian Rhapsody"
  3. same as previous but also ignore any artifacts that most likely do not belong to metadata (empirical rule) for example text within () or [] at end of the clip title.
    For example, Queen - Bohemian Rhapsody (Live At Wembley Stadium, Saturday 12 July 1986) will have artist "Queen" and title "Bohemian Rhapsody"

Clip title parsing rule is based on regular expressions.

Each string within %% (e.g. %title%) is replaced by (.*?) group. Then resulting expression is wrapped by '^' and '$'characters. For example

%artist% - %title%

becomes

^(.*?) - (.*?)$

If whole clip title matches to the expression then group values are used as appropriate metadata fields. Otherwise no metadata is added.

Metadata overriding

Metadata can be overridden on URL basis. This can be done by extending clip URL by pairs field=value where field is metadata field name prepended with fb2k_ prefix (to distinguish metadata fields from regular URL parameters). Like any other URL parameters, these should be separated by '&' character and should use percent-encoding when needed (expected character encoding is UTF-8).

Example:

https://www.youtube.com/watch?v=oozJH6jSr2U&fb2k_artist=Queen&fb2k_title=Bohemian%20Rhapsody

If URL has fb2k_ fields, then strategies for filling metadata are not applied to it.

Properties overriding

Track properties also can be specified when adding a clip URL. This is done similarly to Metadata overriding except that the prefix is fb2kx_. Also these fields are stripped from URL before creating playlist track. Corresponding properties are stored to the cache (without overwriting existing ones).

Possible values for track properties are the same as in custom metadata fields except that the suffixes are different (for example, to specify view count one should use fb2kx_view_count). One addition here is fb2kx_length property, using which one can specify the track length (in seconds). Example (track length is 5 minutes 39 seconds):

https://www.youtube.com/watch?v=oozJH6jSr2U&fb2kx_lenght=339

Help Extended Metadata