# certifiedcoders/ytlookup architecture

> Architecture diagram of the GitHub repository certifiedcoders/ytlookup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/certifiedcoders/ytlookup
- Repository: https://github.com/certifiedcoders/ytlookup

## Overview

ytlookup is a small async Python library for retrieving YouTube video details, searching videos, and fetching playlist metadata and videos. Developers call the exported Video, videosearch, or Playlist APIs; these workflows make InnerTube requests, parse responses, and return structured results. Video and playlist workflows can request optional extra details. The sampled files show the request, parsing, and formatting layers; playlist enrichment details are only partially excerpted, so that relationship is based on the module reference and documented option.

Main entry points: [`ytlookup/handlers.py`](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/handlers.py) (InnerTube Requests), [`ytlookup/__init__.py`](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/__init__.py) (Public Exports), [`ytlookup/playlist.py`](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/playlist.py) (Playlist Retrieval), [`ytlookup/video.py`](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/video.py) (Video Details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_exports["Public Exports<br/>[__init__.py]"]
end

subgraph group_workflows["Retrieval Workflows"]
  node_search["Video Search<br/>[search.py]"]
  node_video["Video Details<br/>[video.py]"]
  node_playlist["Playlist Retrieval<br/>[playlist.py]"]
end

subgraph group_core["Request And Parsing"]
  node_request["InnerTube Requests<br/>[handlers.py]"]
  node_response["Renderer Parsing<br/>[handlers.py]"]
  node_formatting["Data Formatting<br/>[formatting.py]"]
end

node_developer(("Library User"))
node_youtube["YouTube InnerTube"]
node_aiohttp["aiohttp Client"]

node_developer -->|"calls"| node_exports
node_exports -->|"exports"| node_search
node_exports -->|"exports"| node_video
node_exports -->|"exports"| node_playlist
node_search -->|"requests"| node_request
node_search -->|"parses results"| node_response
node_video -->|"requests"| node_request
node_playlist -->|"requests"| node_request
node_playlist -->|"fetches details"| node_video
node_request -->|"sends requests"| node_youtube
node_request -->|"uses client"| node_aiohttp
node_response -->|"uses helpers"| node_formatting
node_video -->|"formats fields"| node_formatting
node_playlist -->|"formats fields"| node_formatting

click node_exports "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/__init__.py"
click node_search "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/search.py"
click node_video "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/video.py"
click node_playlist "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/playlist.py"
click node_request "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/handlers.py"
click node_response "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/handlers.py"
click node_formatting "https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/formatting.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_exports,node_developer,node_aiohttp toneBlue
class node_search,node_video,node_playlist toneAmber
class node_request,node_response,node_formatting toneMint
class node_youtube toneIndigo
```

## Components

### Public API

- [Public Exports](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/__init__.py): `ytlookup/__init__.py`

### Retrieval Workflows

- [Video Search](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/search.py): `ytlookup/search.py`
- [Video Details](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/video.py): `ytlookup/video.py`
- [Playlist Retrieval](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/playlist.py): `ytlookup/playlist.py`

### Request And Parsing

- [InnerTube Requests](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/handlers.py): `ytlookup/handlers.py`
- [Renderer Parsing](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/handlers.py): `ytlookup/handlers.py`
- [Data Formatting](https://github.com/certifiedcoders/ytlookup/blob/Master/ytlookup/formatting.py): `ytlookup/formatting.py`

### Other components

- **Library User**
- **YouTube InnerTube**
- **aiohttp Client**

## Connections

- Library User → Public Exports: calls (evidence: `README.md`)
- Public Exports → Video Search: exports (evidence: `ytlookup/__init__.py`)
- Public Exports → Video Details: exports (evidence: `ytlookup/__init__.py`)
- Public Exports → Playlist Retrieval: exports (evidence: `ytlookup/__init__.py`)
- Video Search → InnerTube Requests: requests (evidence: `ytlookup/search.py`)
- Video Search → Renderer Parsing: parses results (evidence: `ytlookup/search.py`)
- Video Details → InnerTube Requests: requests (evidence: `ytlookup/video.py`)
- Playlist Retrieval → InnerTube Requests: requests (evidence: `ytlookup/playlist.py`)
- Playlist Retrieval → Video Details: fetches details (evidence: `ytlookup/playlist.py`)
- InnerTube Requests → YouTube InnerTube: sends requests (evidence: `ytlookup/handlers.py`)
- InnerTube Requests → aiohttp Client: uses client (evidence: `ytlookup/handlers.py`)
- Renderer Parsing → Data Formatting: uses helpers (evidence: `ytlookup/handlers.py`)
- Video Details → Data Formatting: formats fields (evidence: `ytlookup/video.py`)
- Playlist Retrieval → Data Formatting: formats fields (evidence: `ytlookup/playlist.py`)
