Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / youpipe / extractor / AGENTS.md

AGENTS.md4.2 KiBRenderedCodeRaw
1# AGENTS.md — youpipe/extractor/ (':youpipe:extractor')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `youpipe/extractor/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install youpipe (dev by default)._
6- Gradle: :youpipe:extractor / dir: youpipe/extractor/
7- Package roots present: org.schabi.newpipe.extractor (upstream NewPipe API, not the closed set — third-party fork)
8- Entry files: NewPipe.kt (`init` + service registry)
9- Deps: protobuf-javalite, brotli-dec, jsr305 (no Modern-Apps modules)
10- Metadata: absent (libraries none by design)
11- Rust: no / screenshotTest: no
12
13## Overview
14**Purpose:** Pure-JVM YouTube/service extraction library — the NewPipe extractor fork that `:youpipe` uses to resolve streams, channels, playlists, search, and comments without the official API.
15**Key features:**
16- Per-service extractors (YouTube plus other services under `services/`) for streams, channels, playlists, search, suggestions, kiosks, and comments
17- Localisation/time-ago parsing and pagination (`Page`, `ListExtractor`, `InfoItemsCollector`) for feed-style crawling
18- Downloader abstraction — the host app injects its HTTP stack via `NewPipe.init(downloader)`
19**Architecture / data-flow:** Host calls `NewPipe.init(downloader, localization)` once, resolves a `StreamingService` from `ServiceList`, then pulls typed `Info`/`ListInfo` objects through `Extractor` subclasses per entity; YouTube session PO-tokens plug in via `YoutubeSessionPoTokenProvider`. No Android, no Room, no network of its own — protobuf schemas under `src/main/proto` feed the YouTube player-response parsing.
20**Entry points + reading order:** `NewPipe.kt` (`init`, `getService`) → `StreamingService.kt` → `Extractor.kt` / `ListExtractor.kt` → `services/youtube/` extractors → `downloader/Downloader.kt`.
21**Gotchas:**
22- This is a vendored upstream fork — prefer minimal surgical patches; large refactors will collide with upstream merges
23- Protobuf `lite` java builtin must stay `named("java")`, not `create` — the JVM path pre-registers it and a second create fails the build
24
25## Key files
26### Root — registry + base types
27- org/schabi/newpipe/extractor/NewPipe.kt — init + service registry
28- org/schabi/newpipe/extractor/ServiceList.kt
29- org/schabi/newpipe/extractor/StreamingService.kt
30- org/schabi/newpipe/extractor/Extractor.kt
31- org/schabi/newpipe/extractor/ListExtractor.kt
32- org/schabi/newpipe/extractor/Info.kt
33- org/schabi/newpipe/extractor/ListInfo.kt
34- org/schabi/newpipe/extractor/InfoItem.kt
35- org/schabi/newpipe/extractor/InfoItemExtractor.kt
36- org/schabi/newpipe/extractor/InfoItemsCollector.kt
37- org/schabi/newpipe/extractor/MultiInfoItemsCollector.kt
38- org/schabi/newpipe/extractor/Collector.kt
39- org/schabi/newpipe/extractor/Page.kt
40- org/schabi/newpipe/extractor/MediaFormat.kt
41- org/schabi/newpipe/extractor/Image.kt
42- org/schabi/newpipe/extractor/MetaInfo.kt
43### services/ + stream/ + channel/ + playlist/ + search/ — per-entity extractors
44- org/schabi/newpipe/extractor/services/ — per-service implementations (incl. youtube)
45- org/schabi/newpipe/extractor/stream/ — stream info + items
46- org/schabi/newpipe/extractor/channel/ — channel info + items
47- org/schabi/newpipe/extractor/playlist/ — playlist info + items
48- org/schabi/newpipe/extractor/search/ — searcher + results
49- org/schabi/newpipe/extractor/suggestion/ — query suggestions
50- org/schabi/newpipe/extractor/kiosk/ — trending-style feeds
51- org/schabi/newpipe/extractor/comments/ — comment threads
52- org/schabi/newpipe/extractor/subscription/ — subscription extractors
53### linkhandler/ + localization/ + timeago/ + utils/ + downloader/ + exceptions/ — plumbing
54- org/schabi/newpipe/extractor/linkhandler/ — URL ↔ id routing
55- org/schabi/newpipe/extractor/localization/ — Localization + ContentCountry
56- org/schabi/newpipe/extractor/timeago/ — locale-aware relative-time parsing
57- org/schabi/newpipe/extractor/utils/ — shared parsing helpers
58- org/schabi/newpipe/extractor/downloader/ — Downloader abstraction the host injects
59- org/schabi/newpipe/extractor/exceptions/ — extraction error hierarchy
60
61## Verify (this module only)
62```
63./gradlew :youpipe:extractor:compileDevKotlin
64./gradlew :youpipe:extractor:lint
65```