Skip to main content

ezcapsolver/tasks/
akamai.rs

1use serde::Serialize;
2
3use super::ExtraFields;
4
5/// Akamai Web task.
6#[derive(Debug, Clone, Serialize, Default, bon::Builder)]
7#[builder(on(String, into))]
8#[serde(remote = "Self", rename_all = "camelCase")]
9pub struct AkamaiWebTask {
10    /// Page URL associated with the Akamai script.
11    pub page_url: String,
12    /// URL of the Akamai v3 script.
13    ///
14    /// Most sites change this URL on every request, so it has to be read from
15    /// the page rather than hard-coded. It is the URL itself, not the script
16    /// the URL serves.
17    pub v3_url: String,
18    /// Browser user agent.
19    pub ua: String,
20    /// Browser language.
21    pub lang: String,
22    /// Current interaction round.
23    pub index: i32,
24    /// Current `_abck` cookie value.
25    #[serde(rename = "abck")]
26    #[builder(default)]
27    pub abck: String,
28    /// Current `bm_sz` cookie value.
29    #[serde(rename = "bmsz")]
30    #[builder(default)]
31    pub bmsz: String,
32    /// Base64-encoded Akamai script.
33    #[serde(rename = "script_base64")]
34    #[builder(default)]
35    pub script_base64: String,
36    /// Encoded state returned by the previous round.
37    #[builder(default)]
38    pub encode_data: String,
39    /// Additional worker parameters.
40    #[serde(skip)]
41    #[builder(default)]
42    pub extra: ExtraFields,
43}
44
45/// Akamai SBSD task.
46#[derive(Debug, Clone, Serialize, Default, bon::Builder)]
47#[builder(on(String, into))]
48#[serde(remote = "Self", rename_all = "camelCase")]
49pub struct AkamaiSbsdTask {
50    /// Page URL associated with the challenge.
51    pub page_url: String,
52    /// URL of the SBSD script.
53    pub sbsd_url: String,
54    /// Existing `bm_so` or equivalent cookie value.
55    pub bm_so: String,
56    /// Browser user agent.
57    pub ua: String,
58    /// Browser language.
59    pub lang: String,
60    /// Base64-encoded SBSD script.
61    #[serde(rename = "script_base64")]
62    pub script_base64: String,
63    /// Additional worker parameters.
64    #[serde(skip)]
65    #[builder(default)]
66    pub extra: ExtraFields,
67}