# abraham-ny/newpipe architecture

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

- Interactive diagram: https://gitdiagram.com/abraham-ny/newpipe
- Repository: https://github.com/abraham-ny/newpipe

## Overview

NewPipe is an Android streaming front end. The principal workflow is browsing or searching a supported service, opening stream details, resolving media, and playing it; users can also subscribe, refresh feeds, and keep local playlists and history. The graph preserves documented search, channel, comments, kiosk, background and popup playback, and download capabilities. Service fetching is described by the README, but the extractor implementation is not in this tree; several feature paths are therefore represented at their existing enclosing directories rather than as inspected internals.

Main entry points: [`app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java`](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java) (Stream details), [`app/src/main/java/org/schabi/newpipe/player/PlayerService.java`](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/PlayerService.java) (Player service), [`app/src/main/java/org/schabi/newpipe/MainActivity.java`](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/MainActivity.java) (Main activity), [`app/src/main/java/org/schabi/newpipe/database/AppDatabase.java`](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/database/AppDatabase.java) (App database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_main["Main activity<br/>[MainActivity.java]"]
  node_router["Intent router"]
end

subgraph group_discovery["Service discovery"]
  node_search["Search"]
  node_streamdetail["Stream details"]
  node_channel["Channel browsing"]
  node_comments["Comments"]
  node_kiosk["Kiosk browsing<br/>[KioskFragment.java]"]
end

subgraph group_playback["Playback and downloads"]
  node_player["Player service<br/>[PlayerService.java]"]
  node_queue["Play queue<br/>[PlayQueue.java]"]
  node_resolver["Playback resolver"]
  node_media["Media source manager"]
  node_download["Download service"]
  node_downloadui["Download UI"]
end

subgraph group_library["Local library"]
  node_subscriptions["Subscriptions"]
  node_feed["Feed loading<br/>[FeedLoadService.kt]"]
  node_playlists["Local playlists"]
  node_history["History manager"]
end

subgraph group_storage["Persistence"]
  node_database[("App database<br/>[AppDatabase.java]")]
end

node_user(("User"))
node_services{{"Streaming services"}}

node_user -->|"opens"| node_main
node_user -->|"shares link"| node_router
node_main -->|"navigates"| node_search
node_main -->|"browses"| node_channel
node_main -->|"browses"| node_kiosk
node_search -->|"requests results"| node_services
node_channel -->|"requests channel"| node_services
node_kiosk -->|"requests listings"| node_services
node_streamdetail -->|"requests stream info"| node_services
node_comments -->|"requests comments"| node_services
node_search -->|"opens stream"| node_streamdetail
node_channel -->|"opens stream"| node_streamdetail
node_router -->|"routes link"| node_streamdetail
node_streamdetail -->|"starts playback"| node_player
node_streamdetail -->|"creates queue"| node_queue
node_player -->|"controls"| node_queue
node_player -->|"resolves media"| node_resolver
node_resolver -->|"fetches streams"| node_services
node_player -->|"manages sources"| node_media
node_player -->|"records playback"| node_history
node_subscriptions -->|"reads and writes"| node_database
node_feed -->|"loads subscriptions"| node_subscriptions
node_feed -->|"fetches updates"| node_services
node_feed -->|"stores feed data"| node_database
node_playlists -->|"reads and writes"| node_database
node_history -->|"reads and writes"| node_database
node_user -->|"manages downloads"| node_downloadui
node_downloadui -->|"starts missions"| node_download
node_download -->|"downloads media"| node_services

click node_main "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/MainActivity.java"
click node_router "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/RouterActivity.java"
click node_search "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java"
click node_streamdetail "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java"
click node_channel "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java"
click node_comments "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java"
click node_kiosk "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java"
click node_player "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/PlayerService.java"
click node_queue "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java"
click node_resolver "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java"
click node_media "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java"
click node_download "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java"
click node_subscriptions "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionManager.kt"
click node_feed "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt"
click node_playlists "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java"
click node_history "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java"
click node_database "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/database/AppDatabase.java"
click node_downloadui "https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java"

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_main,node_router,node_user toneBlue
class node_search,node_streamdetail,node_channel,node_comments,node_kiosk toneAmber
class node_player,node_queue,node_resolver,node_media,node_download,node_downloadui toneMint
class node_subscriptions,node_feed,node_playlists,node_history toneRose
class node_database,node_services toneIndigo
```

## Components

### App navigation

- [Main activity](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/MainActivity.java): `app/src/main/java/org/schabi/newpipe/MainActivity.java`
- [Intent router](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/RouterActivity.java): `app/src/main/java/org/schabi/newpipe/RouterActivity.java`

### Service discovery

- [Search](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java): `app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java`
- [Stream details](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java): `app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java`
- [Channel browsing](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java): `app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java`
- [Comments](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java): `app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java`
- [Kiosk browsing](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java): `app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/KioskFragment.java`

### Playback and downloads

- [Player service](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/PlayerService.java): `app/src/main/java/org/schabi/newpipe/player/PlayerService.java`
- [Play queue](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java): `app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java`
- [Playback resolver](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java): `app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java`
- [Media source manager](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java): `app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java`
- [Download service](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java): `app/src/main/java/us/shandian/giga/service/DownloadManagerService.java`
- [Download UI](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java): `app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java`

### Local library

- [Subscriptions](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionManager.kt): `app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionManager.kt`
- [Feed loading](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt): `app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadService.kt`
- [Local playlists](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java): `app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java`
- [History manager](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java): `app/src/main/java/org/schabi/newpipe/local/history/HistoryRecordManager.java`

### Persistence

- [App database](https://github.com/abraham-ny/newpipe/blob/dev/app/src/main/java/org/schabi/newpipe/database/AppDatabase.java): `app/src/main/java/org/schabi/newpipe/database/AppDatabase.java`

### Other components

- **User**
- **Streaming services**

## Connections

- User → Main activity: opens
- User → Intent router: shares link
- Main activity → Search: navigates
- Main activity → Channel browsing: browses
- Main activity → Kiosk browsing: browses
- Search → Streaming services: requests results
- Channel browsing → Streaming services: requests channel
- Kiosk browsing → Streaming services: requests listings
- Stream details → Streaming services: requests stream info
- Comments → Streaming services: requests comments
- Search → Stream details: opens stream
- Channel browsing → Stream details: opens stream
- Intent router → Stream details: routes link
- Stream details → Player service: starts playback
- Stream details → Play queue: creates queue
- Player service → Play queue: controls
- Player service → Playback resolver: resolves media
- Playback resolver → Streaming services: fetches streams
- Player service → Media source manager: manages sources
- Player service → History manager: records playback
- Subscriptions → App database: reads and writes
- Feed loading → Subscriptions: loads subscriptions
- Feed loading → Streaming services: fetches updates
- Feed loading → App database: stores feed data
- Local playlists → App database: reads and writes
- History manager → App database: reads and writes
- User → Download UI: manages downloads
- Download UI → Download service: starts missions
- Download service → Streaming services: downloads media
