File size: 3,624 Bytes
f959aff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import requests
import json

url = "https://cdn.webook.com/"

headers = {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br, zstd",
    "Accept-Language": "en-US,en;q=0.9,ar;q=0.8",
    "Content-Type": "application/json",
    "Origin": "https://webook.com",
    "Referer": "https://webook.com/",
    "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
}

payload = {
    "query": """query getEventListing($lang:String,$limit:Int,$skip:Int,$where:EventFilter,$order:[EventOrder]){
        eventCollection(locale:$lang,limit:$limit,skip:$skip,where:$where,order:$order){
            total items{
                __typename sys{id}id title subtitle slug ticketingUrlSlug 
                image11{title sys{id publishedAt}url width height contentType}
                image31{title sys{id publishedAt}url width height contentType}
                startingPrice currencyCode 
                schedule{title openTitle openDateTime closeDateTime openScheduleText}
                isStreamingEvent zoneEntryIncluded streamingUrl buttonLabel cardButtonLabel 
                eventType buttonLink 
                zone{id slug title zoneLogo{title sys{id publishedAt}url width height contentType}
                sponsorLogo{title sys{id publishedAt}url width height contentType}} 
                location{title address city countryCode seactionHeader location{lat lon}
                banner{title sys{id publishedAt}url width height contentType} accessibility} 
                category{id title slug} isComingSoon organizationSlug 
                carousalCollection(limit:10){
                    items{title sys{id publishedAt}url width height contentType}
                }
            }
        }
    }""",
    "variables": {
        "order": ["order_ASC", "sys_publishedAt_DESC"],
        "lang": "ar-SA",
        "limit": 7,
        "skip": 0,
        "where": {
            "visibility_not": "private",
            "OR": [
                {"schedule": {"closeDateTime_exists": False}},
                {"schedule": {"closeDateTime_gte": "2025-05-28T22:00:00.000Z"}}
            ],
            "AND": [
                {},
                {},
                {
                    "OR": [
                        {"cmsTags": {"slug_in": ["football"]}}
                    ]
                },
                {},
                {},
                {
                    "OR": [
                        {
                            "schedule": {
                                "openDateTime_lte": "2025-05-29T20:59:59.999Z",
                                "closeDateTime_gte": "2025-05-28T21:00:00.000Z"
                            }
                        },
                        {
                            "schedule": {
                                "openDateTime_gte": "2025-05-28T21:00:00.000Z",
                                "openDateTime_lte": "2025-05-29T20:59:59.999Z"
                            }
                        },
                        {
                            "schedule": {
                                "openDateTime_lte": "2025-05-29T20:59:59.999Z",
                                "closeDateTime_exists": False
                            }
                        }
                    ]
                },
                {}
            ]
        }
    },
    "operationName": "getEventListing"
}

response = requests.post(url, headers=headers, json=payload)

print(f"Status Code: {response.status_code}")
print("Response JSON:")
print(json.dumps(response.json(), indent=2, ensure_ascii=False))