Search
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 options from Destination
group.
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.
Search config
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 Postprocess
and Destination
) provide extra features and do not depend on selected provider.
Option 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 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 Destination
and Postprocess
will work.
Providers
Currently there are only search providers providing possibility to search on Youtube. Basically there are two ways to search. First one (let's call it "WEB") extracts all info from corresponding web pages. The second one (let's call it "API") uses Youtube Data API to get all info.
WEB way is represented by provider youtube.web
. It has the same set of search filters as one can find on Youtube site except the ones requiring user authentication and geolocation info.
API way is represented by five providers whose names start with youtube.api
. Youtube 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.
Provider youtube.api
tries to give the same set of options as standard search on Youtube site. This is not entirely possible since some options (like search for HDR videos) are not exposed by API.
Full set of differences between youtube.web
and youtube.api
is listed in the following table.
Difference | WEB | API |
---|---|---|
Variety of search filters | Exclusive features: 4K, 360°, VR180, HDR | API does not provide a way to search for 4K, 360°, VR180, HDR |
Search items per page | Fixed: 20 | Configurable: 1 to 50 |
Search results completeness | No likes/dislikes | Complete |
Upload date in search results | Relative, approximated (e.g. "5 years ago"), localized in component language (if you use Youtube cookies, language stored there has precedence) | Absolute, exact (YYYY-MM-DD) |
View count in search results | Approximated (e.g. "18M" for ~18 million), localized in component language | Exact number |
Possibility to break due to internal change on the site | Average | Low |
Providers youtube.api.video
, youtube.api.playlist
, youtube.api.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 authentication.
Provider youtube.api.related
represent "search for related videos" feature provided by API (see relatedToVideoId
). Search query in this case should be Youtube video ID (e.g. for URL https://www.youtube.com/watch?v=QueRtYuIOp4
video ID is QueRtYuIOp4
).
Destination
This group controls where and how search results are added.
There are three options to select destination playlist: active 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 to be performed when adding results to destination playlist.
Option wipe before add
means that content of destination playlist should be wiped 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 than 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' track
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. If you want to retrieve next portion without playback interruption use context menu Youtube Source Fetch items
.
Postprocess
This group holds features that are applied to search results after search completes.
Action add %tracknumber%
stores index in found tracks as %tracknumber%
metadata field.
Action 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
Subject of this topic is Youtube Source Search
popup menu from playlist context menu.
The idea is to construct search query basing on playlist item metadata and search it on the site. Note that 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 regular search and works the same except that search query is generated automatically. Use context menu of list control there to check available options.
Search replacement
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 track 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.
Query | Results | Description |
---|---|---|
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 comparing 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 |
Help Search