14 Apr 2017

Help Extended

  1. Filling of metadata
    1. Clip title parsing rule
    2. Metadata overriding
    3. Clip title parsing rule overriding
    4. Metadata editing
    5. Precedence of the ways to fill metadata
  2. Clip length overriding
  3. Site-specific metadata

Metadata

Note about metadata fields length.

Currently all data that component uses to provide different metadata-related features is stored in tech info fields of the track. Not very good decision and probably that will be changed in future. As for now, why this could give trouble:

Filling of metadata

Clip title parsing rule

In context of metadata, there are not much you can relay 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 it. And many music videos have title of the form similar to '%artist% - %title%' e.g. 'Manowar - Mountains'.

Option Clip title parsing rule (placed in 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.
    E.g. 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.
    E.g. 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 $. 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

In addition to automatic metadata filling from the title there is a way to set metadata fields explicitly. 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 at least one fb2k_ field is present, global parsing rule is not used.

Clip title parsing rule overriding

Clip title parsing rule can be specified locally, on the clip basis. In this case it will override global parsing rule. This can be done using 3dydfy_parsing_rule URL parameter. Example:

https://www.youtube.com/watch?v=oozJH6jSr2U&3dydfy_parsing_rule=%25title%25

Note, unlike global parsing rule, this one is not getting turned off if metadata overriding is used. Found fb2k_ fields only overwrite fields that are found using this local parsing rule if there are conflicts.

Metadata editing

Metadata of the clips can be edited manually using standard ways. Empty and multiple values are not supported.

At retagging there need Youtube title so if track does not have it yet then will be performed usual track analysis to retrieve the clip title. In other words, initial edit sometimes could take more time than expected.

Precedence of the ways to fill metadata

All in all, filling of metadata goes in this way:

  1. use local parsing rule (3dydfy_parsing_rule)
  2. use fb2k_ fields (rewrites existing metadata fields of the same name)
  3. if there are no fb2k_ fields nor 3dydfy_parsing_rule then use global parsing rule
  4. use manually added/edited metadata (rewrites existing metadata fields of the same name)

Clip length overriding

Like with Clip title parsing rule overriding clip length also can be overridden. This can be done using URL parameter 3dydfy_alt_length. Expected value is number of seconds. Example (track length is 90 seconds):

https://www.youtube.com/watch?v=oozJH6jSr2U&fb2k_artist=Queen&3dydfy_alt_lenght=90

Site-specific metadata

Component exposes several clip properties via custom metadata fields. So they can be used in title formatting.

List of fields:

%3dydfy_title%Original title of the clip on the site
%3dydfy_description%Clip description on the site. If its length is greater than max tech info filed length then description will be truncated and appended with ' (...)'
Youtube-only, v1.5+:
%3dydfy_uploader%The title of the channel to which belongs the video. In most cases this is display name of the user but not always: channels on Youtube may not be associated with a user. Also this is a display name, it does not have to be unique unlike user names on Youtube
%3dydfy_rating%Average rating given by the users, from 1 to 5, where 5 is the best
%3dydfy_view_count%The number of times that the video has been viewed
%3dydfy_uploaded%Upload date in format YYYY-MM-DD HH:MM:SS. Can be used with functions $year, $month, $day_of_month, $date, $time
Youtube-only, v1.9+:
%3dydfy_like_count%, %3dydfy_dislike_count%The number of people who liked/disliked the video
%3dydfy_like_ratio%Ratio of likes to dislikes filtered to prevent unfair values. Filter is quite simple but could be more effective than plain ratio:
IF dislikes > 10 OR likes > 100 THEN ratio = MIN(likes/dislikes, 999)

Usage example can be viewed in video window fallback text.

Help Extended Filling of metadata