From 6d32b1822e94fef54ac81db5f7b478f0f92a8e17 Mon Sep 17 00:00:00 2001 From: mixa3607 <30209772+mixa3607@users.noreply.github.com> Date: Tue, 14 May 2024 23:49:27 +0500 Subject: [PATCH] ArkProjects.EHentai.Api net8 + fixes --- .../ArkProjects.EHentai.Api.Tests.csproj | 12 +- .../ParsingTests.cs | 6 +- .../files/ParsingTests/HathPerks_3.html | 458 ++++++++++++++++++ .../files/ParsingTests/HathPerks_3.json | 10 + .../files/ParsingTests/HathStatus_1.html | 170 ------- .../files/ParsingTests/HathStatus_1.json | 61 --- .../files/ParsingTests/HathStatus_2.html | 180 ------- .../files/ParsingTests/HathStatus_2.json | 61 --- .../files/ParsingTests/HathStatus_3.html | 271 +++++++++++ .../files/ParsingTests/HathStatus_3.json | 69 +++ .../ArkProjects.EHentai.Api.csproj | 12 +- .../Client/EHentaiClient.cs | 36 +- .../Models/HathRegionInfo.cs | 2 +- .../Models/HathRegionType.cs | 1 + .../Models/Requests/HathStatusResponse.cs | 8 +- .../Proxy/ProxyHttpClientFactory.cs | 32 -- 16 files changed, 857 insertions(+), 532 deletions(-) create mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.html create mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.json delete mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.html delete mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.json delete mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.html delete mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.json create mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.html create mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.json delete mode 100644 ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Proxy/ProxyHttpClientFactory.cs diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ArkProjects.EHentai.Api.Tests.csproj b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ArkProjects.EHentai.Api.Tests.csproj index d7b58de..a1d1c47 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ArkProjects.EHentai.Api.Tests.csproj +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ArkProjects.EHentai.Api.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable @@ -10,14 +10,14 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ParsingTests.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ParsingTests.cs index 78814de..b756857 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ParsingTests.cs +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/ParsingTests.cs @@ -2,6 +2,7 @@ using ArkProjects.XUnit.Json; using HtmlAgilityPack; using FluentAssertions; +using Newtonsoft.Json; namespace ArkProjects.EHentai.Api.Tests { @@ -10,6 +11,7 @@ public class ParsingTests [Theory] [JsonData("./files/{class}/{method}_1.json")] [JsonData("./files/{class}/{method}_2.json")] + [JsonData("./files/{class}/{method}_3.json")] public void HathPerks(ParsingTestData data) { var doc = new HtmlDocument(); @@ -19,13 +21,13 @@ public void HathPerks(ParsingTestData data) } [Theory] - [JsonData("./files/{class}/{method}_1.json")] - [JsonData("./files/{class}/{method}_2.json")] + [JsonData("./files/{class}/{method}_3.json")] public void HathStatus(ParsingTestData data) { var doc = new HtmlDocument(); doc.Load(data.HtmlPath); var resp = HathStatusResponse.Parse(doc); + var j = JsonConvert.SerializeObject(resp, Formatting.Indented); resp.Should().BeEquivalentTo(data.ExpectedResult); } } diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.html b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.html new file mode 100644 index 0000000..9f1bd2c --- /dev/null +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.html @@ -0,0 +1,458 @@ + + + +E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System + + + + + + + + + + + + +
+

Hath Perks

+ +
+

By running the Hentai@Home client, you will over time gain special bonus points known as Hath. These are rewards for people who help keeping this site free, fast and responsive by donating bandwidth and computer resources, and can be exchanged here for Hath Perks, which grant beneficial effects on E-Hentai Galleries and in the HentaiVerse.

+

If running H@H is not an option, you can exchange Credits for Hath at the Hath Exchange.

+

While the Hath Perks for the HentaiVerse cannot be obtained in any other way, most of the ones that are specific for Galleries will also get unlocked by making a donation on the Donation Screen. These will be refunded if you buy them for Hath, and later make a qualifying donation. There is also an option to "adopt" H@H clients that will grant you Hath over time as if you were running it yourself.

