Spaces:
Paused
Paused
query
Browse files
app.py
CHANGED
|
@@ -54,13 +54,14 @@ import json
|
|
| 54 |
def request_product_id(shop_domain, product_key, url):
|
| 55 |
ENDPOINT = "https://gql.tokopedia.com/graphql/PDPGetLayoutQuery"
|
| 56 |
payload = {
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
| 64 |
}
|
| 65 |
headers = {
|
| 66 |
"Accept": "*/*",
|
|
|
|
| 54 |
def request_product_id(shop_domain, product_key, url):
|
| 55 |
ENDPOINT = "https://gql.tokopedia.com/graphql/PDPGetLayoutQuery"
|
| 56 |
payload = {
|
| 57 |
+
"operationName": "PDPGetLayoutQuery",
|
| 58 |
+
"variables": {
|
| 59 |
+
"shopDomain": shop_domain,
|
| 60 |
+
"productKey": product_key,
|
| 61 |
+
"layoutID": "",
|
| 62 |
+
"apiVersion": 1,
|
| 63 |
+
},
|
| 64 |
+
"query": "fragment ProductVariant on pdpDataProductVariant{errorCode parentID defaultChild children{productID}__typename}query PDPGetLayoutQuery($shopDomain:String,$productKey:String,$layoutID:String,$apiVersion:Float,$userLocation:pdpUserLocation,$extParam:String,$tokonow:pdpTokoNow,$deviceID:String){pdpGetLayout(shopDomain:$shopDomain,productKey:$productKey,layoutID:$layoutID,apiVersion:$apiVersion,userLocation:$userLocation,extParam:$extParam,tokonow:$tokonow,deviceID:$deviceID){requestID name pdpSession basicInfo{id:productID}components{name type position data{...ProductVariant__typename}__typename}__typename}}",
|
| 65 |
}
|
| 66 |
headers = {
|
| 67 |
"Accept": "*/*",
|