RobertoHGMV/YoutubeTranscriptor

.NET Web API that turns YouTube transcripts into AI summaries and saves them to Notion.

C#

0

0 commits

updated Jan 25, 2026

See the code

README

YoutubeTranscriptor

A .NET Web API built with Clean Architecture, DDD, and SOLID principles that extracts transcripts from YouTube videos, generates study summaries using AI (Hugging Face), and saves them to a Notion database.

🚀 Features

  • YouTube Transcript Extraction: Extracts closed captions/subtitles from YouTube videos using YoutubeExplode.
  • AI Summarization: Generates bullet-point summaries and key concepts using Hugging Face Inference API (BART model).
  • Notion Integration: Automatically creates formatted pages in Notion with the generated study notes.
  • Resilience: Implements retry policies (Exponential Backoff) using Polly for external API interactions.
  • Best Practices:
    • Clean Architecture (Domain, Application, Infrastructure, API).
    • Dependency Injection.
    • Strongly-typed configurations.
    • Unit Tests with xUnit and Moq.

🏗 Architecture

The solution follows the Clean Architecture layers:

  • Domain: Core business logic, Entities (VideoTranscript, Summary), and Value Objects. No external dependencies.
  • Application: Use Cases (GenerateSummaryUseCase), Interfaces/Ports (IGetTranscriptService, etc.), and DTOs.
  • Infrastructure: Implementation of adapters (YouTube, Hugging Face, Notion) and external concerns.
  • Api: Entry point (REST Controllers), DI configuration, and Middleware.

🛠 Tech Stack

  • .NET 8+ (Targeting .NET 10 Preview in this environment)
  • YoutubeExplode: For transcript extraction.
  • Microsoft.Extensions.Http.Polly: For resilience and fault tolerance.
  • Newtonsoft.Json: For JSON processing.
  • xUnit & Moq: For unit testing.

⚙️ Configuration

Before running the application, you need to configure your API keys.

  1. Open YoutubeTranscriptor.Api/appsettings.json.
  2. Update the following sections with your credentials:
{
  "HuggingFace": {
    "ApiKey": "YOUR_HUGGING_FACE_API_KEY"
  },
  "Notion": {
    "DatabaseId": "YOUR_NOTION_DATABASE_ID",
    "ApiKey": "YOUR_NOTION_API_KEY"
  }
}

Note: For production, consider using User Secrets or Environment Variables.

🏃 How to Run

  1. Restore dependencies:

    dotnet restore
    
  2. Run the API:

    dotnet run --project YoutubeTranscriptor.Api
    
  3. Access Swagger: The API will launch (usually on https://localhost:7286 or http://localhost:5271). Visit /swagger to inspect the endpoints.

🧪 Testing

Run the unit tests to verify the core logic:

dotnet test

🔌 API Usage

Generate Summary

POST /api/Transcript/generate

Request Body:

{
  "videoUrl": "https://www.youtube.com/watch?v=YOUR_VIDEO_ID"
}

Response:

{
  "notionPageUrl": "https://notion.so/your-new-page-id",
  "summaryContent": "• Key point 1\n• Key point 2..."
}

RobertoHGMV/YoutubeTranscriptor

.NET Web API that turns YouTube transcripts into AI summaries and saves them to Notion.

C#

0

0 commits

updated Jan 25, 2026

See the code

README

YoutubeTranscriptor

A .NET Web API built with Clean Architecture, DDD, and SOLID principles that extracts transcripts from YouTube videos, generates study summaries using AI (Hugging Face), and saves them to a Notion database.

🚀 Features

  • YouTube Transcript Extraction: Extracts closed captions/subtitles from YouTube videos using YoutubeExplode.
  • AI Summarization: Generates bullet-point summaries and key concepts using Hugging Face Inference API (BART model).
  • Notion Integration: Automatically creates formatted pages in Notion with the generated study notes.
  • Resilience: Implements retry policies (Exponential Backoff) using Polly for external API interactions.
  • Best Practices:
    • Clean Architecture (Domain, Application, Infrastructure, API).
    • Dependency Injection.
    • Strongly-typed configurations.
    • Unit Tests with xUnit and Moq.

🏗 Architecture

The solution follows the Clean Architecture layers:

  • Domain: Core business logic, Entities (VideoTranscript, Summary), and Value Objects. No external dependencies.
  • Application: Use Cases (GenerateSummaryUseCase), Interfaces/Ports (IGetTranscriptService, etc.), and DTOs.
  • Infrastructure: Implementation of adapters (YouTube, Hugging Face, Notion) and external concerns.
  • Api: Entry point (REST Controllers), DI configuration, and Middleware.

🛠 Tech Stack

  • .NET 8+ (Targeting .NET 10 Preview in this environment)
  • YoutubeExplode: For transcript extraction.
  • Microsoft.Extensions.Http.Polly: For resilience and fault tolerance.
  • Newtonsoft.Json: For JSON processing.
  • xUnit & Moq: For unit testing.

⚙️ Configuration

Before running the application, you need to configure your API keys.

  1. Open YoutubeTranscriptor.Api/appsettings.json.
  2. Update the following sections with your credentials:
{
  "HuggingFace": {
    "ApiKey": "YOUR_HUGGING_FACE_API_KEY"
  },
  "Notion": {
    "DatabaseId": "YOUR_NOTION_DATABASE_ID",
    "ApiKey": "YOUR_NOTION_API_KEY"
  }
}

Note: For production, consider using User Secrets or Environment Variables.

🏃 How to Run

  1. Restore dependencies:

    dotnet restore
    
  2. Run the API:

    dotnet run --project YoutubeTranscriptor.Api
    
  3. Access Swagger: The API will launch (usually on https://localhost:7286 or http://localhost:5271). Visit /swagger to inspect the endpoints.

🧪 Testing

Run the unit tests to verify the core logic:

dotnet test

🔌 API Usage

Generate Summary

POST /api/Transcript/generate

Request Body:

{
  "videoUrl": "https://www.youtube.com/watch?v=YOUR_VIDEO_ID"
}

Response:

{
  "notionPageUrl": "https://notion.so/your-new-page-id",
  "summaryContent": "• Key point 1\n• Key point 2..."
}

Languages

C#

100.0%