Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ZemerTeam/zemer-cipher/llms.txt

Use this file to discover all available pages before exploring further.

Zemer Cipher is a standalone Android library (Kotlin) that handles everything needed to play YouTube streams: signature deobfuscation, n-parameter transformation to prevent CDN throttling, and PoToken (BotGuard) generation. Its self-healing remote config system means a single push to the config repository fixes deployed apps within minutes — no APK update required.

Quickstart

Initialize the library and decipher your first stream URL in minutes

Installation

Add the Gradle dependency and configure your project

Core Concepts

Understand how signature ciphers, n-transforms, and PoTokens work

API Reference

Full reference for every public class and method

What Zemer Cipher Does

YouTube protects its streaming URLs with two obfuscation mechanisms that change with every player rotation. Zemer Cipher handles both automatically:

Signature Cipher

Deobfuscates the s= parameter in signatureCipher query strings so CDN requests succeed

N-Transform

Transforms the n= parameter to prevent bandwidth throttling and 403 errors

PoToken Generation

Generates BotGuard proof-of-origin tokens required for web client streams

Remote Player Configs

Self-healing configs fetched from GitHub keep deployed apps working after player rotations

Get Started

1

Add the dependency

Add com.zemer:cipher:1.0.0 to your app’s build.gradle.kts dependencies block.
2

Initialize in Application

Call ZemerCipher.initialize(context) once in your Application.onCreate().
3

Decipher a stream URL

Use CipherDeobfuscator.deobfuscateStreamUrl(signatureCipher, videoId) and CipherDeobfuscator.transformNParamInUrl(url) in your playback pipeline.
4

Generate PoTokens (optional)

For web client streams, create a PoTokenGenerator and call getWebClientPoToken(videoId, sessionId).
Zemer Cipher requires Android API 24+ and uses android.webkit.WebView internally. Ensure WebView is available on target devices and not stripped from the system image.

Build docs developers (and LLMs) love