+

You currently have 729.01 Hath.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hath PerkDescription 
Ads-Be-GoneMakes ads be gone.
Free with a $20 donation.
200 Hath
Source NexusUnlocks the Original Images functionality on E-Hentai Galleries. This allows you to browse most files with the original, non-resampled version.
Free with a $50 donation.
1000 Hath
Multi-Page ViewerUnlocks the Multi-Page Viewer function on E-Hentai Galleries. This allows you to view all images from a gallery on one page. (demo)
Free with a $100 donation.
300 Hath
More ThumbsIncreases the maximum number of thumbnail rows to 10.
Free with a $20 donation.
200 Hath

Obtained

Thumbs UpFurther increases the maximum number of thumbnail rows to 20.
Free with a $50 donation.
400 Hath

Obtained

All ThumbsFurther increases the maximum number of thumbnail rows to 40.
Free with a $100 donation.
800 Hath
More PagesIncreases all limits on how many pages you can view by a factor of two.
Free with a $20 donation.
200 Hath
Lots of PagesIncreases all limits on how many pages you can view by a factor of five.
Free with a $50 donation.
500 Hath
Too Many PagesIncreases all limits on how many pages you can view by a factor of ten.
Free with a $100 donation.
1000 Hath
More Favorite Notes IIncreases the number of favorite note slots to 10000.500 Hath
More Favorite Notes IIIncreases the number of favorite note slots to 25000.1000 Hath
Paging Enlargement IIncreases the number of results you can show per page on the index, search and torrent pages to 50.500 Hath
Paging Enlargement IIIncreases the number of results you can show per page on the index, search and torrent pages to 100.1000 Hath
Postage PaidYou no longer have to pay postage or CoD fees on messages sent through MoogleMail.100 Hath
Vigorous VitalityIncreases your base health by 10%.1000 Hath
Effluent EtherIncreases your base mana by 10%.1000 Hath
Suffusive SpiritIncreases your base spirit by 10%.1000 Hath
Resplendent RegenerationIncreases your in-combat regeneration by 50%.2000 Hath
Enigma EnergizerDoubles the bonus from the riddlemaster, and increases duration to 50 turns.200 Hath
Yakety SaxMonsters will never catch you when fleeing.200 Hath
Soul CatcherGet ten free soul fragments per day.
These are added automatically if you have opened HV at some point during the past 30 days.
500 Hath
Extra Strength FormulaHappy Pills are twice as effective at improving monster morale.2000 Hath
That's Good Eatin'Increases monster food recovery amount by 20%.2000 Hath
Coupon Clipper10% discount on all purchases at the Item Shop.1000 Hath
Long Gone Before DaylightThe first energy drink used in a day gives twice the normal amount of stamina.2000 Hath
Dark DescentHalve the required number of amnesia shards for reseting an item's potential.2000 Hath
Eminent ElementalistIncreases effective Elemental Magic Proficiency by 10% of your natural base proficiency.1000 Hath
Divine WarmageIncreases effective Divine Magic Proficiency by 10% of your natural base proficiency.1000 Hath
Death and DecayIncreases effective Forbidden Magic Proficiency by 10% of your natural base proficiency.1000 Hath
Evil EnchantressIncreases effective Deprecating Magic Proficiency by 10% of your natural base proficiency.1000 Hath
Force of NatureIncreases effective Supportive Magic Proficiency by 10% of your natural base proficiency.1000 Hath
Manehattan ProjectSignificantly boosts the damage output of the Orbital Friendship Cannon.25000 Hath
Follower of SnowflakeDisplays your unyielding devotion to Snowflake, the Goddess of Loot and Harvest.50000 Hath
Thinking CapIncreases EXP gain by 25%. For calculation purposes, this bonus is added to the HentaiVerse training bonus.250 Hath
MentatsIncreases this EXP bonus to 50%.500 Hath
Learning ChipIncreases this EXP bonus to 75%.750 Hath
Cybernetic ImplantsIncreases this EXP bonus to 100%.1000 Hath
Innate Arcana IApplies a 10% upkeep discount on autocast spells.500 Hath
Innate Arcana IIIncreases the upkeep discount on autocast spells to 20%.1000 Hath
Innate Arcana IIIIncreases the upkeep discount on autocast spells to 30%.1500 Hath
Innate Arcana IVIncreases the upkeep discount on autocast spells to 40%.2000 Hath
Innate Arcana VIncreases the upkeep discount on autocast spells to 50%.2500 Hath
Crystarium IWhenever a monster drops a crystal in the HentaiVerse, you will receive an additional bonus crystal.1000 Hath
Crystarium IIFurther increases the number of crystals received per drop to three.3000 Hath
Crystarium IIIFurther increases the number of crystals received per drop to five.5000 Hath
Crystarium IVFurther increases the number of crystals received per drop to seven.7000 Hath
Crystarium VFurther increases the number of crystals received per drop to ten.10000 Hath
Tokenizer IDoubles the chance of random mob token drops.1000 Hath
Tokenizer IITriples the chance of random mob token drops.2500 Hath
Tokenizer IIIQuadruples the chance of random mob token drops.5000 Hath
Hoarder IThe first 200 equips placed in storage do not count towards your equipment limit.1000 Hath
Hoarder IIIncreases the equipment storage allowance to 400 equips.2000 Hath
Hoarder IIIIncreases the equipment storage allowance to 600 equips.3000 Hath
Hoarder IVIncreases the equipment storage allowance to 800 equips.4000 Hath
Hoarder VIncreases the equipment storage allowance to 1000 equips.5000 Hath
Repair Bear Mk.1The latest invention from Moogle Dynamics, the Repair Bear will follow you around and help you keep your equipment in good shape at all times. This reduces effective equipment wear by half.3000 Hath
Repair Bear Mk.2Further hones the skills of your Repair Bear, making it better at maintaining your equipment. Effective equipment wear is reduced to 25% of normal.5000 Hath
Repair Bear Mk.3Trains your Repair Bear to the penultimate level, making those pesky forge visits (almost) a distant memory. Effective equipment wear is reduced to 10% of normal.7000 Hath
Repair Bear Mk.4The pinnacle of Repair Bear Technology, providing the ultimate in-the-field preventive equipment maintenance. Equipment wear is fully eliminated, and defeat durability loss is cut by half.10000 Hath
D?mon Duality IIncreases attack damage and magic damage by 10%.2000 Hath
D?mon Duality IIIncreases attack damage and magic damage by 15%.4000 Hath
D?mon Duality IIIIncreases attack damage and magic damage by 20%.6000 Hath
D?mon Duality IVIncreases attack damage and magic damage by 25%.8000 Hath
D?mon Duality VIncreases attack damage and magic damage by 30%.10000 Hath
D?mon Duality VIIncreases attack damage and magic damage by 35%.20000 Hath
D?mon Duality VIIIncreases attack damage and magic damage by 40%.30000 Hath
D?mon Duality VIIIIncreases attack damage and magic damage by 45%.40000 Hath
D?mon Duality IXIncreases attack damage and magic damage by 50%.50000 Hath
+
+ +
+ Front +   LoFi   Forums   HentaiVerse   Wiki   Twitter   ToS   Advertise + +
+ + \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.json b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.json new file mode 100644 index 0000000..09c0a6f --- /dev/null +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathPerks_3.json @@ -0,0 +1,10 @@ +{ + "TestCases": [ + { + "ExpectedResult": { + "Hath": 729.01 + }, + "HtmlPath": "./files/ParsingTests/HathPerks_3.html" + } + ] +} \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.html b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.html deleted file mode 100644 index 66ff750..0000000 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.html +++ /dev/null @@ -1,170 +0,0 @@ - - - -E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System - - - - - - - - - - - - -

