TeamNewPipe / TeamNewPipe/NewPipeExtractor

Refactor link handlers

Open
#1,360 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code quality help wanted multiservice
Dominant language
Java
Stars
2k
Forks
602
Avg merge
3d 6h
Merged PRs (30d)
6

Description

The interface of link handlers and link handler factories is strange, hard to debug, and it's doing something extremely simple (checking if a URL matches and extracting stuff from it) in a highly overcomplicated way. It could be refactored like this in my opinion:

  • have a base interface Link (the shorter the name the better, current names are huge)
  • The interface has only a few extractor related methods, e.g. getExtractor() returns the extractor corresponding to the link.
  • The interface also has a few app-facing public methods that are meant to be used only by the app (and not by other parts of the extractor). For example, a getUniqueId() method that returns a stable and unique ID for each resource, so it can be used as a primary key in NewPipe's database.
  • Each extractor has a corresponding Link implementation. Every Link's constructor takes a URL and builds an instance of Link, but throws an exception if the URL does not match the expected link format.
  • Each Link implementor may also have other constructors, e.g. YoutubeSearchLink would have a constructor that takes the query and any search filters.

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 the existing link handlers and link handler factories, then map how URLs are matched, extracted, and consumed by the application. Compare that structure with the proposed Link interface and constructors. Done would mean a consistent Link implementation for each extractor, stable app-facing identifiers, and equivalent URL and search behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.