Skip to main content

YouTube Timeline Pipeline

Project description

TubeLine

TubeLine is a Python library that analyzes YouTube videos by converting audio into text and automatically segmenting the video into topic-based time ranges.

It performs the following pipeline:

  1. Download audio from a YouTube video

  2. Transcribe speech using Deepgram (STT)

  3. Analyze topic transitions using Google Gemini

The final output is a list of time ranges with concise topic descriptions.


Features

Automatic YouTube audio download

Korean speech-to-text using Deepgram

Topic segmentation based on video flow

Timestamped topic summaries

Simple and clean Python API


Installation

pip install TubeLine


Requirements

Python 3.10 or higher

FFmpeg (required by yt-dlp)

Install FFmpeg

macOS

brew install ffmpeg

Ubuntu / Debian

sudo apt install ffmpeg

Windows

Download from: https://ffmpeg.org/download.html

Make sure ffmpeg is available in your system PATH.


Usage

Basic Example

import TubeLine

TubeLine.set( deepgram_api_key="YOUR_DEEPGRAM_API_KEY", gemini_api_key="YOUR_GEMINI_API_KEY" )

result = TubeLine.run("https://www.youtube.com/watch?v=VIDEO_ID") print(result)


Output Format

The output is plain text in the following format:

<start_time~end_time> - topic description

Example:

00:00:0000:02:15 - Introduction and stream opening 00:02:1500:08:40 - Discussion about recent updates 00:08:40~00:15:10 - Main gameplay explanation

Time format: HH:MM:SS

Maximum number of segments: 8

Short consecutive segments may be merged automatically


API Reference

TubeLine.set()

Configure API keys at runtime.

TubeLine.set( deepgram_api_key: str | None, gemini_api_key: str | None )

TubeLine.run()

Run the full pipeline on a YouTube URL.

TubeLine.run(url: str, quality: str = "low") -> str

quality: "low" (default) or "high"


Notes

API keys are not stored permanently and must be set at runtime.

STT output may contain recognition errors; Gemini compensates for these during analysis.

This library does not download or store video files, only audio.


License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tubeline-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tubeline-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file tubeline-0.1.0.tar.gz.

File metadata

  • Download URL: tubeline-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tubeline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60d42593b5cd308bc92ec3280e988a17b72cd440d93fc623167c04af24253b48
MD5 4dc47a5a3b021b00bb81997633f30b63
BLAKE2b-256 00d8acb7f51472a0a7b8859aac41bbdcd2d34220c852c10327fa708f1b86964e

See more details on using hashes here.

File details

Details for the file tubeline-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tubeline-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tubeline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d74ffed2e07a4717e535c9bcf13f6f0d81481d8485cfb08cc853c41c20cbe9e7
MD5 455f0f6d179ab4544294079e35a7bca5
BLAKE2b-256 f8b1c7445c7b968d1a6b40e2b037077ef9b7a23041e9f1ea0b93695600085553

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page