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

suggestion to improve HDoujin ergonomics #317

Open
Infel1 opened this issue Apr 29, 2024 · 12 comments
Open

suggestion to improve HDoujin ergonomics #317

Infel1 opened this issue Apr 29, 2024 · 12 comments
Labels
client feature New features related to the HDoujin Downloader client enhancement New feature or request

Comments

@Infel1
Copy link

Infel1 commented Apr 29, 2024

Honestly, it's annoying when websites go down and appear with a new domain and Hdoujin can't detect them. I think it would be great if a system or a way was developed where users could add any website (related to mangas, manhwas and manhuas). In addition, the administration would take off an extra burden and they would not have to worry about time and adding each website and could focus on developing other things. The thing is, a lot of pages tend to fall out and then Hdoujin doesn't detect them or Hdoujin detects them but shows "N/A" in the chapter section. It's also a hassle to have to send all your favorite pages all the time. It's a good suggestion for both parties. I'm not a programmer and I don't know how much time it takes for you, so I shouldn't require you to take time out of your daily life because you're human too. I await a response, thank you.

@Infel1
Copy link
Author

Infel1 commented May 4, 2024

@HDoujinDownloader What do u think about it?

@HDoujinDownloader HDoujinDownloader added enhancement New feature or request client feature New features related to the HDoujin Downloader client labels May 4, 2024
@HDoujinDownloader
Copy link
Owner

There are a few things you're able to do right now:

  1. Anyone can add support for a new website using the Lua API. From Tools > Module Browser, you can add your own module repository (either a local repository or hosted here on GitHub) and create new modules as you see fit. Of course, this does require a little bit of programming knowledge. You can look at the existing modules in the modules\lua folder to see what they look like.

  2. From Tools > Domain Management, you can "map" domains to other ones. If you have Site A that uses the same layout/CMS as Site B, you can map Site A to Site B so it uses the same module as Site B.

Maybe you have another idea in mind to make adding new sites easier for people without programming experience. I'm definitely open to suggestions.

@Infel1
Copy link
Author

Infel1 commented May 5, 2024

What I am suggesting is that the way you add new websites to Hdoujin, the program does it automatically. What is your opinion? So users who don't know anything about programming can send the link to a kind of "search bar" and the program will automatically start the process to add it. I am well aware that this could take a long time. The general idea is that Hdoujin does the work automatically with a detection and orchestration system to make everything faster. However, you as a programmer will know better than me how to add a way to add new websites to Hdouji autonomously. @HDoujinDownloader

@ale5000-git
Copy link
Contributor

It isn't black magic, there isn't any way to add website automatically unless you buy a PC that can "think".
Add website support via LUA script is already very good; unfortunately is very very undocumented.

@ale5000-git
Copy link
Contributor

ale5000-git commented May 5, 2024

The best that can be done is creating a "generic" LUA script as fallback, like the "generic extractor" of yt-dlp.
But with a generic script maybe you will be able to get videos and big images but everything else (metadata and chapter support) will likely don't work or be wrong.

@Infel1
Copy link
Author

Infel1 commented May 5, 2024

@ale5000-git And how would that help users who know absolutely nothing about programming? Could you send an example? What I'm looking for is a simple and effective way to add websites to Hdoujin without knowing programming. For example, you add the URL of the website you want to add and HDoujin converts it into a Lua file that will then be detected like the rest of the pages in the repository. In case some websites fail, it will show you a solution or tell you how to modify the URL to make it valid. At least that's one way I see possible.

@ale5000-git
Copy link
Contributor

ale5000-git commented May 6, 2024

The generic script would make the program work with any website that isn't too much complicated without any manual change but as said it won't be perfect.
For other cases the only way is to learn programming, in particular XPath Syntax.

@Infel1
Copy link
Author

Infel1 commented May 6, 2024

@ale5000-git I think a tutorial on the official website would also work "how to add websites to Hdoujin" the tutorial would be in the bar so whenever you need it you just have to go to the website and watch it. Squidy made some tutorials for Flaresolverr, but they are not in the bar so they are somewhat difficult to find if you don't look hard.

@ale5000-git
Copy link
Contributor

In every case even when there is a tutorial, it would only cover the HDoujinDownloader specific things.
Without the basic of programming, it would be difficult for a casual user to really doing it.

@HDoujinDownloader
Copy link
Owner

HDoujinDownloader commented Jun 4, 2024

The best that can be done is creating a "generic" LUA script as fallback, like the "generic extractor" of yt-dlp.

There is some support for generic Lua modules: You can set the domain to * to capture any URLs that aren't captured by a more-specific module. If there are multiple generic modules, it will try all of them until one returns valid (i.e. non-empty) data. You can reject a URL with Fail(Error.DomainNotSupported) to make it move onto the next one immediately.

The reason this isn't really taken advantage of yet is because I need to improve caching to make the retries more efficient. I'm working on that right now though, so this is something that I'm going to start using soon.

@ale5000-git
Copy link
Contributor

ale5000-git commented Jun 4, 2024

@HDoujinDownloader
Is there any possibility to change priority of one module over another?

My idea is something like this?
module.priority = 1

So the developer can change to go up and down, specific modules will have number near 1 instead generic modules will have maybe number near 999.
Module with the same priority are order alphabetically (case sensitive) with the filename.

@HDoujinDownloader
Copy link
Owner

@ale5000-git

Is there any possibility to change priority of one module over another?

Matching modules are first ordered by repository priority, then by the time they were last updated. If there are any explicit matches, those modules are always chosen over a generic match. If there are no explicit matches and multiple generic matches, all generic modules are tried until one of them produces a valid result. Generic modules can also choose to pass a URL off to the next one if they want to.

So, generic modules already have lowest priority. I think this is a good way of handling it without having to manually specify priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client feature New features related to the HDoujin Downloader client enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants