claabs / epicgames-freegames-node

Automatically login and find available free games the Epic Games Store. Sends you a prepopulated checkout link so you can complete the checkout after logging in. Supports multiple accounts, login sessions, and scheduled runs.
https://hub.docker.com/r/charlocharlie/epicgames-freegames
MIT License
1.33k stars 89 forks source link

ERROR (HTTPError/24): Response code 400 (Bad Request) #16

Open Freekers opened 4 years ago

Freekers commented 4 years ago

Hi there :)

The Docker claimed the current free game (Overcooked) fine on one account, but failed on a second account. The first account contains paid games as well whereas the second account only contains 'free' games. The claiming interval between the two accounts is 1 hours and 10 minutes. Both accounts use the same region.

Please find the trace level logging below:

> epicgames-freegames-node@1.0.0 start /usr/app
> node dist/index.js

[2020-06-04 18:23:10.030 +0000] INFO  (24 on 65888ce00991): Checking free games for <REDACTED>
[2020-06-04 18:23:10.041 +0000] DEBUG (24 on 65888ce00991): Setting SID
[2020-06-04 18:23:10.042 +0000] DEBUG (24 on 65888ce00991): Refreshing CSRF
[2020-06-04 18:23:10.043 +0000] TRACE (24 on 65888ce00991): CSRF request
    url: "https://www.epicgames.com/id/api/csrf"
[2020-06-04 18:23:10.722 +0000] TRACE (24 on 65888ce00991): Redirect request
    params: {
      "clientId": "875a3b57d3a640a6b7f9b4e883463ab4",
      "redirectUrl": "https://www.epicgames.com/store/en-US/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2020-06-04 18:23:11.180 +0000] TRACE (24 on 65888ce00991): Set SID request
    params: {
      "sid": "<REDACTED>"
    }
    url: "https://www.unrealengine.com/id/api/set-sid"
[2020-06-04 18:23:11.736 +0000] INFO  (24 on 65888ce00991): Successfully refreshed login
[2020-06-04 18:23:11.736 +0000] TRACE (24 on 65888ce00991): Request store homepage
    url: "https://www.epicgames.com/store/en-US/"
[2020-06-04 18:23:12.859 +0000] DEBUG (24 on 65888ce00991): Getting current free games list
[2020-06-04 18:23:12.860 +0000] TRACE (24 on 65888ce00991): Getting free games list
    url: "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
    params: {
      "locale": "en",
      "country": "US",
      "allowCountries": "US"
    }
[2020-06-04 18:23:13.173 +0000] INFO  (24 on 65888ce00991): Available free games
    availableGames: [
      "Overcooked"
    ]
[2020-06-04 18:23:13.175 +0000] DEBUG (24 on 65888ce00991): Mapping IDs to offer
[2020-06-04 18:23:13.176 +0000] TRACE (24 on 65888ce00991): Fetching updated IDs
    url: "https://store-content.ak.epicgames.com/api/en-US/content/products/overcooked"
[2020-06-04 18:23:13.300 +0000] DEBUG (24 on 65888ce00991): Checking ownership on available games
[2020-06-04 18:23:13.301 +0000] DEBUG (24 on 65888ce00991): Getting product info
    linkedOfferNs: "4561b40e52584ac2bcf34bbd5c401480"
    linkedOfferId: "e9428ad618aa45f4b3371b8c8c4f9de9"
[2020-06-04 18:23:13.302 +0000] TRACE (24 on 65888ce00991): Posting for offer entitlement
    data: {
      "query": "query launcherQuery($namespace:String!, $offerId:String!) {\n    Launcher {\n      entitledOfferItems(namespace: $namespace, offerId: $offerId) {\n        namespace\n        offerId\n        entitledToAllItemsInOffer\n        entitledToAnyItemInOffer\n      }\n    }\n  }",
      "variables": {
        "namespace": "4561b40e52584ac2bcf34bbd5c401480",
        "offerId": "e9428ad618aa45f4b3371b8c8c4f9de9"
      }
    }
    url: "https://www.epicgames.com/store/backend/graphql-proxy"
[2020-06-04 18:23:13.692 +0000] INFO  (24 on 65888ce00991): Unpurchased free games
    purchasableGames: [
      "Overcooked"
    ]
[2020-06-04 18:23:13.693 +0000] INFO  (24 on 65888ce00991): Purchasing Overcooked
[2020-06-04 18:23:13.694 +0000] TRACE (24 on 65888ce00991): Request for purchase token
    searchParams: {
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "offers": "e9428ad618aa45f4b3371b8c8c4f9de9"
    }
    url: "https://www.epicgames.com/store/purchase"
[2020-06-04 18:23:14.950 +0000] DEBUG (24 on 65888ce00991): purchaseToken
    purchaseToken: "e3d21b4f898546bcbc54ec4e6b767611"
[2020-06-04 18:23:14.951 +0000] TRACE (24 on 65888ce00991): Order preview request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": null,
      "countryName": null,
      "orderId": null,
      "orderComplete": null,
      "orderError": null,
      "orderPending": null,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "offerPrice": ""
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2020-06-04 18:23:15.600 +0000] DEBUG (24 on 65888ce00991): Order preview response
    orderPreviewResponse: {
      "affiliation": null,
      "catalogResponse": {
        "currencySymbolPlacement": "LEFT",
        "code": "NL",
        "displayName": "NETHERLANDS",
        "ratingSystem": "PEGI",
        "embargoed": false,
        "sellerOfRecord": "EPIC_INT",
        "vatChargeRate": 23,
        "vatPercentage": 21,
        "defaultCurrency": "EUR",
        "vatIncluded": true,
        "region": "EURO",
        "sellerOfRecordName": "Epic Games International S.à r.l.",
        "paymentCurrency": "EUR"
      },
      "country": "NL",
      "countryName": "Netherlands",
      "message": null,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "orderComplete": false,
      "orderError": false,
      "orderId": null,
      "orderPending": false,
      "orderResponse": {
        "orderType": "PURCHASE",
        "symbol": "€",
        "country": "NL",
        "agentUserName": "anonymous",
        "toUSDExchangeRate": 1.1235278705025642,
        "totalPrice": 0,
        "accountIpCountry": "NL",
        "formattedTotalPrice": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "formattedConvenienceFee": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "paymentCurrencySymbol": "€",
        "orderStatus": "PREVIEW",
        "epicAccountId": "<REDACTED>",
        "salesChannel": "epic-store-web-purchase",
        "formattedPresentmentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canQuickPurchase": true,
        "formattedBillingPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "taxStatus": "NOT_APPLICABLE",
        "totalTax": 0,
        "isFree": true,
        "coupons": [],
        "walletPaymentAmount": 0,
        "totalDiscounted": 0,
        "useSplitPayment": false,
        "currency": "EUR",
        "formattedTotalTax": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "rewardVoucher": null,
        "fraudScore": 0,
        "lastModifiedDate": "2020-06-04T18:23:15.517+0000",
        "paymentCurrencyCode": "EUR",
        "paymentCurrencyAmount": 0,
        "accountIpAddress": "<REDACTED>",
        "vat": 0,
        "batchJobFailedRetryCount": 0,
        "lineOffers": [
          {
            "totalPrice": 0,
            "formattedTotalPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "entitlementSource": "AppEpicgamesCom",
            "sellerName": "Team17 Digital Ltd",
            "refundedRevenueWithoutTax": 0,
            "revenueWithoutTax": 0,
            "title": "Overcooked",
            "formattedBasePrice": {
              "amount": "13.99",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerType": "BASE_GAME",
            "basePayoutCurrencyCode": "USD",
            "sellerId": "o-uvtztrtfjdn3xgrwyhbuwwb5z42mbv",
            "formattedDiscountedPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedBasePayoutPrice": 0,
            "remainingDiscountPrice": 0,
            "refundedConvenienceFee": 0,
            "refundedTax": 0,
            "initiatedBy": "SELLER",
            "basePrice": 1399,
            "formattedBasePayoutPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "unitPrice": 0,
            "refundedDiscountPrice": 0,
            "quantity": 1,
            "vat": 0,
            "formattedVoucherPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedQuantity": 0,
            "shareRate": 0,
            "shareRateByDeveloper": 0,
            "voucherDiscount": 0,
            "namespaceDisplayName": "Overcooked",
            "convenienceFee": 0,
            "discountedPrice": 0,
            "formattedTaxPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "namespace": "4561b40e52584ac2bcf34bbd5c401480",
            "formattedUnitPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerId": "e9428ad618aa45f4b3371b8c8c4f9de9",
            "taxPrice": 0,
            "basePayoutPrice": 0,
            "roleNames": []
          }
        ],
        "merchantGroup": "EGS_MKT",
        "creationDate": "2020-06-04T18:23:15.517+0000",
        "formattedWalletPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "convenienceFee": 0,
        "identityId": "<REDACTED>",
        "fraud": false,
        "billingPaymentAmount": 0,
        "vatIncluded": true,
        "paymentCurrencyExchangeRate": 1,
        "formattedTotalDiscounted": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canSplitPayment": false
      },
      "paypalError": null,
      "showCurrencyChangeMessage": false,
      "syncToken": "<REDACTED>",
      "voucherList": null
    }
[2020-06-04 18:23:15.602 +0000] TRACE (24 on 65888ce00991): Confirm order request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "<REDACTED>",
      "isFreeOrder": false
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-04 18:23:15.990 +0000] DEBUG (24 on 65888ce00991): confirm order response
    confirmOrderResponse: {
      "captchaResult": "CAPTCHA",
      "syncToken": "<REDACTED>",
      "errorCode": "errors.com.epicgames.purchase.purchase.captcha.challenge"
    }
