- Remove projetos mortos: VideoStudy.Native (MAUI), Controllers/LicenseController - Remove serviços não usados: FFmpegService, HardwareIdService, LicenseManager, PdfGeneratorService, ScreenshotService, TranscriptionService do UI - Remove dependências pesadas do UI: Whisper.net, YoutubeExplode, QuestPDF - Remove PuppeteerSharp e SkiaSharp do API (150MB Chromium não é mais necessário) - Screenshots agora usam FFmpeg diretamente (mais simples, mais confiável) - YouTubeService reescrito para chamar /api/video-info em vez de YoutubeExplode - Adiciona campo UserContext em AnalysisRequest (contexto livre do usuário) - UI traduzida para português; aba de arquivo local removida (nunca funcionou) - YouTubeProcessor simplificado: sem modo Advanced/Whisper - GetYtDlpPath busca yt-dlp.exe subindo até 7 níveis de diretório - Cookies do yt-dlp configuráveis via YtDlp:CookiesBrowser no appsettings - Chave Groq agora lida de env var GROQ_API_KEY (appsettings.json sem segredos) - VideoStudy.Linux (Photino) adicionado à solução como host multiplataforma - yt-dlp atualizado de 2025.01.26 para 2026.03.17 (fix do nsig extraction) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
589 B
C#
22 lines
589 B
C#
using System.Net.Http.Json;
|
|
using VideoStudy.Shared;
|
|
|
|
namespace VideoStudy.UI.Services;
|
|
|
|
public class YouTubeService
|
|
{
|
|
private readonly HttpClient _httpClient;
|
|
|
|
public YouTubeService(HttpClient httpClient)
|
|
{
|
|
_httpClient = httpClient;
|
|
}
|
|
|
|
public async Task<VideoInfo> GetVideoInfoAsync(string url)
|
|
{
|
|
var encodedUrl = Uri.EscapeDataString(url);
|
|
var info = await _httpClient.GetFromJsonAsync<VideoInfo>($"api/video-info?url={encodedUrl}");
|
|
return info ?? throw new Exception("Não foi possível obter informações do vídeo.");
|
|
}
|
|
}
|