-[Overview] -  [My Stats] -  [My Settings] -  [My Tags] -  [Hentai@Home] -  [Donations] -  [Hath Perks] -  [Hath Exchange] -  [GP Exchange] -  [Credit Log] -  [Karma Log] -

-
-

Hentai@Home Clients

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
H@H RegionCurrent Network LoadH@H Miss%CoverageHits/GBQuality
North and South America1.49 Gbit/s=187 MB/s0.02 %16.510.07717723
Europe and Africa1.39 Gbit/s=174 MB/s0.03 %18.700.06438137
Asia and Oceania23.26 Gbit/s=2908 MB/s0.01 %26.320.50909041
Global26.15 Gbit/s=3269 MB/s0.01 %61.540.27248430
- -
- Current Network Load shows how much raw bandwidth is currently used to serve images. This includes requests served by H@H as well as direct requests from the image servers.
- H@H Miss% shows the percentage of requests for the region that would have gone to a H@H client if one was available, but where no client was ready to serve the request.
- Coverage denotes the average number of times a static file range partition can be found within a given region, indicating the total available storage capacity.
- Hits/GB shows the average number of hits per minute per gigabyte of allocated disk space for all online clients in the region for the last 24 hours.
-
- -
-
-

Your Active Clients

- -

To add more clients, PM Tenboro. Make sure to read the requirements first to make sure that you qualify. Include the specs for the client in the message, and specify whether it is a home connection or a VPS/Dedicated. Each client requires its own unique public IPv4 address to run, and must either be reachable directly from the internet, or have a port forwarded. These are technical requirements, and it is not possible to make any exceptions.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
ClientIDStatusCreatedLast SeenFiles ServedClient IPPortVersionMax SpeedTrustQualityHitrateHathrateCountry
services.lan45044Offline2023-04-10Today, 16:0240,239Not available when offline
- - - -

