TeamNewPipe / TeamNewPipe/NewPipeExtractor

YouTube search filters

Open
#106 14 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement YouTube
Dominant language
Java
Stars
2k
Forks
602
Avg merge
3d 6h
Merged PRs (30d)
6

Description

Hi! I wanted to provide some information on how YouTube's search filters work, as I noticed currently NewPipe uses hardcoded values. Sorry if this is the wrong place for this.

The &sp= parameter is a Base64'd protocol buffer that contains all the filters. I'd recommend looking here for a working implementation. It's pretty short, but essentially you have (about) two bytes for each filter, one (or more) bytes as a type, and then the other byte as a value, for example:

date month
0x08 0x04

Features (live, HD, ...) have a value of 1:

HD   true
0x20 0x01

HDR       true
0xc8 0x01 0x01

Once you've added all your filters, give it a header (which contains the only mandatory filter, sort, see the code above for details), Base64 encode, URI escape, and you're good to go.

Hopefully this is useful, and I want to thank the NewPipe team for providing their excellent work for others.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating NewPipeExtractor's current hardcoded YouTube search-filter handling, then compare it with the linked Invidious implementation. Trace how the sp parameter is assembled, including its sort header and Base64/URI encoding, and verify that the documented date and feature filter examples produce usable search URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.