Giter VIP home page Giter VIP logo

Comments (2)

CXwudi avatar CXwudi commented on June 8, 2024

The new downloader enablement machenism will delete the enablement section
the downloader section will take place of what to enable, it will be like:

 downloader:
    NicoNicoDouga:
      # settings of youtube-dl/ytp-dl for downloading niconico videos
      # settings must make sure nothing blocks from downloading the video (e.g. don't put --version on yt-dlp)
      # do the same for all other downloaders.
      - name: using yt-dlp 
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

      - name: using youtube-dl
        type: youtube-dl
        launch-cmd: youtube-dl.exe
        external-args:  -v, --username, xxx, --password, yyy

      - name: using nndownload
        type: nndownload
        launch-cmd: nndownload.exe
        username:
        password:
        session-cookie:

    Youtube:
      - name: using yt-dlp 
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

    Bilibili:
      - name: using yt-dlp 
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

where the type and name are needed for all downloader configs, and the rest of the config are customized for each downloader

will need to POC how spring boot conversion will works:

I am afraid that Spring boot configuration doesn't support conversion of a map of configuration to custom type like https://stackoverflow.com/questions/64228017/converter-using-configurationpropertiesbinding-not-work-for-complex-source-type

Use this way to get all configuration programmatically https://stackoverflow.com/questions/23506471/access-all-environment-properties-as-a-map-or-properties-object

from vocadb-video-downloader-new.

CXwudi avatar CXwudi commented on June 8, 2024

Unfortauntely, we decided to not use spring-boot-starter-configuration to handle business logic validation of our various configs. In fact, nor should it be. So the final configuration will be like:

 downloader:
    NicoNicoDouga:
      # settings of youtube-dl/ytp-dl for downloading niconico videos
      # settings must make sure nothing blocks from downloading the video (e.g. don't put --version on yt-dlp)
      # do the same for all other downloaders.
      - name: using yt-dlp 
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

      - name: using youtube-dl
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

      - name: using nndownload
        type: nndownload
        launch-cmd: nndownload.exe
        username:
        password:
        session-cookie:

    Youtube:
      - name: using yt-dlp 
        type: youtube-dl
        options:
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

    Bilibili:
      - name: using yt-dlp 
        type: youtube-dl
        launch-cmd: yt-dlp.exe
        external-args: -v, --username, xxx, --password, yyy

So pretty much we are just mapping to Map<PVServiceEnum, List<RawDownloaderConfig>> where RawDownloaderConfig contains everything that any download config could declare (in above lists, we will have name, type, launch-cmd, external-args, username, password, session-cookie where only name and type are not null), because a POC has shown that @ConfigurationPropertiesBinding doesn't work with Collection type, only for String which is useless

And then we will have custom logic and validation to build up all downloaders, and use FailureAnalyzer to provide user-friendly error msg upon downloader config error

from vocadb-video-downloader-new.

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.