[2020-06-04 18:23:15.991 +0000] DEBUG (24 on 65888ce00991): Captcha required
[2020-06-04 18:23:16.291 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=XXXXXXXXXXXXX&gametype=audio"
[2020-06-04 18:23:16.929 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=XXXXXXXXXXXXXX&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-04 18:23:19.487 +0000] DEBUG (24 on 65888ce00991): Did not transcribe enough digits. Retrying
[2020-06-04 18:23:19.687 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=XXXXXXXXXXXXXXXX&gametype=audio"
[2020-06-04 18:23:20.235 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=XXXXXXXXXXXXXXX&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-04 18:23:22.735 +0000] DEBUG (24 on 65888ce00991): Did not transcribe enough digits. Retrying
[2020-06-04 18:23:22.877 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=XXXXXXXXXXXXXXXXx&gametype=audio"
[2020-06-04 18:23:23.469 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=XXXXXXXXXXXXXXXXX&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-04 18:23:25.620 +0000] DEBUG (24 on 65888ce00991): Guessing captcha
    digitString: "6653395"
[2020-06-04 18:23:25.620 +0000] TRACE (24 on 65888ce00991): Captcha POST request
    form: {
      "fc-game[session_token]": "<REDACTED>",
      "fc-game[data]": "{\"ct\":\"+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\"iv\":\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\"s\":\"XXXXXXXXXXXXXXXXX\"}",
      "fc-game[audio_type]": 2,
      "fc-game[audio_guess]": "6653395"
    }
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=XXXXXXXXXXXXXXXXXXXXXXXXx&gametype=audio"
[2020-06-04 18:23:26.040 +0000] INFO  (24 on 65888ce00991): Captcha solved successfully
[2020-06-04 18:23:26.042 +0000] DEBUG (24 on 65888ce00991): Captcha session token
    verificationCode: "<REDACTED>|r=eu-west-1"
[2020-06-04 18:23:26.043 +0000] TRACE (24 on 65888ce00991): Confirm order request
    body: {
      "captchaToken": "<REDACTED>|r=eu-west-1",
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "<REDACTED>",
      "isFreeOrder": false
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-04 18:23:26.644 +0000] ERROR (24 on 65888ce00991):
    error: true
    message: ""
    syncToken: "c0df6c8c-0e23-4da7-8a12-02257631a4b6"
[2020-06-04 18:23:26.645 +0000] ERROR (HTTPError/24 on 65888ce00991): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at PromisableRequest.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:124:28)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

Thank you!

claabs commented 4 years ago

Is the account email verified?

Freekers commented 4 years ago

Yes, the account email is verified.

Freekers commented 4 years ago

Without changing anything, it claimed the game today just fine on the second account. Here's the log for comparison in case you need it :) Thanks!

[2020-06-05 17:34:00.253 +0000] INFO  (24 on 65888ce00991): Checking free games for <REDACTED>
[2020-06-05 17:34:00.260 +0000] DEBUG (24 on 65888ce00991): Setting SID
[2020-06-05 17:34:00.261 +0000] DEBUG (24 on 65888ce00991): Refreshing CSRF
[2020-06-05 17:34:00.261 +0000] TRACE (24 on 65888ce00991): CSRF request
    url: "https://www.epicgames.com/id/api/csrf"
[2020-06-05 17:34:00.823 +0000] TRACE (24 on 65888ce00991): Redirect request
    params: {
      "clientId": "<REDACTED>",
      "redirectUrl": "https://www.epicgames.com/store/en-US/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2020-06-05 17:34:01.300 +0000] TRACE (24 on 65888ce00991): Set SID request
    params: {
      "sid": "<REDACTED>"
    }
    url: "https://www.unrealengine.com/id/api/set-sid"
[2020-06-05 17:34:01.836 +0000] INFO  (24 on 65888ce00991): Successfully refreshed login
[2020-06-05 17:34:01.836 +0000] TRACE (24 on 65888ce00991): Request store homepage
    url: "https://www.epicgames.com/store/en-US/"
[2020-06-05 17:34:02.741 +0000] DEBUG (24 on 65888ce00991): Getting current free games list
[2020-06-05 17:34:02.742 +0000] TRACE (24 on 65888ce00991): Getting free games list
    url: "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
    params: {
      "locale": "en",
      "country": "US",
      "allowCountries": "US"
    }
[2020-06-05 17:34:03.065 +0000] INFO  (24 on 65888ce00991): Available free games
    availableGames: [
      "Overcooked"
    ]
[2020-06-05 17:34:03.066 +0000] DEBUG (24 on 65888ce00991): Mapping IDs to offer
[2020-06-05 17:34:03.066 +0000] TRACE (24 on 65888ce00991): Fetching updated IDs
    url: "https://store-content.ak.epicgames.com/api/en-US/content/products/overcooked"
[2020-06-05 17:34:03.175 +0000] DEBUG (24 on 65888ce00991): Checking ownership on available games
[2020-06-05 17:34:03.175 +0000] DEBUG (24 on 65888ce00991): Getting product info
    linkedOfferNs: "4561b40e52584ac2bcf34bbd5c401480"
    linkedOfferId: "e9428ad618aa45f4b3371b8c8c4f9de9"
[2020-06-05 17:34:03.176 +0000] TRACE (24 on 65888ce00991): Posting for offer entitlement
    data: {
      "query": "query launcherQuery($namespace:String!, $offerId:String!) {\n    Launcher {\n      entitledOfferItems(namespace: $namespace, offerId: $offerId) {\n        namespace\n        offerId\n        entitledToAllItemsInOffer\n        entitledToAnyItemInOffer\n      }\n    }\n  }",
      "variables": {
        "namespace": "4561b40e52584ac2bcf34bbd5c401480",
        "offerId": "e9428ad618aa45f4b3371b8c8c4f9de9"
      }
    }
    url: "https://www.epicgames.com/store/backend/graphql-proxy"
[2020-06-05 17:34:03.556 +0000] INFO  (24 on 65888ce00991): Unpurchased free games
    purchasableGames: [
      "Overcooked"
    ]
[2020-06-05 17:34:03.557 +0000] INFO  (24 on 65888ce00991): Purchasing Overcooked
[2020-06-05 17:34:03.557 +0000] TRACE (24 on 65888ce00991): Request for purchase token
    searchParams: {
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "offers": "e9428ad618aa45f4b3371b8c8c4f9de9"
    }
    url: "https://www.epicgames.com/store/purchase"
[2020-06-05 17:34:04.665 +0000] DEBUG (24 on 65888ce00991): purchaseToken
    purchaseToken: "<REDACTED>"
[2020-06-05 17:34:04.666 +0000] TRACE (24 on 65888ce00991): Order preview request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": null,
      "countryName": null,
      "orderId": null,
      "orderComplete": null,
      "orderError": null,
      "orderPending": null,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "offerPrice": ""
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2020-06-05 17:34:05.337 +0000] DEBUG (24 on 65888ce00991): Order preview response
    orderPreviewResponse: {
      "affiliation": null,
      "catalogResponse": {
        "currencySymbolPlacement": "LEFT",
        "code": "NL",
        "displayName": "NETHERLANDS",
        "ratingSystem": "PEGI",
        "embargoed": false,
        "sellerOfRecord": "EPIC_INT",
        "vatChargeRate": 23,
        "vatPercentage": 21,
        "defaultCurrency": "EUR",
        "vatIncluded": true,
        "region": "EURO",
        "sellerOfRecordName": "Epic Games International S.à r.l.",
        "paymentCurrency": "EUR"
      },
      "country": "NL",
      "countryName": "Netherlands",
      "message": null,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "orderComplete": false,
      "orderError": false,
      "orderId": null,
      "orderPending": false,
      "orderResponse": {
        "orderType": "PURCHASE",
        "symbol": "€",
        "country": "NL",
        "agentUserName": "anonymous",
        "toUSDExchangeRate": 1.133790841792956,
        "totalPrice": 0,
        "accountIpCountry": "NL",
        "formattedTotalPrice": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "formattedConvenienceFee": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "paymentCurrencySymbol": "€",
        "orderStatus": "PREVIEW",
        "epicAccountId": "<REDACTED>",
        "salesChannel": "epic-store-web-purchase",
        "formattedPresentmentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canQuickPurchase": true,
        "formattedBillingPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "taxStatus": "NOT_APPLICABLE",
        "totalTax": 0,
        "isFree": true,
        "coupons": [],
        "walletPaymentAmount": 0,
        "totalDiscounted": 0,
        "useSplitPayment": false,
        "currency": "EUR",
        "formattedTotalTax": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "rewardVoucher": null,
        "fraudScore": 0,
        "lastModifiedDate": "2020-06-05T17:34:05.252+0000",
        "paymentCurrencyCode": "EUR",
        "paymentCurrencyAmount": 0,
        "accountIpAddress": "<REDACTED>",
        "vat": 0,
        "batchJobFailedRetryCount": 0,
        "lineOffers": [
          {
            "totalPrice": 0,
            "formattedTotalPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "entitlementSource": "AppEpicgamesCom",
            "sellerName": "Team17 Digital Ltd",
            "refundedRevenueWithoutTax": 0,
            "revenueWithoutTax": 0,
            "title": "Overcooked",
            "formattedBasePrice": {
              "amount": "13.99",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerType": "BASE_GAME",
            "basePayoutCurrencyCode": "USD",
            "sellerId": "o-uvtztrtfjdn3xgrwyhbuwwb5z42mbv",
            "formattedDiscountedPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedBasePayoutPrice": 0,
            "remainingDiscountPrice": 0,
            "refundedConvenienceFee": 0,
            "refundedTax": 0,
            "initiatedBy": "SELLER",
            "basePrice": 1399,
            "formattedBasePayoutPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "unitPrice": 0,
            "refundedDiscountPrice": 0,
            "quantity": 1,
            "vat": 0,
            "formattedVoucherPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedQuantity": 0,
            "shareRate": 0,
            "shareRateByDeveloper": 0,
            "voucherDiscount": 0,
            "namespaceDisplayName": "Overcooked",
            "convenienceFee": 0,
            "discountedPrice": 0,
            "formattedTaxPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "namespace": "4561b40e52584ac2bcf34bbd5c401480",
            "formattedUnitPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerId": "e9428ad618aa45f4b3371b8c8c4f9de9",
            "taxPrice": 0,
            "basePayoutPrice": 0,
            "roleNames": []
          }
        ],
        "merchantGroup": "EGS_MKT",
        "creationDate": "2020-06-05T17:34:05.252+0000",
        "formattedWalletPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "convenienceFee": 0,
        "identityId": "<REDACTED>",
        "fraud": false,
        "billingPaymentAmount": 0,
        "vatIncluded": true,
        "paymentCurrencyExchangeRate": 1,
        "formattedTotalDiscounted": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canSplitPayment": false
      },
      "paypalError": null,
      "showCurrencyChangeMessage": false,
      "syncToken": "<REDACTED>",
      "voucherList": null
    }
[2020-06-05 17:34:05.338 +0000] TRACE (24 on 65888ce00991): Confirm order request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "<REDACTED>",
      "isFreeOrder": false
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-05 17:34:05.727 +0000] DEBUG (24 on 65888ce00991): confirm order response
    confirmOrderResponse: {
      "captchaResult": "CAPTCHA",
      "syncToken": "<REDACTED>",
      "errorCode": "errors.com.epicgames.purchase.purchase.captcha.challenge"
    }
[2020-06-05 17:34:05.727 +0000] DEBUG (24 on 65888ce00991): Captcha required
[2020-06-05 17:34:05.989 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=B73XXXXXXXXXXXXXXB&gametype=audio"
[2020-06-05 17:34:06.685 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=7XXXXXXXXXXXX605&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-05 17:34:08.578 +0000] DEBUG (24 on 65888ce00991): Did not transcribe enough digits. Retrying
[2020-06-05 17:34:08.710 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=B73BD16E-3C8E-9082-F9C7-FA780FF2E68B&gametype=audio"
[2020-06-05 17:34:09.195 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=4XXXXXXXXXXXXX&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-05 17:34:11.098 +0000] DEBUG (24 on 65888ce00991): Did not transcribe enough digits. Retrying
[2020-06-05 17:34:11.201 +0000] TRACE (24 on 65888ce00991): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=B73BXXXXXXXXXXXXXXXX8B&gametype=audio"
[2020-06-05 17:34:11.780 +0000] TRACE (24 on 65888ce00991): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=206XXXXXXXXXXXXXXXX69205&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-05 17:34:13.609 +0000] DEBUG (24 on 65888ce00991): Guessing captcha
    digitString: "2533333"
[2020-06-05 17:34:13.610 +0000] TRACE (24 on 65888ce00991): Captcha POST request
    form: {
      "fc-game[session_token]": "206XXXXXXXXXXXXXXXXX9205",
      "fc-game[data]": "{\"ct\":\"SHXAUPaIxQKe+XXXXXXXXXXXXXXXXXXXXXXXXXXXxx\\/Ww\",\"iv\":\"edeXXXXXXXXXXXXXXXXXXX3bef7efc7eeb\",\"s\":\"38XXXXXX140d\"}",
      "fc-game[audio_type]": 2,
      "fc-game[audio_guess]": "2533333"
    }
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=B7XXXXXXXXXXXXXXXXXXXXXXXXXXF2E68B&gametype=audio"
[2020-06-05 17:34:14.069 +0000] INFO  (24 on 65888ce00991): Captcha solved successfully
[2020-06-05 17:34:14.071 +0000] DEBUG (24 on 65888ce00991): Captcha session token
    verificationCode: "<REDACTED>"
[2020-06-05 17:34:14.073 +0000] TRACE (24 on 65888ce00991): Confirm order request
    body: {
      "captchaToken": "<REDACTED>",
      "useDefault": true,
      "setDefault": false,
      "namespace": "4561b40e52584ac2bcf34bbd5c401480",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "e9428ad618aa45f4b3371b8c8c4f9de9"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "<REDACTED>",
      "isFreeOrder": false
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-05 17:34:14.858 +0000] DEBUG (24 on 65888ce00991): confirm order response
    confirmOrderResponse: {
      "cardinalInfo": null,
      "cardinalLookUpResponse": null,
      "confirmation": "<REDACTED>",
      "message": null,
      "orderPending": null,
      "receiptResponse": {
        "orderType": "PURCHASE",
        "symbol": "€",
        "country": "NL",
        "agentUserName": "anonymous",
        "toUSDExchangeRate": 1.133790841792956,
        "orderId": "<REDACTED>",
        "totalPrice": 0,
        "accountIpCountry": "NL",
        "formattedTotalPrice": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "formattedConvenienceFee": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "paymentCurrencySymbol": "€",
        "orderStatus": "COMPLETED",
        "epicAccountId": "<REDACTED>",
        "salesChannel": "epic-store-web-purchase",
        "formattedPresentmentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "taxStatus": "NOT_APPLICABLE",
        "totalTax": 0,
        "coupons": [],
        "totalDiscounted": 0,
        "currency": "EUR",
        "formattedTotalTax": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "rewardVoucher": null,
        "fraudScore": 0,
        "completedAt": "2020-06-05T17:34:14.776+0000",
        "comments": "Free Checkout",
        "lastModifiedDate": "2020-06-05T17:34:14.776+0000",
        "paymentCurrencyCode": "EUR",
        "paymentCurrencyAmount": 0,
        "accountIpAddress": "<REDACTED>",
        "vat": 0,
        "batchJobFailedRetryCount": 0,
        "lineOffers": [
          {
            "totalPrice": 0,
            "formattedTotalPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "entitlementSource": "AppEpicgamesCom",
            "sellerName": "Team17 Digital Ltd",
            "refundedRevenueWithoutTax": 0,
            "revenueWithoutTax": 0,
            "title": "Overcooked",
            "formattedBasePrice": {
              "amount": "13.99",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerType": "BASE_GAME",
            "basePayoutCurrencyCode": "USD",
            "sellerId": "o-uvtztrtfjdn3xgrwyhbuwwb5z42mbv",
            "formattedDiscountedPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedBasePayoutPrice": 0,
            "remainingDiscountPrice": 0,
            "refundedConvenienceFee": 0,
            "refundedTax": 0,
            "initiatedBy": "SELLER",
            "basePrice": 1399,
            "formattedBasePayoutPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "unitPrice": 0,
            "refundedDiscountPrice": 0,
            "quantity": 1,
            "offerItems": [
              {
                "itemId": "407abe035be74f159ae6548e85273576",
                "entitlementRevoked": false,
                "entitlementId": "3b01fb5e26114a2da0ffdbfcc468b20a",
                "namespace": "4561b40e52584ac2bcf34bbd5c401480",
                "entitlementName": "407abe035be74f159ae6548e85273576"
              }
            ],
            "vat": 0,
            "formattedVoucherPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedQuantity": 0,
            "shareRate": 0,
            "shareRateByDeveloper": 0,
            "voucherDiscount": 0,
            "namespaceDisplayName": "Overcooked",
            "convenienceFee": 0,
            "discountedPrice": 0,
            "formattedTaxPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "namespace": "4561b40e52584ac2bcf34bbd5c401480",
            "formattedUnitPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerId": "e9428ad618aa45f4b3371b8c8c4f9de9",
            "taxPrice": 0,
            "basePayoutPrice": 0
          }
        ],
        "merchantGroup": "EGS_MKT",
        "creationDate": "2020-06-05T17:34:14.701+0000",
        "convenienceFee": 0,
        "identityId": "<REDACTED>",
        "fraudDecision": "APPROVE",
        "fraud": false,
        "vatIncluded": false,
        "paymentCurrencyExchangeRate": 1,
        "invoiceId": "F94459246",
        "formattedTotalDiscounted": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        }
      },
      "syncToken": null
    }
[2020-06-05 17:34:14.859 +0000] DEBUG (24 on 65888ce00991): Purchase successful
[2020-06-05 17:34:14.860 +0000] INFO  (24 on 65888ce00991): Done purchasing Overcooked
claabs commented 4 years ago

I'm not really sure what's causing this. I was able to recreate the error, and I was also able to redeem it after a second try.

Here's what I can confirm it likely isn't:

I did make some improvements, though, so I'll push what I have.

I also saw this funny error message after an hour of testing on new accounts lol:

confirm order response
    confirmOrderResponse: {
      "captchaResult": "DECLINE",
      "syncToken": "502c9bcf-4db4-416c-a3d8-8d0d8f452eff",
      "message": "Your account is unable to download any more free games at this time, please wait 24 hours before trying to redeem a free game again.",
      "errorCode": "errors.com.epicgames.purchase.purchase.captcha.decline"
    }
Freekers commented 4 years ago

Interesting findings! Thanks for figuring out what it could be :)

Lol well better an error message than an IP ban ;)

Freekers commented 4 years ago

This time the Docker managed to grab the free game on first try for the second account, but failed to do so with the same HTTPError: Response code 400 (Bad Request) on the first account (which usually had no issues):

[2020-06-12 01:34:13.830 +0000] INFO  (25 on 38ced4158ffd): Checking free games for XXXXXXXXXXXXXXXXXXXXXXXXXX
[2020-06-12 01:34:13.849 +0000] DEBUG (25 on 38ced4158ffd): Setting SID
[2020-06-12 01:34:13.850 +0000] DEBUG (25 on 38ced4158ffd): Refreshing CSRF
[2020-06-12 01:34:13.851 +0000] TRACE (25 on 38ced4158ffd): CSRF request
    url: "https://www.epicgames.com/id/api/csrf"
[2020-06-12 01:34:14.819 +0000] TRACE (25 on 38ced4158ffd): Redirect request
    params: {
      "clientId": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
      "redirectUrl": "https://www.epicgames.com/store/en-US/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2020-06-12 01:34:15.315 +0000] TRACE (25 on 38ced4158ffd): Set SID request
    params: {
      "sid": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
    url: "https://www.unrealengine.com/id/api/set-sid"
[2020-06-12 01:34:15.841 +0000] INFO  (25 on 38ced4158ffd): Successfully refreshed login
[2020-06-12 01:34:15.841 +0000] TRACE (25 on 38ced4158ffd): Request store homepage
    url: "https://www.epicgames.com/store/en-US/"
[2020-06-12 01:34:16.915 +0000] DEBUG (25 on 38ced4158ffd): Getting current free games list
[2020-06-12 01:34:16.916 +0000] TRACE (25 on 38ced4158ffd): Getting free games list
    url: "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
    params: {
      "locale": "en",
      "country": "US",
      "allowCountries": "US"
    }
[2020-06-12 01:34:16.995 +0000] INFO  (25 on 38ced4158ffd): Available free games
    availableGames: [
      "SAMURAI SHODOWN NEOGEO COLLECTION",
      "ARK: Survival Evolved"
    ]
[2020-06-12 01:34:17.001 +0000] DEBUG (25 on 38ced4158ffd): Mapping IDs to offer
[2020-06-12 01:34:17.002 +0000] TRACE (25 on 38ced4158ffd): Fetching updated IDs
    url: "https://store-content.ak.epicgames.com/api/en-US/content/products/samurai-shodown-neogeo-collection"
[2020-06-12 01:34:17.006 +0000] TRACE (25 on 38ced4158ffd): Fetching updated IDs
    url: "https://store-content.ak.epicgames.com/api/en-US/content/products/ark"
[2020-06-12 01:34:17.102 +0000] DEBUG (25 on 38ced4158ffd): Checking ownership on available games
[2020-06-12 01:34:17.105 +0000] DEBUG (25 on 38ced4158ffd): Getting product info
    linkedOfferNs: "3e84a6d0684b4f7593e6bf88bee0cbaf"
    linkedOfferId: "b3678744f16842debd1f2d57fbe12e9c"
[2020-06-12 01:34:17.107 +0000] TRACE (25 on 38ced4158ffd): Posting for offer entitlement
    data: {
      "query": "query launcherQuery($namespace:String!, $offerId:String!) {\n    Launcher {\n      entitledOfferItems(namespace: $namespace, offerId: $offerId) {\n        namespace\n        offerId\n        entitledToAllItemsInOffer\n        entitledToAnyItemInOffer\n      }\n    }\n  }",
      "variables": {
        "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
        "offerId": "b3678744f16842debd1f2d57fbe12e9c"
      }
    }
    url: "https://www.epicgames.com/store/backend/graphql-proxy"
[2020-06-12 01:34:17.110 +0000] DEBUG (25 on 38ced4158ffd): Getting product info
    linkedOfferNs: "ark"
    linkedOfferId: "16b7c8509ea8427898981145d244316c"
[2020-06-12 01:34:17.111 +0000] TRACE (25 on 38ced4158ffd): Posting for offer entitlement
    data: {
      "query": "query launcherQuery($namespace:String!, $offerId:String!) {\n    Launcher {\n      entitledOfferItems(namespace: $namespace, offerId: $offerId) {\n        namespace\n        offerId\n        entitledToAllItemsInOffer\n        entitledToAnyItemInOffer\n      }\n    }\n  }",
      "variables": {
        "namespace": "ark",
        "offerId": "16b7c8509ea8427898981145d244316c"
      }
    }
    url: "https://www.epicgames.com/store/backend/graphql-proxy"
[2020-06-12 01:34:17.537 +0000] INFO  (25 on 38ced4158ffd): Unpurchased free games
    purchasableGames: [
      "SAMURAI SHODOWN NEOGEO COLLECTION",
      "ARK: Survival Evolved"
    ]
[2020-06-12 01:34:17.538 +0000] INFO  (25 on 38ced4158ffd): Purchasing SAMURAI SHODOWN NEOGEO COLLECTION
[2020-06-12 01:34:17.539 +0000] TRACE (25 on 38ced4158ffd): Request for purchase token
    searchParams: {
      "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
      "offers": "b3678744f16842debd1f2d57fbe12e9c"
    }
    url: "https://www.epicgames.com/store/purchase"
[2020-06-12 01:34:18.768 +0000] DEBUG (25 on 38ced4158ffd): purchaseToken
    purchaseToken: "XXXXXXXXXXXXXXXXXXXXXXXXXX"
[2020-06-12 01:34:18.769 +0000] TRACE (25 on 38ced4158ffd): Order preview request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
      "country": null,
      "countryName": null,
      "orderId": null,
      "orderComplete": null,
      "orderError": null,
      "orderPending": null,
      "offers": [
        "b3678744f16842debd1f2d57fbe12e9c"
      ],
      "offerPrice": ""
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2020-06-12 01:34:19.354 +0000] DEBUG (25 on 38ced4158ffd): Order preview response
    orderPreviewResponse: {
      "affiliation": null,
      "catalogResponse": {
        "currencySymbolPlacement": "LEFT",
        "code": "NL",
        "displayName": "NETHERLANDS",
        "ratingSystem": "PEGI",
        "embargoed": false,
        "sellerOfRecord": "EPIC_INT",
        "vatChargeRate": 23,
        "vatPercentage": 21,
        "defaultCurrency": "EUR",
        "vatIncluded": true,
        "region": "EURO",
        "sellerOfRecordName": "Epic Games International S.à r.l.",
        "paymentCurrency": "EUR"
      },
      "country": "NL",
      "countryName": "Netherlands",
      "message": null,
      "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
      "offers": [
        "b3678744f16842debd1f2d57fbe12e9c"
      ],
      "orderComplete": false,
      "orderError": false,
      "orderId": null,
      "orderPending": false,
      "orderResponse": {
        "orderType": "PURCHASE",
        "symbol": "€",
        "country": "NL",
        "agentUserName": "anonymous",
        "toUSDExchangeRate": 1.1288726186706002,
        "totalPrice": 0,
        "accountIpCountry": "NL",
        "formattedTotalPrice": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "formattedConvenienceFee": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "paymentCurrencySymbol": "€",
        "orderStatus": "PREVIEW",
        "epicAccountId": "1f40b9eb3a0e461a934037ea37229c97",
        "salesChannel": "epic-store-web-purchase",
        "formattedPresentmentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canQuickPurchase": true,
        "formattedBillingPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "taxStatus": "NOT_APPLICABLE",
        "totalTax": 0,
        "isFree": true,
        "coupons": [],
        "walletPaymentAmount": 0,
        "totalDiscounted": 0,
        "useSplitPayment": false,
        "currency": "EUR",
        "formattedTotalTax": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "rewardVoucher": null,
        "fraudScore": 0,
        "lastModifiedDate": "2020-06-12T01:34:19.271+0000",
        "paymentCurrencyCode": "EUR",
        "paymentCurrencyAmount": 0,
        "accountIpAddress": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
        "vat": 0,
        "batchJobFailedRetryCount": 0,
        "lineOffers": [
          {
            "totalPrice": 0,
            "formattedTotalPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "entitlementSource": "AppEpicgamesCom",
            "sellerName": "SNK CORPORATION",
            "refundedRevenueWithoutTax": 0,
            "revenueWithoutTax": 0,
            "title": "SAMURAI SHODOWN NEOGEO COLLECTION",
            "formattedBasePrice": {
              "amount": "39.99",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerType": "BASE_GAME",
            "basePayoutCurrencyCode": "USD",
            "sellerId": "o-bse2s8gp28ptrv924lby79vx66vsz6",
            "formattedDiscountedPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedBasePayoutPrice": 0,
            "remainingDiscountPrice": 0,
            "refundedConvenienceFee": 0,
            "refundedTax": 0,
            "initiatedBy": "SELLER",
            "basePrice": 3999,
            "formattedBasePayoutPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "unitPrice": 0,
            "refundedDiscountPrice": 0,
            "quantity": 1,
            "vat": 0,
            "formattedVoucherPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "refundedQuantity": 0,
            "shareRate": 0,
            "shareRateByDeveloper": 0,
            "voucherDiscount": 0,
            "namespaceDisplayName": "Sunstone",
            "convenienceFee": 0,
            "discountedPrice": 0,
            "formattedTaxPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
            "formattedUnitPrice": {
              "amount": "0.00",
              "symbol": "€",
              "placement": "f",
              "decimals": 2,
              "digits": 2
            },
            "offerId": "b3678744f16842debd1f2d57fbe12e9c",
            "taxPrice": 0,
            "basePayoutPrice": 0,
            "roleNames": []
          }
        ],
        "merchantGroup": "EGS_MKT",
        "creationDate": "2020-06-12T01:34:19.271+0000",
        "formattedWalletPaymentAmount": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "convenienceFee": 0,
        "identityId": "1f40b9eb3a0e461a934037ea37229c97",
        "fraud": false,
        "billingPaymentAmount": 0,
        "vatIncluded": true,
        "paymentCurrencyExchangeRate": 1,
        "formattedTotalDiscounted": {
          "amount": "0.00",
          "symbol": "€",
          "placement": "f",
          "decimals": 2,
          "digits": 2
        },
        "canSplitPayment": false
      },
      "paypalError": null,
      "showCurrencyChangeMessage": false,
      "syncToken": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voucherList": null
    }
[2020-06-12 01:34:19.367 +0000] TRACE (25 on 38ced4158ffd): Confirm order request
    body: {
      "useDefault": true,
      "setDefault": false,
      "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "b3678744f16842debd1f2d57fbe12e9c"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
      "eulaId": null,
      "useDefaultBillingAccount": true,
      "canQuickPurchase": true
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-12 01:34:19.761 +0000] DEBUG (25 on 38ced4158ffd): confirm order response
    confirmOrderResponse: {
      "captchaResult": "CAPTCHA",
      "syncToken": "e8084d9b-cc01-4156-9faf-91b4ebdb87d0",
      "errorCode": "errors.com.epicgames.purchase.purchase.captcha.challenge"
    }
[2020-06-12 01:34:19.761 +0000] DEBUG (25 on 38ced4158ffd): Captcha required
[2020-06-12 01:34:19.993 +0000] TRACE (25 on 38ced4158ffd): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=XXXXXXXB&gametype=audio"
[2020-06-12 01:34:20.806 +0000] TRACE (25 on 38ced4158ffd): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=2XXXXXXX5&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-12 01:34:23.512 +0000] DEBUG (25 on 38ced4158ffd): Did not transcribe enough digits. Retrying
[2020-06-12 01:34:23.694 +0000] TRACE (25 on 38ced4158ffd): Requesting initial captcha page
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=BXXXXXXXX9C7-FA780FF2E68B&gametype=audio"
[2020-06-12 01:34:24.272 +0000] TRACE (25 on 38ced4158ffd): Requesting audio file
    url: "https://epic-games-api.arkoselabs.com/fc/get_audio/?session_token=367XXXXXXXXX4607705&analytics_tier=40&r=eu-west-1&game=0&language=en&d=1"
[2020-06-12 01:34:26.606 +0000] DEBUG (25 on 38ced4158ffd): Guessing captcha
    digitString: "1038998"
[2020-06-12 01:34:26.606 +0000] TRACE (25 on 38ced4158ffd): Captcha POST request
    form: {
      "fc-game[session_token]": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
      "fc-game[data]": "{\"ct\":\"XXXh\\/cQCg7XXXXXf5XXXXXWY\\/3JU+XXXXBXXX5x\\/9XXXXSAEZU\\/XXXXXXXExaBEve\",\"iv\":\"0ad4XXXXXb47c4\",\"s\":\"42ce395XXX017a8\"}",
      "fc-game[audio_type]": 2,
      "fc-game[audio_guess]": "1038998"
    }
    url: "https://epic-games-api.arkoselabs.com/fc/api/nojs/?pkey=B7XXXXX80FF2E68B&gametype=audio"
[2020-06-12 01:34:27.050 +0000] INFO  (25 on 38ced4158ffd): Captcha solved successfully
[2020-06-12 01:34:27.054 +0000] DEBUG (25 on 38ced4158ffd): Captcha session token
    verificationCode: "XXXXXXXXXXXXXXXXXXXXXXXXXX|r=eu-west-1"
[2020-06-12 01:34:27.055 +0000] TRACE (25 on 38ced4158ffd): Confirm order request
    body: {
      "captchaToken": "XXXXXXXXXXXXXXXXXXXXXXXXXX|r=eu-west-1",
      "useDefault": true,
      "setDefault": false,
      "namespace": "3e84a6d0684b4f7593e6bf88bee0cbaf",
      "country": "NL",
      "countryName": "Netherlands",
      "orderId": null,
      "orderComplete": false,
      "orderError": false,
      "orderPending": false,
      "offers": [
        "b3678744f16842debd1f2d57fbe12e9c"
      ],
      "includeAccountBalance": false,
      "totalAmount": 0,
      "affiliateId": "",
      "creatorSource": "",
      "threeDSToken": "",
      "voucherCode": null,
      "syncToken": "eXXXXXXXXXXXXXXX0",
      "eulaId": null,
      "useDefaultBillingAccount": true,
      "canQuickPurchase": true
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2020-06-12 01:34:27.795 +0000] ERROR (25 on 38ced4158ffd):
    error: true
    message: ""
    syncToken: "b0XXXXXXXXXXXXXXXX35cec"
[2020-06-12 01:34:27.796 +0000] ERROR (HTTPError/25 on 38ced4158ffd): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at PromisableRequest.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:124:28)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

I'll wait and report if it manages to grab it during the second try, scheduled for this afternoon.

claabs commented 4 years ago

I think this may be caused by a polling action on the Epic backend to validate a captcha session ID. In https://github.com/claabs/epicgames-freegames-node/commit/48594c9a3247a5280d89a2506dccd3e3743b6df1, I added a 2 second wait after solving to maybe solve this. We'll see how it plays out over time.

Freekers commented 4 years ago

From my findings, it seems like EpicGames has put a (rate)limit on the amount of accounts that can claim free games via the API from the same IP address. The bot consistently grabs the free games for one account at the scheduled time, but fails to do so for the other account at the schedule time (which is 1 hour later than the other account). The next day, it will grab the game(s) for the second account just fine at the scheduled time. The logging is the same as posted before; it always fails to grab with 400 Bad Request on the same day, but does so without issue on the second day.

So in sum; it works, even though there's a day in between grabbing the game(s) for each account, which is fine by me :)

Wunderharke commented 2 years ago

edit: opened #143 instead