NewPipeExtractor-KMP
1.2.1indexedExtracts YouTube videos and comments, maintaining compatibility with original usage. Refactored for improved readability, structure, and platform compatibility, with a pure Kotlin JSON implementation.
Extracts YouTube videos and comments, maintaining compatibility with original usage. Refactored for improved readability, structure, and platform compatibility, with a pure Kotlin JSON implementation.
This repository is a Compose Multiplatform-compatible adaptation of the NewPipeExtractor. The migration started from v0.24.5 and includes selected service-compatibility fixes from newer upstream versions. It is intended for extracting YouTube and SoundCloud content within Kotlin Multiplatform projects.
nanojson with a pure Kotlin implementation.implementation("io.github.yushosei:newpipe-extractor-kmp:1.3.0")
NewPipe.init(DefaultDownloaderImpl.initDefault())
ExtractorHelper.searchFor(
SERVICE_ID, searchText, listOf("videos"),
"",
)
ExtractorHelper.getMoreSearchItems(
SERVICE_ID, searchText, listOf("videos"), "", page
)
ExtractorHelper.suggestionsFor(SERVICE_ID, searchText)
val info = ExtractorHelper.getStreamInfo(SERVICE_ID, item.url)
val audioStreams = info.audioStreams
val progressiveVideoStreams = info.videoStreams // video + audio
val adaptiveVideoStreams = info.videoOnlyStreams // pair with an audio stream
For more details, refer to the sampleApp.
https://github.com/user-attachments/assets/d4221163-619f-49fa-83a5-48b580da29af
https://github.com/user-attachments/assets/5f8ab309-4e46-40fb-9911-ff82c18c5a3e
https://github.com/user-attachments/assets/35e628ea-50ad-4cba-a970-7e5cb4705823
✅ The sample supports audio and video playback modes. YouTube uses progressive video streams with embedded audio, while SoundCloud remains audio-only. Platform video surfaces are implemented for Android (Media3), iOS (AVPlayer), desktop (VLCJ), and Wasm (HTML video). All core logic is written in pure Kotlin, making it platform-independent and theoretically usable across desktop and web environments too.
The current implementation has been verified on Android and iOS targets using Compose Multiplatform UI.
📦 We plan to release a cleaned-up and library-ready version of the module in the near future to facilitate reuse and integration !
nanojson ReplacementThis project includes a reimplementation of nanojson in pure Kotlin, rewritten from scratch to work within the Kotlin Multiplatform (NewPipeExtractor).
Serializable, Optional, Pattern, URL, Objects)Pair, ManifestCache, etc.) to idiomatic KotlinSerializable with @Serializable and kotlinx.serializationnanojson dependencynanojson using pure Kotlin logicCore functionality has been migrated but not yet fully cleaned or published.
commonTest casesrunBlocking and mock data for multiplatform testabilityRun deterministic tests with:
./gradlew :newpipe-KMP:desktopTest
Run opt-in live service smoke tests with:
./gradlew :newpipe-KMP:desktopTest -Dnewpipe.liveTests=true
NewPipeExtractor v0.24.51.3.0This project is licensed under the GNU General Public License v3 or (at your option) any later version.
Surfaced from shared tags and platforms — no rankings paid for.