TeamNewPipe / TeamNewPipe/NewPipeExtractor

[Helper][Source Code] Short Review of the Current State of Source Code

Open
#1,286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Checklist
  • I am aware that this issue is being opened for the NewPipe Extractor, NOT the app, and my feature request will be dismissed otherwise.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise.
  • This issue contains only one feature request.
  • I have read and understood the contribution guidelines.
Feature description

Hey, I find it is pretty heavy to maintain the NewPipe Source Code:

Instead of that YoutubeChannelHelper extends YoutubeParsingHelper it benefits from static imports. Why is that the case ?

...
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.hasArtistOrVerifiedIconBadgeAttachment;
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.prepareDesktopJsonBuilder;
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;

/**
 * Shared functions for extracting YouTube channel pages and tabs.
 */
public final class YoutubeChannelHelper {
...

as long as I understand the usage of such functionalities of singleton onelines and streamlined functions:

...
            return header.getObject(CAROUSEL_HEADER_RENDERER)
                    .getArray(CONTENTS)
                    .stream()
                    .filter(JsonObject.class::isInstance)
                    .map(JsonObject.class::cast)
                    .filter(item -> item.has(TOPIC_CHANNEL_DETAILS_RENDERER))
                    .findFirst()
                    .map(item -> item.getObject(TOPIC_CHANNEL_DETAILS_RENDERER))
                    .map(json -> new ChannelHeader(json, ChannelHeader.HeaderType.CAROUSEL))
                    .orElse(null);
...

I can not understand that NewPipe not even think a about extending classes and vote over the usage of multi layered static imports.

There are basically three functionalities inside of this Helpers as far as I can see:

  • Request Handling
  • Data Mapping
  • Data/Data-Value Validation

As I can not look into these factors as relevant to keep things separated. I can not look into not extending short helper classes on demand.

I love the easy structure and generical enforcement of the NewPipe structure, but when it comes to link handling and over usage of statical and no extended classes I can not see any benefits from this

~ lovely Florian L. Steenbuck

Why do you want this feature?

I want mantainable source code, that using logical programming.

Additional information

No response

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 comparing YoutubeChannelHelper with YoutubeParsingHelper and reviewing the listed static imports and helper responsibilities. The issue does not identify a specific file path, tests, or agreed design; completion would require a maintainer-approved scope for separating request handling, data mapping, and validation, followed by project-wide checks that the refactor preserves extractor 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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.