Skip to content

Comments

Refactor Extractor#onFetchPage to not recieve downloader as parameter#1453

Open
dustdfg wants to merge 2 commits intoTeamNewPipe:devfrom
dustdfg:global_downloader
Open

Refactor Extractor#onFetchPage to not recieve downloader as parameter#1453
dustdfg wants to merge 2 commits intoTeamNewPipe:devfrom
dustdfg:global_downloader

Conversation

@dustdfg
Copy link
Contributor

@dustdfg dustdfg commented Feb 8, 2026

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

🔴 Breaking API change

Extractor.onFetchPage now doesn't receive parameters

@dustdfg
Copy link
Contributor Author

dustdfg commented Feb 10, 2026

Don't mind what just happened

We have only one global downloader so there is not so much sense in
passing it as parameter. Moreover Extractor class has getDownloader
method which is used with globale Newpipe.getDownloader in half of
the extracotrs. So before it any extractor could get downloader in
3 ways: downloader parameter, getDownloader and Newpipe.getDownloader
now downloader parameter is eliminated. Moreover all 3 methods to
access downloader always point to the same globale downloader
The downloader is global there is no sense to store reference to it
in every instance of Extractor. So eliminate the field, make
getDownloader shorthand for Newpipe.getDownloader and make it static
to be accesible in static functions of extractors
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant