Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A even better downloader enablement mechanism #19

Open
CXwudi opened this issue Nov 26, 2021 · 2 comments
Open

A even better downloader enablement mechanism #19

CXwudi opened this issue Nov 26, 2021 · 2 comments
Labels
refactor optimization or enhancement of existing features or codebase wontfix This will not be worked on

Comments

@CXwudi
Copy link
Owner

CXwudi commented Nov 26, 2021

Currently, no way for us to config two same downlaoders with different command line for even same pv service.

So in config.downloader, instead of having each pv service listing all available downloaders, lets it be a list of config with name. And the enablement will use the name as the order of downloaders for that pv service.

[vocadb-video-downloader-new] vvd-downloader/src/main/resources/application.yml (Lines 37-65)


  enablement:
    NicoNicoDouga:  # enable downloaders from NicoNicoDouga's available downloaders. e.g. nndownload
    Youtube:
    Bilibili:


  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.
      youtube-dl:
        launch-cmd:
        external-args:

      nndownload:
        launch-cmd:
        external-args:

    Youtube:
      youtube-dl:
        launch-cmd:
        external-args:

    Bilibili:
      youtube-dl:
        launch-cmd:
        external-args:

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

@CXwudi CXwudi added wontfix This will not be worked on and removed wontfix This will not be worked on labels Nov 26, 2021
@CXwudi

This comment was marked as outdated.

@CXwudi CXwudi added the refactor optimization or enhancement of existing features or codebase label Dec 30, 2023
@CXwudi
Copy link
Owner Author

CXwudi commented Dec 30, 2023

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

@CXwudi CXwudi added wontfix This will not be worked on and removed wontfix This will not be worked on labels Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor optimization or enhancement of existing features or codebase wontfix This will not be worked on
Projects
Development

No branches or pull requests

1 participant