diff --git a/YoutubeDownloader.Core/Resolving/QueryResolver.cs b/YoutubeDownloader.Core/Resolving/QueryResolver.cs index 11a0326dd..05791c87b 100644 --- a/YoutubeDownloader.Core/Resolving/QueryResolver.cs +++ b/YoutubeDownloader.Core/Resolving/QueryResolver.cs @@ -111,11 +111,17 @@ private async Task ResolveSearchAsync( public async Task ResolveAsync( string query, CancellationToken cancellationToken = default - ) => - await TryResolvePlaylistAsync(query, cancellationToken) - ?? await TryResolveVideoAsync(query, cancellationToken) - ?? await TryResolveChannelAsync(query, cancellationToken) - ?? await ResolveSearchAsync(query, cancellationToken); + ) + { + // If the query starts with a question mark, it's always treated as a search query + if (query.StartsWith('?')) + return await ResolveSearchAsync(query[1..], cancellationToken); + + return await TryResolvePlaylistAsync(query, cancellationToken) + ?? await TryResolveVideoAsync(query, cancellationToken) + ?? await TryResolveChannelAsync(query, cancellationToken) + ?? await ResolveSearchAsync(query, cancellationToken); + } public async Task ResolveAsync( IReadOnlyList queries, diff --git a/YoutubeDownloader/Views/Components/DashboardView.axaml b/YoutubeDownloader/Views/Components/DashboardView.axaml index 98ef0e25c..40cccbba8 100644 --- a/YoutubeDownloader/Views/Components/DashboardView.axaml +++ b/YoutubeDownloader/Views/Components/DashboardView.axaml @@ -27,6 +27,7 @@ ScrollViewer.HorizontalScrollBarVisibility="Hidden" Text="{Binding Query}" Theme="{DynamicResource SoloTextBox}" + ToolTip.Tip="Any valid YouTube URL or ID is accepted. Prepend a question mark (?) to perform search by text." Watermark="URL or search query">