TeamNewPipe / TeamNewPipe/NewPipeExtractor
Refactor link handlers
Nobody has claimed this yet.
- 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
Linkimplementation. EveryLink's constructor takes a URL and builds an instance ofLink, but throws an exception if the URL does not match the expected link format. - Each
Linkimplementor may also have other constructors, e.g.YoutubeSearchLinkwould have a constructor that takes the query and any search filters.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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