mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
add: Added .q support for invidious. If you have ytProvider set to invidious in data/searches.yml, invidious will be used to queue up songs and play them."work
This commit is contained in:
@@ -32,13 +32,14 @@ public sealed class InvidiousYtSearchService : IYoutubeSearchService, INService
|
||||
|
||||
var instance = instances[_rng.Next(0, instances.Count)];
|
||||
|
||||
var url = $"{instance}/api/v1/search"
|
||||
+ $"?q={query}"
|
||||
+ $"&type=video";
|
||||
using var http = _http.CreateClient();
|
||||
var res = await http.GetFromJsonAsync<List<InvidiousSearchResponse>>(
|
||||
$"{instance}/api/v1/search"
|
||||
+ $"?q={query}"
|
||||
+ $"&type=video");
|
||||
url);
|
||||
|
||||
if (res is null or {Count: 0})
|
||||
if (res is null or { Count: 0 })
|
||||
return null;
|
||||
|
||||
return new VideoInfo(res[0].VideoId);
|
||||
|
Reference in New Issue
Block a user