If the auto-detected country is wrong, contact Tenboro to have an override applied. Include the correct country, client ID and IP address in your message, and make sure to keep your client running. Having the client set to the wrong country will make it perform worse than it would otherwise do.

- -

Free Archive Quota: 7.1 GB per week, measured in a 168-hour sliding window. The cap is updated once every hour. Clients must have been running for more than 24 hours with a hitrate above 1 to qualify.

- -
-

Client Download

- -
-

The current version of Hentai@Home is 1.6.1. You can find the release notes for this version here.

- - - - - - - - - - - - - - - - - - - - -
FileSizeSHA-1SHA-256
Hentai@Home 1.6.1109188 bytes343a05b5959984f13e6080e83949c99ea359bc2eb8889b2c35593004be061064fcb6d690ff8cbda9564d89f706f7e3ceaf828726
Source Code106498 bytes07f09bc5137369d72ddc13f672f03ebc9b3777429d843b4af8c109450938206f7d72e7a90bd0fca6b3922ac555aaf328ee7c0e5b
- -

Please verify that the size and cryptographic hashes correspond to the file you download. For more information about file validation, see these links: sha1sum sha256sum

-

Hentai@Home is an Open Source project released under the GNU General Public Licence v3. The source code and build scripts for Windows and Linux-like systems can be found above.

-
- - diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.json b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.json deleted file mode 100644 index 69e97ec..0000000 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_1.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "TestCases": [ - { - "ExpectedResult": { - "Regions": [ - { - "Region": 1, - "NetLoad": 187, - "MissRate": 0.02, - "Coverage": 16.51, - "HitsPerGb": 0.0771, - "Quality": 7723 - }, - { - "Region": 2, - "NetLoad": 174, - "MissRate": 0.03, - "Coverage": 18.7, - "HitsPerGb": 0.0643, - "Quality": 8137 - }, - { - "Region": 3, - "NetLoad": 2908, - "MissRate": 0.01, - "Coverage": 26.32, - "HitsPerGb": 0.509, - "Quality": 9041 - }, - { - "Region": 4, - "NetLoad": 3269, - "MissRate": 0.01, - "Coverage": 61.54, - "HitsPerGb": 0.2724, - "Quality": 8430 - } - ], - "Clients": [ - { - "Name": "services.lan", - "Id": 45044, - "Status": 150, - "Created": "2023-04-10", - "FilesServed": 40239, - "ClientIp": null, - "Port": 0, - "Version": null, - "MaxSpeed": 0, - "Trust": 0, - "Quality": 0, - "Hitrate": 0.0, - "Hathrate": 0.0, - "Country": null - } - ] - }, - "HtmlPath": "./files/ParsingTests/HathStatus_1.html" - } - ] -} \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.html b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.html deleted file mode 100644 index d5f7455..0000000 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.html +++ /dev/null @@ -1,180 +0,0 @@ - - - -E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System - - - - - - - - - - - - -

