1. Exposed Interfaces
    1. IAMMediaContent
    2. IAMNetworkStatus
    3. IAMOpenProgress
    4. ISupportedSites
    5. IPropertyBag, IPropertyBag2
  2. Settings Overriding
    1. Download subtitles

Developers

Exposed Interfaces

Among with interfaces that are usual for DirectShow source filter (IBaseFilter, IFileSourceFilter, IAMFilterMiscFlags, ISpecifyPropertyPages), filter exposes few other standard and custom interfaces. They are listed below. Not all functions of these interfaces are implemented, others will return E_NOIMPL.

IAMMediaContent

Implemented methods:

Returned text is ready to use, i.e. any URL encoding, HTML entities, HTML tags etc. are removed.

IAMNetworkStatus

1.1.1+

Implemented methods:

IAMOpenProgress

Implemented methods:

ISupportedSites

1.4.3+

This interface provides info about supported sites and exposes the way to test whether particular URL is supported or not.

This is custom interface, detailed description can be found in the archive below.

Archivedevelopers.zip

IPropertyBag, IPropertyBag2

1.6.1+

Using these interfaces filter exposes additional metadata and technical info. Since 1.8.2 they also can be used to override settings, for details see Settings Overriding below.

List of exposed properties:

NameTypeDescription
titlekProperty3dydMetaClip title
descriptionkProperty3dydMetaClip description
channel_namekProperty3dydMetaName of uploader or channel to which the video belongs
view_countkProperty3dydMetaNumber of views of the video
thumbnail_urlskProperty3dydTechURL(s) of the clip thumbnail *
datekProperty3dydSpecialClip publication date, UNIX time, in seconds **
channel_idkProperty3dydTechUnique identifier of the channel (channel_name is the name displayed on the site, it does not have to be unique)
playlist_idkProperty3dydTechUnique identifier of the video playlist
like_countkProperty3dydMetaNumber of likes of the clip
dislike_countkProperty3dydMetaNumber of dislikes of the clip

* - if there are several URLs, they are separated by '\0' character. In this case they are ordered by quality, best quality comes first

** - can have negative value, in this case only date is known for sure, otherwise both date and time are correct

Field dwHint field of PROPBAG2 structure is used to report property type. It is kind of the way for forward compatibility, possible values are described in the table below.

kProperty3dydMetaProperty is a metadata field
kProperty3dydTechProperty is a bit technical but still can be displayed to the user 'as is'
kProperty3dydSpecialProperty requires additional processing and has no meaning for the user if displayed 'as is'

Settings Overriding

1.5+

All quality-related settings and few other settings can be overridden. This can be done either by custom URL parameters or programmatically via IPropertyBag/IPropertyBag2 interfaces. The latter is available starting from version 1.8.2. If some parameter is presented using both ways, URL parameter takes precedence.

Value of URL parameter can be URL-encoded if need. Example of custom URL parameter (select 720p video):

https://youtube.com/watch?v=xXxxXXxxXxx&ys_video_resolution=720p

The same with IPropertyBag:

if (CComQIPtr<IPropertyBag> bag = filter) {
  CComVariant value("720p");
  bag->Write(L"ys_video_resolution", &value);
}

When using IPropertyBag/IPropertyBag2, configuration should be done before calling IFileSourceFilter::Load(). All values (including numeric ones) should be passed as strings.

All parameters reflect appropriate options in filter properties, no more, no less. All overridden options that was found are be reported in Log (tab in the filter properties).

Below is complete list of parameters with mapping to appropriate option. If not stated explicitly, expected value is the same as in appropriate option from the filter properties. For check boxes expected values are 0 and 1 (unchecked and checked respectively).

URL paramMapped optionValue
ys_show_in_systrayShow icon in system tray
ys_show_err_wnd(v1.8+) Show error window when failed to open a clip
ys_video_resolutionPreferred video resolutionsmallest / 144p / 240p / 360p / 480p / 720p / 1080p / 1440p / 2160p / 3072p / best
ys_audio_bitratePreferred audio bitrateauto / 32k / 64k / 128k / 192k / 256k / best
ys_prefer_hfr(v1.7+) Prefer high frame rate videos
ys_prefer_hdr(v1.7+) Prefer high dynamic range videos
ys_prefer_3dPrefer 3D videos
ys_subs_downloadDownload subtitlesRead note below
ys_manual_selectManual quality selectionnever / always / hold_shift / hold_alt / hold_ctrl
ys_ignore_formatsFormats to ignore
ys_formats_priorityPriority of formats
ys_format_over_qualityFormat takes precedence over quality
ys_enable_dashEnable Youtube DASH streams
ys_muxing_exceptionsMuxing exceptions
ys_audio_onlyAudio-only output
ys_max_width(v1.7+) Maximum width of the video
ys_analysis_strategyGetting info about clipfast / medium / precise
ys_analysis_limitLimit of the part size
ys_predownloadDownloading the clip
ys_notify_bufferingEnable buffering notification
ys_tmpdir_typeTemporary directory (type)wintemp / custom
ys_tmpdir_pathTemporary directory (path)full path to the directory if ys_tmpdir_type=custom

Download subtitles

Prior to version 1.6 i.e. prior to auto-translated subtitles support and precise subtitles selection it had three possible values: never, all, except_asr. There all means regular subtitles + ASR and except_asr means only regular subtitles. In version 1.6 these values are still acceptable for back compatibility with exactly the same meaning i.e. auto-translated subtitles are not included in results.

Since 1.6 using this parameter can be specified any set of subtitles using next form:

sub1;sub2;sub3;...;subN

where subX has format type_num=lang_tag.

Value of type_numMeaning
0Regular subtitles
1ASR
2Auto-translated

Values of lang_tag are: special word _all (match any subtitle of given type) or language code (ISO 639-1 or 639-2, lowercase) appended by optional script code (ISO 15924, first letter uppercase, the rest lowercase) and/or optional country code (ISO 3166-1 alpha-2 (uppercase) or numeric). Subtitle becomes selected if its language tag contains any of provided language tags. 'Contains' means substring match, case-sensitive i.e. using generic C function it would be NULL != strstr(original_lang_tag, param_lang_tag).

For example, to download all regular subtitles, never download ASR, download English and Chinese (Traditional) auto-translated subtitles this parameter would be:

2=en;0=_all;2=zh-Hant