namespace BlueLaminate.Scraper.CsMoney;
///
/// Configuration for the cs.money scraper, bound from the CsMoney
/// configuration section.
///
/// cs.money exposes no public API and sits behind Cloudflare bot protection, so we
/// drive a real, non-headless browser (Selenium/Edge) routed through an IPRoyal
/// residential proxy via a local forwarding hop (no CDP). The market endpoint
/// re-challenges aggressively during pagination, so these options also tune the
/// warmed profile and request pacing we use to survive longer.
///
///
public sealed class CsMoneyOptions
{
public const string SectionName = "CsMoney";
/// Public market page the browser opens (and where the operator clears Cloudflare).
public string MarketUrl { get; set; } = "https://cs.money/market/buy/";
///
/// Listings API template; {0} is the page offset (steps of 60). Fetched
/// in-page from the cleared market origin so the cf_clearance cookie is sent.
///
public string ApiUrlTemplate { get; set; } =
"https://cs.money/2.0/market/sell-orders?limit=60&offset={0}";
///
/// Persistent Chromium profile directory. Reusing one profile keeps the
/// cf_clearance cookie and history between runs — a warmed profile is far less
/// likely to be re-challenged than a fresh one. Empty = throwaway profile.
///
public string ProfileDir { get; set; } =
Path.Combine(Path.GetTempPath(), "bluelaminate-csmoney-profile");
///
/// Optional ISO country code(s) for the residential exit IP, e.g. "us". Null/empty
/// lets IPRoyal pick at random.
///
public string? Country { get; set; }
/// Load images. Off by default to conserve the metered residential plan.
public bool LoadImages { get; set; }
/// Base delay between paginated API fetches, in seconds (human-like pacing).
public double PageDelaySeconds { get; set; } = 2.5;
/// Extra random jitter added to each delay, in seconds (0..value).
public double PageJitterSeconds { get; set; } = 2.0;
}