GithubHelp home page GithubHelp logo

Comments (4)

karyogamy avatar karyogamy commented on May 19, 2024 1

I'm not really sure. But looking around the uses for the handler, it seems like the original author intended to inject different handler implementation for each service and type of extraction, which then can be used for processing urls statelessly. Since we now need to keep track of multiple fields at the same time, off the top of my head, we can probably either:

  • Retain the stateless nature of the handler and pass around an immutable data class (containing originalUrl, id and cleanUrl) in and out of the handler for processing.
  • Or we can inject a UrlIdHandlerFactory at the service level for creating individual handlers, which can be used to store both the data and do processing internally. This way, each factory is stateless and the handlers are immutable.

from newpipeextractor.

theScrabi avatar theScrabi commented on May 19, 2024

I figured that I destroyed something. I wanted to take a look at it, but I'm still heavily refactoring the SearchEngine aka SearchExtractor.

@karyogamy what would you do to fix this problem. We need to change the way UIHs are used in the fronted. -> get rid of the singletons.

Would it be useful to make UIHs imitable as well?

from newpipeextractor.

theScrabi avatar theScrabi commented on May 19, 2024

I wrote both types of UrlIdHandler, and I think we need the new implementation of the the statefull once for keeping track of additional sort querris which will be added to the url. So far this was done in the extractors but it does not belong there.

I think having a UrlIdHandlerFactury would be a good idea. So you would override them instead of the UrlIdHandler, and make the handler imitable then.

from newpipeextractor.

FlorianSteenbuck avatar FlorianSteenbuck commented on May 19, 2024

When OtherUrl is ready we could create one UrlFactoryProcessor that take a Feature, from OtherFeatures, and a Map<String, ?> of options or/and Object...params for create one unique way to clean Urls. The params could also be mapped on the right method using reflection of the Feature mapped static Class.

from newpipeextractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.