-[Overview] -  [My Stats] -  [My Settings] -  [My Tags] -  [Hentai@Home] -  [Donations] -  [Hath Perks] -  [Hath Exchange] -  [GP Exchange] -  [Credit Log] -  [Karma Log] -

-
-

Hentai@Home Clients

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
H@H RegionCurrent Network LoadH@H Miss%CoverageHits/GBQuality
North and South America1.46 Gbit/s=183 MB/s0.09 %16.510.07737726
Europe and Africa1.25 Gbit/s=157 MB/s0.10 %18.760.06458190
Asia and Oceania18.39 Gbit/s=2299 MB/s0.04 %26.300.51019047
Global21.11 Gbit/s=2639 MB/s0.05 %61.570.27428450
- -
- Current Network Load shows how much raw bandwidth is currently used to serve images. This includes requests served by H@H as well as direct requests from the image servers.
- H@H Miss% shows the percentage of requests for the region that would have gone to a H@H client if one was available, but where no client was ready to serve the request.
- Coverage denotes the average number of times a static file range partition can be found within a given region, indicating the total available storage capacity.
- Hits/GB shows the average number of hits per minute per gigabyte of allocated disk space for all online clients in the region for the last 24 hours.
-
- -
-
-

Your Active Clients

- -

To add more clients, PM Tenboro. Make sure to read the requirements first to make sure that you qualify. Include the specs for the client in the message, and specify whether it is a home connection or a VPS/Dedicated. Each client requires its own unique public IPv4 address to run, and must either be reachable directly from the internet, or have a port forwarded. These are technical requirements, and it is not possible to make any exceptions.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ClientIDStatusCreatedLast SeenFiles ServedClient IPPortVersionMax SpeedTrustQualityHitrateHathrateCountry
services.lan45044Online2023-04-10Today, 14:5840,23946.10.20.3014431.6.1 Stable40000 KB/s+100050461.4 / min2.7 / dayRussian Federation
- - - -

If the auto-detected country is wrong, contact Tenboro to have an override applied. Include the correct country, client ID and IP address in your message, and make sure to keep your client running. Having the client set to the wrong country will make it perform worse than it would otherwise do.

- -

Free Archive Quota: 7.1 GB per week, measured in a 168-hour sliding window. The cap is updated once every hour. Clients must have been running for more than 24 hours with a hitrate above 1 to qualify.

- -
-

Client Download

- -
-

The current version of Hentai@Home is 1.6.1. You can find the release notes for this version here.

- - - - - - - - - - - - - - - - - - - - -
FileSizeSHA-1SHA-256
Hentai@Home 1.6.1109188 bytes343a05b5959984f13e6080e83949c99ea359bc2eb8889b2c35593004be061064fcb6d690ff8cbda9564d89f706f7e3ceaf828726
Source Code106498 bytes07f09bc5137369d72ddc13f672f03ebc9b3777429d843b4af8c109450938206f7d72e7a90bd0fca6b3922ac555aaf328ee7c0e5b
- -

Please verify that the size and cryptographic hashes correspond to the file you download. For more information about file validation, see these links: sha1sum sha256sum

-

Hentai@Home is an Open Source project released under the GNU General Public Licence v3. The source code and build scripts for Windows and Linux-like systems can be found above.

