- Two ways to search
- Search config
- Search context menu
- Search replacement
- Tips for Youtube
Two ways to search
There are two way to perform search on site within the component: using search popup window (menu
View Youtube Source Search on Site) and using
Search (Integrated) UI element.
Auto-completion in search edit box can be turned off using option
Search Enable autocomplete in search query edit box.
Search (Integrated) UIE sends results directly to foobar2000 playlists. How and where exactly they are added is controlled by option from
Search popup window has list control where results are added. Then you can send selected items from this list to foobar2000 playlist (use context menu to check available options).
This window has option
Initial focus to search box> in system menu. When enabled, initial focus is always set to search box when window appears on the screen. Otherwise focus is restored on the control that had it last time the window was visible
Anchor of search config is
Provider group. All options after it are options specific to selected provider. Accordingly, all options before this group (i.e. groups
Destination) are not related to it and provide extra features.
Limit tells how many items to retrieve per single search request. It is part of provider config i.e. its maximum value (or whether it is available at all) depends on selected search provider.
Note, it is possible to use playlist URLs instead of search query. In this case options that belong to
Provider group are ignored, but
Postprocess will work.
Providers starting with
youtube. string perform search on Youtube using Youtube Data API. This API supports a lot of parameters, some of which can be used only for particular item types (only when searching for channels, or only when searching for videos). A deal between flexibility and usability ended up with five providers giving access to different intersecting sets of API parameters.
youtube.com tries to give the same set of options as standard search on Youtube site. This is not always possible since some options (like search for HDR videos) are not provided by API.
youtube.channel do not attempt to be convenient. They are reference implementation of API capabilities for videos, playlists and channels search respectively. There are included all options available for particular item type except options that require user authorization.
youtube.related represent "search for related videos" feature provided by API (see
relatedToVideoId). Search query there should be Youtube video ID to make it work.
This group controls where and how search results are added.
There are three options to select destination playlist:
new playlist and
specific playlist. In the latter case you specify playlist title, and search results will always be added to this playlist. It will be created if yet does not exist. Otherwise first playlist with specified name will be used as destination.
In addition to destination playlist options in this group can be selected few actions that should be performed when adding results to destination playlist.
wipe before add tells it to wipe content of destination playlist before adding search results.
By default search results are appended to the list of tracks in playlist. Option
insert in front makes that search results are inserted on top of existing tracks in destination playlist.
If there are more search results that the number in
Limit option, at the end of results in destination playlist will be also inserted track representing next portion of the search. When it is selected to play, it gets replaced by search results from next portion and, if there are more results, another track for next portion. And so on.
If you do not need this "next" track, you can use
skip 'next' item option.
More about this "next" track. If it is played during regular playback (for example previous track ended and it was selected to play next) then search results will be placed to playlist and playback will continue from the first search result. To retrieve next portion without playback interruption one can use context menu
Youtube Source Fetch items.
This group holds features that are applied to search results after search completes.
add %tracknumber% exposes index in results list as %tracknumber% metadata field.
add playlist meta tags works only for playlists. When loading playlist items, it adds next metadata fields to each track (using metadata overriding):
%playlist_title%, %playlist_url%, %playlist_pos%.
Search context menu
Playlist context menu has
Youtube Source Search popup menu. These are the subject of this topic.
The idea is to construct search query basing on playlist item metadata and search for that on Youtube. And original track does not have to be Youtube video. It can be any local audio file or currently playing song from radio station.
Search items are enabled only when there is selected single playlist item. Particular search item is enabled only if evaluated search query for this item is not empty.
Existing search items can be configured, as well as new ones can be added, using component preferences
Search Context Menu tab. It has full set of features available in integrated search and works the same except that search query is generated automatically. Right click on the list to check available options.
This feature is originally intended for the cases when you have video which is no longer available (due to account termination or any other reason). This command replaces selected tracks with a search track configured to search for replacement on Youtube and use first search result.
This functionality is placed in
Youtube Source popup menu of playlist context menu. There are available two variants of the search: auto and manual.
Search query for auto variant is generated using titleformatting. Rule for it can be configured using option
Search Pattern for automatic substitution.
Manual variant does the same but before substitution appears dialog box where search query can be edited.
Regular (i.e. non-Youtube) playlist items can also be replaced.
Tips for Youtube
Search on Youtube is case insensitive. It is performed in all metadata i.e. not only in title but also in description, user names, keywords etc.
Search supports several rules to customize search query. They are listed in the table below with example of every rule and brief description. Note the number of search results for every rule.
|wacken||829844||Search videos containing word Wacken (case-insensitive)|
|wacken -2016||541051||Hyphen before a word excludes videos containing this word from the search results. So this search query means "search videos containing word wacken and not containing word 2016". Note the decrease in the number of results compared to previous example|
|wacken 2016||188854||Search videos assotiated with both search terms|
|"wacken 2016"||71828||Search for exact phrase. So for example "Wacken Open Air 2016" will be omitted.|
Note that phrase should be wrapped in double quotes. If you wrap it for example in single quotes, they will be ignored by the search engine.
Also note, when searching by exact phrase, word separators do not matter. For example, search query "one two three" will also match "one, two, three" and "one-two-three"
|wacken | 2016||1M+||Search word Wacken OR word 2016|