- Custom metadata
- Regular metadata
- Metadata overriding
- Properties overriding
- Global titleformatting fields
Metadata
Custom metadata
Component exposes the following metadata fields for the tracks made by it. Missing field (e.g. %fy_title%
for the search track) means this track type never gets this field.
Field | Track | Description |
---|---|---|
%fy_url% |
video | video page URL |
playlist | playlist URL | |
channel | channel URL | |
search | search page URL with corresponding search query | |
%fy_title% |
video | video title |
playlist | playlist title | |
channel | channel title | |
%fy_description% |
video | video description on the site |
channel | channel description | |
%fy_channel_title% |
video | title of the channel to which this video belongs |
playlist | title of the channel to which this playlist belongs | |
%fy_channel_url% |
video | URL of the channel containing this video |
playlist | URL of the channel containing this playlist | |
%fy_upload_date% in format YYYY-MM-DD |
video | video upload date |
playlist | playlist creation date | |
channel | channel creation date | |
%fy_view_count% |
video | number of times that the video has been viewed |
playlist | number of times that the playlist (not the videos in it) has been viewed | |
channel | total number of views for all videos on the channel | |
%fy_thumbnail_url% |
video | video thumbnail URL |
playlist | playlist image URL | |
channel | channel image URL | |
%fy_item_count% |
playlist | number of videos in the playlist |
channel | total number of videos on the channel | |
%fy_like_count%, %fy_dislike_count% |
video | number of likes and dislikes |
%fy_rating% |
video | rating from 1 to 5, calculated as 5 * likes / (likes + dislikes) |
%fy_like_ratio% |
video | ratio of likes to dislikes with omitted edge values, calculated as MIN(likes / dislikes, 999) IF (dislikes > 10 OR likes > 100) |
Metadata length limitations
This applies only to foobar2000 1.x
By foobar2000 design, custom metadata fields should be accessible instantly. File system, which is the main storage for these fields in the component, cannot be used in this case. So as intermediate storage is used a storage associated with the tracks (tech info fields).
This approach brings limitation for the length of these fields. Default limit for tech info fields is 200 bytes and transformed to UTF-8 characters it can be much shorter depending on text language. Any text that exceeds this limit is truncated.
You can increase this limit by editing infoMax
field in LargeFieldsConfig.txt
file which is located in foobar2000 application data directory. Simple way to access this directory is to start foobar2000 and holding the Shift
key go to menu File Browse configuration folder
.
Regular metadata
Tracks made by the component also have regular metadata, so they can be used out of the box.
Field | Track | Description |
---|---|---|
%title% |
video | video title |
playlist | playlist title | |
channel | channel title | |
search | search query string | |
%artist% |
video | channel title |
%album% |
playlist | Playlist |
channel | Channel |
|
search | Search |
|
%album_artist% |
playlist | channel title |
Playlist, channel, and search tracks are special. When "played", they expand to the portion of the feed they represent. For example, a search track is replaced with a portion of the search, i.e. several tracks for the search results, and possibly another search track, representing the next portion of the search.
Information about this portion of the feed is exposed using the following regular metadata fields.
%tracknumber% |
index that would have the first item fetched from this track |
%totaltracks% |
total number of items in the feed used by this track |
%discnumber% |
portion number; it is like the page number for the search results on the site |
%totaldiscs% |
total number of portions in the feed |
%length_seconds% i.e. track length |
number of items in this portion of the feed, one second for each item. For non-last portion this is always number of items per portion (e.g. number of search results per page), which depends on the feed type and provider (e.g. search via API vs WEB have different number of items per page). |
For example, playlist with 216 items, when retrieving it by 50 items per portion, will have the following metadata:
Portion# | %tracknumber% |
%totaltracks% |
%discnumber% |
%totaldiscs% |
%length_seconds% |
---|---|---|---|---|---|
1 | 1 | 216 | 1 | 5 | 50 |
2 | 51 | 216 | 2 | 5 | 50 |
3 | 101 | 216 | 3 | 5 | 50 |
4 | 151 | 216 | 4 | 5 | 50 |
5 | 201 | 216 | 5 | 5 | 16 |
Metadata from the video title
As alternative to the mapping metadata to the video properties component provides a way to generate metadata from the original video title. This way parts of original title are used as different metadata fields.
For example, many music videos use title in the form like "%artist% - %title%" e.g. "Manowar - Mountains", so both %artist%
and %title%
can be extracted from the original title.
To enable this way of producing metadata select option Metadata Way to produce Parse original title
. A Pattern
edit box next to this option then controls how to parse the title.
It contains a regular expressions with named subexpressions. If subexpression matches to non-empty string, this string is used as a metadata field value and subexpression name is used then as a metadata field name.
Video title must fully match regular expression. Otherwise no metadata is added.
Metadata overriding
Metadata can be overridden on URL basis. This can be done by extending video URL with 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 ampersand 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, none of the ways to produce metadata is applied to it.
foobar2000 uses two properties to identify the track: location and subsong index. Two tracks are treated as identical if these properties are equal for them. In context of metadata overriding this brings a question how to make two tracks referencing the same video page but having different overridden metadata to be different from foobar2000 point of view. If they will not be different then metadata update of one of them will automatically trigger update to the same values for the other one.
Approach taken by the component is to embed all given fb2k_
fields into location string. This way tracks with different overridden metadata will be unique for foobar2000 even when they are referencing the same video page.
Properties overriding
Track properties exposed by the custom metadata fields can also be specified when adding video URL. This is done similarly to metadata overriding except that the prefix is fb2kx_
. Also unlike fb2k_
fields these ones do not become part of the track location string. Component strips them from URL before creating track and stores corresponding properties in the cache (without overwriting existing ones).
Possible values for the track property field names are the same as in the custom custom metadata fields except that the suffixes are different (for example, to specify view count need to use fb2kx_view_count
). One addition here is fb2kx_length
property, using which can be specified the track length (in seconds). Example (track length is 5 minutes 39 seconds):
https://www.youtube.com/watch?v=oozJH6jSr2U&fb2kx_length=339
Global titleformatting fields
Component exposes few fields that are not bound to specific tracks and contain video-related information:
%video_playback_state% |
state of the video playback (Stopped , Opening... etc.) |
%video_file_stats% |
media description of the file used in video playback |
%video_popup_status% |
status of the video popup window (possible values are visible and hidden ) |
Help Metadata