Esempio n. 1
0
def update_raid(streamer_login, raid):
    if raid_id_for_streamer.get(streamer_login) != raid:
        raid_id_for_streamer[streamer_login] = raid
        post_gql_request({
            "operationName": "JoinRaid",
            "variables": {
                "input": {
                    "raidID": raid.raid_id
                }
            },
            "extensions": {
                "persistedQuery": {
                    "version":
                    1,
                    "sha256Hash":
                    "c6a332a86d1087fbbb1a8623aa01bd1313d2386e7c63be60fdb2d1901f01a4ae"
                }
            }
        })

        print(f"Joining raid from {streamer_login} to {raid.target_login}!")
Esempio n. 2
0
def get_broadcast_id(streamer_login):
    from claim_bonus import post_gql_request  # circular imports
    json_data = {"operationName": "WithIsStreamLiveQuery",
                 "variables": {"id": get_channel_id(streamer_login)},
                 "extensions": {"persistedQuery": {"version": 1,
                                                   "sha256Hash": "04e46329a6786ff3a81c01c50bfa5d725902507a0deb83b0edbf7abe7a3716ea"}}}
    response = post_gql_request(json_data)
    stream = response["data"]["user"]["stream"]
    if stream is not None:
        return stream["id"]
    else:
        raise StreamerIsOfflineException