Static registry of media URL extractors used by the native resolver. Holds one instance per supported site (YouTube, Streamable, Vimeo, SoundCloud, Twitch, Kick, X, Archive, Bandcamp, HLS, DASH) and looks up an extractor by URL or by key.
namespace Bimp.Resolver.Extractors;
/// <summary>
/// Every site the native resolver understands.
/// </summary>
public static class ExtractorRegistry
{
// built on each call, not kept in a static: a hotload keeps statics, so new extractors never showed up (their caches
// are statics of their own)
public static IReadOnlyList<IExtractor> All => new IExtractor[]
{
new YouTubeExtractor(),
new StreamableExtractor(),
new VimeoExtractor(),
new SoundCloudExtractor(),
new TwitchExtractor(),
new KickExtractor(),
new XExtractor(),
new ArchiveExtractor(),
new BandcampExtractor(),
new HlsExtractor(), // any .m3u8 link
new DashExtractor(), // any .mpd link
#if BIMP_DEV
#endif
};
public static IExtractor For( Uri url ) => All.FirstOrDefault( e => e.CanHandle( url ) );
public static IExtractor ByKey( string key ) => All.FirstOrDefault( e => e.Key == key );
}