TychoTheTaco / Twitch-Drops-Bot

A Node.js bot that will automatically watch Twitch streams and claim drop rewards.
MIT License
280 stars 36 forks source link

[Bug] Failing to claim drops #196

Closed Valentin-Metz closed 2 years ago

Valentin-Metz commented 2 years ago

[2022-09-15 07:44:09] [warn] Twitch account not linked for this campaign!
[2022-09-15 07:44:09] [debug] working on campaign {
    "id": "06dc83e2-a533-41bf-9336-3c3261bd5255",
    "name": "Go Alien For PUBG BRASIL",
    "owner": {
        "id": "2986fad1-6d72-43b0-8a18-c3c313414ab4",
        "name": "PUBG Corp",
        "__typename": "Organization"
    },
    "game": {
        "id": "493057",
        "displayName": "PUBG: BATTLEGROUNDS",
        "boxArtURL": "https://static-cdn.jtvnw.net/ttv-boxart/493057-285x380.jpg",
        "__typename": "Game",
        "name": "PUBG: BATTLEGROUNDS"
    },
    "status": "ACTIVE",
    "startAt": "2022-09-14T13:00:00Z",
    "endAt": "2022-09-26T13:00:00Z",
    "detailsURL": "https://accounts.krafton.com/login",
    "accountLinkURL": "https://accounts.krafton.com/",
    "self": {
        "isAccountConnected": false,
        "__typename": "DropCampaignSelfEdge"
    },
    "__typename": "DropCampaign",
    "imageURL": "https://static-cdn.jtvnw.net/twitch-drops-assets-prod/CAMPAIGN-76ae9cd2-7e7e-424d-9cf5-1f42bb2ddf02.png",
    "allow": {
        "channels": [
            {
                "id": "214705048",
                "name": "pubg_br",
                "url": "https://www.twitch.tv/pubg_br",
                "__typename": "Channel",
                "displayName": "PUBG_BR"
            },
            {
                "id": "214707387",
                "name": "pubglatam",
                "url": "https://www.twitch.tv/pubglatam",
                "__typename": "Channel",
                "displayName": "PUBGLATAM"
            },
            {
                "id": "32330287",
                "name": "neves",
                "url": "https://www.twitch.tv/neves",
                "__typename": "Channel",
                "displayName": "Neves"
            }
        ],
        "__typename": "DropCampaignACL",
        "isEnabled": true
    },
    "eventBasedDrops": [],
    "timeBasedDrops": [
        {
            "id": "b72b7a54-fe3b-44f2-b216-8de7babafcfa",
            "name": "Neves Alien",
            "startAt": "2022-09-14T13:00:00Z",
            "endAt": "2022-09-26T13:00:00Z",
            "preconditionDrops": null,
            "requiredMinutesWatched": 60,
            "benefitEdges": [
                {
                    "benefit": {
                        "id": "pubg-go-alien-2022_18100124",
                        "imageAssetURL": "https://static-cdn.jtvnw.net/twitch-drops-assets-prod/BENEFIT-60a44c51-6711-4828-a3b0-e867d406b898.png",
                        "name": "Neves_Alien",
                        "__typename": "DropBenefit",
                        "createdAt": "2022-08-18T15:46:18Z",
                        "entitlementLimit": -1,
                        "game": {
                            "id": "493057",
                            "name": "PUBG: BATTLEGROUNDS",
                            "__typename": "Game"
                        },
                        "isIosAvailable": false,
                        "ownerOrganization": {
                            "id": "2986fad1-6d72-43b0-8a18-c3c313414ab4",
                            "name": "PUBG Corp",
                            "__typename": "Organization"
                        }
                    },
                    "entitlementLimit": 1,
                    "claimCount": 0,
                    "__typename": "DropBenefitEdge"
                }
            ],
            "self": {
                "hasPreconditionsMet": true,
                "currentMinutesWatched": 60,
                "isClaimed": false,
                "dropInstanceID": "bc51db55-0bcf-4f85-9573-aaa004e1f93f",
                "__typename": "TimeBasedDropSelfEdge"
            },
            "campaign": {
                "id": "06dc83e2-a533-41bf-9336-3c3261bd5255",
                "accountLinkURL": "https://accounts.krafton.com/",
                "self": {
                    "isAccountConnected": false,
                    "__typename": "DropCampaignSelfEdge"
                },
                "__typename": "DropCampaign"
            },
            "__typename": "TimeBasedDrop"
        }
    ],
    "description": "Go Alien For PUBG BRASIL"
}
[2022-09-15 07:44:12] [debug] working on drop {
    "id": "b72b7a54-fe3b-44f2-b216-8de7babafcfa",
    "benefitEdges": [
        {
            "benefit": {
                "id": "pubg-go-alien-2022_18100124",
                "createdAt": "2022-08-18T15:46:18Z",
                "entitlementLimit": -1,
                "game": {
                    "id": "493057",
                    "name": "PUBG: BATTLEGROUNDS",
                    "__typename": "Game"
                },
                "imageAssetURL": "https://static-cdn.jtvnw.net/twitch-drops-assets-prod/BENEFIT-60a44c51-6711-4828-a3b0-e867d406b898.png",
                "isIosAvailable": false,
                "name": "Neves_Alien",
                "ownerOrganization": {
                    "id": "2986fad1-6d72-43b0-8a18-c3c313414ab4",
                    "name": "PUBG Corp",
                    "__typename": "Organization"
                },
                "__typename": "DropBenefit"
            },
            "entitlementLimit": 1,
            "__typename": "DropBenefitEdge"
        }
    ],
    "endAt": "2022-09-26T13:00:00Z",
    "name": "Neves Alien",
    "preconditionDrops": null,
    "requiredMinutesWatched": 60,
    "startAt": "2022-09-14T13:00:00Z",
    "__typename": "TimeBasedDrop"
}
[2022-09-15 07:44:12] [debug] claimDropReward: {
    "id": "b72b7a54-fe3b-44f2-b216-8de7babafcfa",
    "name": "Neves Alien",
    "startAt": "2022-09-14T13:00:00Z",
    "endAt": "2022-09-26T13:00:00Z",
    "preconditionDrops": null,
    "requiredMinutesWatched": 60,
    "benefitEdges": [
        {
            "benefit": {
                "id": "pubg-go-alien-2022_18100124",
                "imageAssetURL": "https://static-cdn.jtvnw.net/twitch-drops-assets-prod/BENEFIT-60a44c51-6711-4828-a3b0-e867d406b898.png",
                "name": "Neves_Alien",
                "__typename": "DropBenefit"
            },
            "entitlementLimit": 1,
            "claimCount": 0,
            "__typename": "DropBenefitEdge"
        }
    ],
    "self": {
        "hasPreconditionsMet": true,
        "currentMinutesWatched": 60,
        "isClaimed": false,
        "dropInstanceID": "bc51db55-0bcf-4f85-9573-aaa004e1f93f",
        "__typename": "TimeBasedDropSelfEdge"
    },
    "campaign": {
        "id": "06dc83e2-a533-41bf-9336-3c3261bd5255",
        "accountLinkURL": "https://accounts.krafton.com/",
        "self": {
            "isAccountConnected": false,
            "__typename": "DropCampaignSelfEdge"
        },
        "__typename": "DropCampaign"
    },
    "__typename": "TimeBasedDrop"
}
[2022-09-15 07:44:12] [error] Error processing campaign
[2022-09-15 07:44:12] [debug] Error: API error: {
    "errors": [
        {
            "message": "failed integrity check"
        }
    ],
    "extensions": {
        "challenge": {
            "type": "integrity"
        },
        "durationMilliseconds": 2,
        "operationName": "DropsPage_ClaimDropRewards",
        "requestID": "01GD01NXP6J57CY9KCF5A2DVPB"
    }
}
    at Client.<anonymous> (file:///app/dist/twitch.js:307:19)
    at Generator.next (<anonymous>)
    at fulfilled (file:///app/dist/twitch.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)```
doedelgit commented 2 years ago

Apparently some extra things are needed to make it work again: https://github.com/mauricew/twitch-graphql-api#integrity

TychoTheTaco commented 2 years ago

Thanks for the info @doedelgit, I will have a fix soon.

Valentin-Metz commented 2 years ago

Latest update has fixed the issue. Closing this.