-
- - - diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.json b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.json deleted file mode 100644 index c8aa460..0000000 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "TestCases": [ - { - "ExpectedResult": { - "Regions": [ - { - "Region": 1, - "NetLoad": 183, - "MissRate": 0.09, - "Coverage": 16.51, - "HitsPerGb": 0.0773, - "Quality": 7726 - }, - { - "Region": 2, - "NetLoad": 157, - "MissRate": 0.1, - "Coverage": 18.76, - "HitsPerGb": 0.0645, - "Quality": 8190 - }, - { - "Region": 3, - "NetLoad": 2299, - "MissRate": 0.04, - "Coverage": 26.3, - "HitsPerGb": 0.5101, - "Quality": 9047 - }, - { - "Region": 4, - "NetLoad": 2639, - "MissRate": 0.05, - "Coverage": 61.57, - "HitsPerGb": 0.2742, - "Quality": 8450 - } - ], - "Clients": [ - { - "Name": "services.lan", - "Id": 45044, - "Status": 200, - "Created": "2023-04-10", - "FilesServed": 40239, - "ClientIp": "46.10.20.30", - "Port": 1443, - "Version": "1.6.1 Stable", - "MaxSpeed": 40000, - "Trust": 1000, - "Quality": 5046, - "Hitrate": 1.4, - "Hathrate": 2.7, - "Country": "Russian Federation" - } - ] - }, - "HtmlPath": "./files/ParsingTests/HathStatus_2.html" - } - ] -} \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.html b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.html new file mode 100644 index 0000000..be9528a --- /dev/null +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.html @@ -0,0 +1,271 @@ + + + + E-Hentai Galleries - The Free Hentai Doujinshi, Manga and Image Gallery System + + + + + + + + + + + +
+

Hentai@Home Clients

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
H@H RegionCurrent Network LoadHits/secCoverageHits/GBQuality
North and South America1.53 Gbit/s=191 MB/s50413.250.23768802
Europe and Africa1.39 Gbit/s=173 MB/s50616.520.20278829
Asia and Oceania3.67 Gbit/s=458 MB/s94319.050.58739271
Chinese Dominion3.43 Gbit/s=429 MB/s15494.851.6921-
Global10.02 Gbit/s=1252 MB/s350253.670.47779010
+ +
+ Network Load shows how much bandwidth is currently being used. This includes requests served by H@H and the image servers.
+ Coverage shows the average number of times a file range is found within a region, indicating the total available storage capacity.
+ Hits/GB shows the average number of hits per minute per gigabyte of allocated disk space for all online clients in the region.
+
+ +
+
+

Your Active Clients

+ +

To add more clients, PM Tenboro. Make sure to read the requirements first to make sure that you qualify. Include the system specifications and location the client will run at in the message, and specify whether it is a home connection or a VPS/Dedicated. Each client requires its own unique public IPv4 address to run, and must either be reachable directly from the internet, or have a port forwarded. These are technical requirements, and it is not possible to make any exceptions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClientIDStatusCreatedLast SeenFiles ServedClient IPPortVersionMax SpeedTrustQualityHitrateHathrateCountry
services.lan45244Online2023-04-10Today, 18:412,895,89246.100.100.10014431.6.3 Stable40000 KB/s+100034320.6 / min0.0 / dayRussian Federation
+ + + +

If the auto-detected country is wrong, contact Tenboro to have an override applied. Include the correct country, client ID and IP address in your message, and make sure to keep your client running. Having the client set to the wrong country will make it perform worse than it would otherwise do. If the country is shown in red that means it appears to be located outside of its home region, and will not be assigned new ranges nor gain any hath. Contact Tenboro if you need to change the home region.

+

Free Archive Quota: 0 GB per week, measured in a 168-hour sliding window. Clients must be healthy and must have been running for more than 24 hours straight to qualify.

+ +
+

Client Download

+ +
+ + + + + + + + + + + + + + + + +
FileSizeSHA-256
Hentai@Home 1.6.3112767 bytes55c4360fc3d635e86e08e87aebcda97aecbda3102279d41d753e7452da7c958f
Source Code108412 bytes801de4cfdb2f57f9aab27371900b9fab33df82f83811b03e72425595dec45388
+ +

You can find the current release notes here. You should verify that the size and cryptographic hash correspond to the files you download. Hentai@Home is an Open Source project released under the GNU General Public Licence v3. The source code and build scripts for Windows and Linux-like systems can be found above.

