Skip to content

andreyshade/yt-dlp-rest-server

Repository files navigation

yt-dlp-rest-server

A REST API wrapper for yt-dlp.

Description

This REST API provides a simple way to fetch YouTube comments using yt-dlp. It downloads yt-dlp and ffmpeg on startup and provides an endpoint to retrieve comments for a given video ID.

Usage

Prerequisites

  • .NET SDK
  • Docker (optional)

Running the service

  1. Clone the repository:

    git clone <repository_url>
  2. Navigate to the project directory:

    cd yt-dlp-rest-server
  3. Build the project:

    dotnet build
  4. Run the project:

    dotnet run

    The service will be available at http://localhost:<port>.

Running with Docker

  1. Build the Docker image:

    docker build -t yt-dlp-rest-server .
  2. Run the Docker container:

    docker run --name yt-dlp-rest-server-container -p 8038:8080 -d yt-dlp-rest-server

    The service will be available at http://localhost:8038.

API Reference

GET /api/comments/{videoId}

Fetches YouTube comments for the given video ID.

Parameters

  • videoId: The ID of the YouTube video.

Example Request

GET /api/comments/GPMu_iEO5hs

Example Response

[
  {
    "Id": "Ugw...",
    "Author": "TechLead",
    "AuthorId": "@TechLead",
    "AuthorThumbnail": "https://...",
    "Html": "This is a great video! I learned a lot.",
    "Text": "This is a great video! I learned a lot.",
    "Timestamp": 1678886400,
    "Parent": "",
    "LikeCount": 100,
    "DislikeCount": 10,
    "IsFavorited": false,
    "AuthorIsUploader": false
  }
]

About

A REST API wrapper for yt-dlp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors