This update contains some significant changes, and I recommend creating a backup of your HDoujin Downloader folder before updating, just in case. If you have any problems, let me know, and you can always downgrade to an earlier release here.
New external module system
What makes it significant is that I have (finally) laid the groundwork for an external module system. While the old DIY scripting system was an attempt at this, it was, frankly, a user-unfriendly mess. The new system uses lua, and offers what I believe is a far more comfortable API. You can see an example module here. It shows most of what’s available right now (in addition to a “Log” function for writing things to debug log during testing). In the spirit of getting this update out sooner rather than later, it’s the only example available right now, but I plan to do the majority of work through this system rather than program updates. I am wide-open to suggestions for this feature to help it meet the needs of those wishing to create their own modules.
New repository system
Accompanying this change is a new repository system. Repositories are comprised of a local folder where modules are stored and optionally an online source used for downloading new updates. The “official” repository is here, and this update comes with it already configured for use. Any updates made here will be transparently synced to HDoujin Downloader, allowing fixes and new modules to be provided in the background without having to update manually. Full program updates are still required to be done through the updater, but having modules separate will make this situation less frequent.
You can access the repositories list under “Tools > Modules”. From here you can disable specific modules and change the priorities of your repositories to prefer certain ones over others (in the case that they both provide modules for a given site). You can also add new ones. Right now, only GitHub folders can by synced, but I’m open to adding more options if anyone has interest in hosting their own repositories elsewhere.
The “Scripts” tab is now obsolete and has been removed. If you’re one of the few people that was actually using that feature, it will be automatically replaced by a repository named “Scripts” that you can access under “Tools > Modules”. Old scripts will continue to work, but it’s not the recommended choice for new development.
Lastly, basic sideways-compatibility for lua modules from other programs has been implemented. Many will not work yet, but some do. This will be improved in future releases. If you use another downloading program that provides modules you’d like to import into HDoujin Downloader, let me know, and I’ll see what I can do.
Site updates included in this release are summarized in the changelog. Most notably, sites protected by Cloudflare show now be working again. The fix is provided by “cf-tool” in the “bin” folder, which wraps a Python script for bypassing the verification page. It’s not the ideal solution, but it works, especially in the absence of suitable alternatives for .NET. Let me know if you have any problems with Cloudflare going forward.
This has been an ongoing issue for the past couple of releases, especially with Windows Defender. Whitelisting sometimes takes a while, making things really inconvenient for early adopters. I’ve done my best to try to avoid this problem with this release as much as possible. If you run into problems in this area, let me know so I can submit the program for whitelisting to the respective AV vendor.
Integrating the repository and external module system was no small feat, and I have done extensive testing to make sure that everything works. I did not expect it to take as long as it did, but now that that hurdle is gone, I can hopefully resume the regular weekly update schedule. There will likely be more updates to address limitations with the current module system’s API as I start moving more sites into it and the requirements become clearer. That’s the plan for now.