+
+
+
+ Front +   LoFi   Forums   HentaiVerse   Wiki   Twitter   ToS   Advertise + +
+ + \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.json b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.json new file mode 100644 index 0000000..2415eae --- /dev/null +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.Tests/files/ParsingTests/HathStatus_3.json @@ -0,0 +1,69 @@ +{ + "TestCases": [ + { + "ExpectedResult": { + "Regions": [ + { + "Region": 1, + "NetLoad": 191, + "HitsPerSecond": 504.0, + "Coverage": 13.25, + "HitsPerGb": 0.2376, + "Quality": 8802 + }, + { + "Region": 2, + "NetLoad": 173, + "HitsPerSecond": 506.0, + "Coverage": 16.52, + "HitsPerGb": 0.2027, + "Quality": 8829 + }, + { + "Region": 3, + "NetLoad": 458, + "HitsPerSecond": 943.0, + "Coverage": 19.05, + "HitsPerGb": 0.5873, + "Quality": 9271 + }, + { + "Region": 4, + "NetLoad": 429, + "HitsPerSecond": 1549.0, + "Coverage": 4.85, + "HitsPerGb": 1.6921, + "Quality": -1 + }, + { + "Region": 5, + "NetLoad": 1252, + "HitsPerSecond": 3502.0, + "Coverage": 53.67, + "HitsPerGb": 0.4777, + "Quality": 9010 + } + ], + "Clients": [ + { + "Name": "services.lan", + "Id": 45244, + "Status": 200, + "Created": "2023-04-10", + "FilesServed": 2895892, + "ClientIp": "46.100.100.100", + "Port": 1443, + "Version": "1.6.3 Stable", + "MaxSpeed": 40000, + "Trust": 1000, + "Quality": 343, + "Hitrate": 20.6, + "Hathrate": 0.0, + "Country": "Russian Federation" + } + ] + }, + "HtmlPath": "./files/ParsingTests/HathStatus_3.html" + } + ] +} \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.csproj b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.csproj index f5f042e..d9ed9f1 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.csproj +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api.csproj @@ -2,7 +2,7 @@ Library - net6.0 + net8.0 enable enable EHentai api client @@ -40,11 +40,11 @@
- - - - - + + + + +
\ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Client/EHentaiClient.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Client/EHentaiClient.cs index 1511535..3cb99e7 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Client/EHentaiClient.cs +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Client/EHentaiClient.cs @@ -1,8 +1,8 @@ -using ArkProjects.EHentai.Api.Proxy; -using ArkProjects.Flurl; +using ArkProjects.Flurl; using Flurl.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using System.Net; namespace ArkProjects.EHentai.Api.Client; @@ -11,7 +11,7 @@ public partial class EHentaiClient private readonly EHentaiClientOptions _options; private readonly ILogger _logger; private readonly FlurlQuerySerializer _querySerializer; - + private IFlurlClient? _flurlClient; private CookieJar? _flurlCookies; @@ -33,14 +33,11 @@ internal IFlurlRequest BuildBaseRequest(string method, object? queryObj = null) EHentaiSiteType.ExHentai => "https://exhentai.org", _ => throw new NotSupportedException(), }; - var userAgent = _options.OverrideUserAgent ?? "EHentaiNet/1.0"; + var userAgent = _options.OverrideUserAgent ?? "EHentaiNet/1.1"; if (_flurlClient == null) { - _flurlClient = new FlurlClient(urlBase); - _flurlClient.Settings.HttpClientFactory = new ProxyHttpClientFactory(_options.Proxy); - - + _flurlClient ??= CreateClient(urlBase); _flurlClient.WithHeader("User-Agent", userAgent); } @@ -68,9 +65,28 @@ internal IFlurlRequest BuildBaseRequest(string method, object? queryObj = null) return fReq; } - internal async Task MakeRequest(IFlurlRequest req, HttpMethod? method = null, + private async Task MakeRequest(IFlurlRequest req, HttpMethod? method = null, Func? contentFactory = null, CancellationToken ct = default) { - return await req.SendAsync(method ?? HttpMethod.Get, contentFactory?.Invoke(), ct); + return await req.SendAsync(method ?? HttpMethod.Get, contentFactory?.Invoke(), cancellationToken: ct); + } + + + private IFlurlClient CreateClient(string urlBase) + { + if (_options.Proxy.Address == null) + return new FlurlClient(new HttpClient(), urlBase); + + return new FlurlClient(new HttpClient(new HttpClientHandler() + { + Proxy = new WebProxy + { + Address = _options.Proxy.Address, + BypassProxyOnLocal = _options.Proxy.BypassLocal, + Credentials = new NetworkCredential( + _options.Proxy.UserName, _options.Proxy.Password, _options.Proxy.Domain) + }, + UseProxy = true + }), urlBase); } } \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionInfo.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionInfo.cs index e9dc02c..e7047df 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionInfo.cs +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionInfo.cs @@ -4,7 +4,7 @@ public class HathRegionInfo { public HathRegionType Region { get; set; } public int NetLoad { get; set; } - public double MissRate { get; set; } + public double HitsPerSecond { get; set; } public double Coverage { get; set; } public double HitsPerGb { get; set; } public int Quality { get; set; } diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionType.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionType.cs index 2c5dd1d..597ca96 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionType.cs +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/HathRegionType.cs @@ -6,5 +6,6 @@ public enum HathRegionType NorthSouthAmerica, EuropeAfrica, AsiaOceania, + ChineseDominion, Global } \ No newline at end of file diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/Requests/HathStatusResponse.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/Requests/HathStatusResponse.cs index 4123067..1df48c9 100644 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/Requests/HathStatusResponse.cs +++ b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Models/Requests/HathStatusResponse.cs @@ -39,20 +39,22 @@ public static HathStatusResponse Parse(HtmlDocument doc) "North and South America" => HathRegionType.NorthSouthAmerica, "Europe and Africa" => HathRegionType.EuropeAfrica, "Asia and Oceania" => HathRegionType.AsiaOceania, + "Chinese Dominion" => HathRegionType.ChineseDominion, "Global" => HathRegionType.Global, _ => HathRegionType.Unknown }; var netLoad = int.Parse(Regex.Match(netLoadRaw, "\\d+").Value, culture); - var miss = double.Parse(Regex.Match(missRaw, "\\d+\\.\\d+").Value, culture); + var hits = int.Parse(Regex.Match(missRaw, "\\d+").Value, culture); var coverage = double.Parse(Regex.Match(coverageRaw, "\\d+\\.\\d+").Value, culture); var hitrate = double.Parse(Regex.Match(hitrateRaw, "\\d+\\.\\d+").Value, culture); - var quality = int.Parse(Regex.Match(qualityRaw, "\\d+").Value, culture); + if (!int.TryParse(Regex.Match(qualityRaw, "\\d+").Value, culture, out var quality)) + quality = -1; var regionInfo = new HathRegionInfo() { Region = region, NetLoad = netLoad, - MissRate = miss, + HitsPerSecond = hits, Coverage = coverage, HitsPerGb = hitrate, Quality = quality diff --git a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Proxy/ProxyHttpClientFactory.cs b/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Proxy/ProxyHttpClientFactory.cs deleted file mode 100644 index de78a16..0000000 --- a/ArkProjects.EHentai.Api/ArkProjects.EHentai.Api/Proxy/ProxyHttpClientFactory.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Net; -using Flurl.Http.Configuration; - -namespace ArkProjects.EHentai.Api.Proxy; - -public class ProxyHttpClientFactory : DefaultHttpClientFactory -{ - private readonly WebProxyOptions _options; - - public ProxyHttpClientFactory(WebProxyOptions _options) - { - this._options = _options; - } - - public override HttpMessageHandler CreateMessageHandler() - { - if (_options.Address == null) - return new HttpClientHandler(); - - var proxy = new WebProxy - { - Address = _options.Address, - BypassProxyOnLocal = _options.BypassLocal, - Credentials = new NetworkCredential(_options.UserName, _options.Password, _options.Domain) - }; - return new HttpClientHandler() - { - Proxy = proxy, - UseProxy = true - }; - } -} \ No newline at end of file