mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
change: sar rework, improved
This commit is contained in:
@@ -5,6 +5,47 @@ using JsonSerializer = System.Text.Json.JsonSerializer;
|
||||
|
||||
namespace NadekoBot.Modules.Searches.Common.StreamNotifications.Providers;
|
||||
|
||||
public sealed class YoutubeProvide : Provider
|
||||
{
|
||||
private readonly IGoogleApiService _api;
|
||||
private readonly IHttpClientFactory _httpFactory;
|
||||
|
||||
public override FollowedStream.FType Platform
|
||||
=> FollowedStream.FType.Youtube;
|
||||
|
||||
public YoutubeProvide(IGoogleApiService api, IHttpClientFactory httpFactory)
|
||||
{
|
||||
_api = api;
|
||||
_httpFactory = httpFactory;
|
||||
}
|
||||
|
||||
public override async Task<bool> IsValidUrl(string url)
|
||||
{
|
||||
await Task.Yield();
|
||||
// todo implement
|
||||
return url.Contains("youtube.com");
|
||||
}
|
||||
|
||||
public override Task<StreamData?> GetStreamDataByUrlAsync(string url)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
public override Task<StreamData?> GetStreamDataAsync(string login)
|
||||
{
|
||||
var client = _httpFactory.CreateClient();
|
||||
|
||||
client.GetAsync()
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public override Task<IReadOnlyCollection<StreamData>> GetStreamDataAsync(List<string> usernames)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TwitchHelixProvider : Provider
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
|
Reference in New Issue
Block a user