Codepotatoes.Scraper.HowLongToBeat
1.3.2
dotnet add package Codepotatoes.Scraper.HowLongToBeat --version 1.3.2
NuGet\Install-Package Codepotatoes.Scraper.HowLongToBeat -Version 1.3.2
<PackageReference Include="Codepotatoes.Scraper.HowLongToBeat" Version="1.3.2" />
<PackageVersion Include="Codepotatoes.Scraper.HowLongToBeat" Version="1.3.2" />
<PackageReference Include="Codepotatoes.Scraper.HowLongToBeat" />
paket add Codepotatoes.Scraper.HowLongToBeat --version 1.3.2
#r "nuget: Codepotatoes.Scraper.HowLongToBeat, 1.3.2"
#:package Codepotatoes.Scraper.HowLongToBeat@1.3.2
#addin nuget:?package=Codepotatoes.Scraper.HowLongToBeat&version=1.3.2
#tool nuget:?package=Codepotatoes.Scraper.HowLongToBeat&version=1.3.2
HowLongToBeatScraper
As we're still missing an api to fetch data from Howlongtobeat
this project aims to bridge the gap in the meantime.
Usage
Install the package:
dotnet add package Crashdummy.Scraper.HowLongToBeat
using var scraper = new HltbScraper();
// Simple search with works as in using the howlongtobeat.com page
IEnumerable<GameEntry> results = await scraper.Search("Borderlands 3");
// Advanced search
var query = new QueryBuilder().WithSearchType(SearchOptions.Type.Users)
.WithModifier(SearchOptions.Modifier.HideModsAndDlc);
IEnumerable<GameEntry> results = await scraper.Search(query);
Regarding the "authentication"
The main endpoint that is being used is /api/search.
This previously required a magic hash that could be found hardcoded somewhere in the depths of the _app*.js file.
They eventually decided to provide an /api/search/init?t=<time in ms since unix epoch> endpoint
which returns an base64 encoded authorization token
that is added to the header x-auth-token.
The token contains your public ip address and some other encrypted values.
Dependencies
For some reason /api/price-checks/<gameid>, only returns the gogAppId.
The SteamAppId has to be provided within the body which thus defeats the purpose.
Until theres a better way we need to scrape it there
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AngleSharp (>= 1.4.0)
-
net8.0
- AngleSharp (>= 1.4.0)
-
net9.0
- AngleSharp (>= 1.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.