| Name | Message | Date |
|---|---|---|
| 📄 YouTubeCredentialsProvider.cs | 3 days ago | |
| 📄 YouTubeOptions.cs | 3 days ago | |
| 📄 YouTubeServiceCollectionExtensions.cs | 3 days ago |
📄
src/Cli/YouTubeAuth/YouTubeCredentialsProvider.cs
using System.Threading; using System.Threading.Tasks; using Google.Apis.Auth.OAuth2; using Microsoft.Extensions.Options; using Slopper.Cli.YouTubeAuth; using Slopper.Infrastructure.YouTube; internal sealed class YouTubeCredentialsProvider(IOptions<YouTubeOptions> options) : IYouTubeCredentialsProvider { private readonly string clientId = options.Value.ClientId; private readonly string clientSecret = options.Value.ClientSecret; private readonly string user = options.Value.User; public async Task<ICredential> GetCredentials(CancellationToken cancellationToken) => await GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets() { ClientId = clientId, ClientSecret = clientSecret }, ["https://www.googleapis.com/auth/youtube.upload"], user, cancellationToken ); }