File size: 997 Bytes
bbd2266
 
6986487
 
eeef35e
 
 
 
 
 
 
 
 
6986487
413a6af
6e39f94
413a6af
6e39f94
413a6af
 
 
bbd2266
6e39f94
6986487
413a6af
6e39f94
413a6af
 
 
 
6e39f94
 
413a6af
 
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
import requests

BASE_URL = "https://amit0987-cookies-recever-api.hf.space"

sample_data = {
    "data": {
        "session": "test_session_123_from_script",
        "user": "test_user_abc_from_script",
        "expires": "2026-01-01"
    },
    "raw_cookies_string": "session=test_session_123_from_script; user=test_user_abc_from_script; expires=2026-01-01",
    "source_url": "https://script-test.com"
}

def post_cookies():
    try:
        response = requests.post(f"{BASE_URL}/save-cookies", json=sample_data, timeout=10)
        response.raise_for_status()
        print("[POST] ✅", response.json())
    except Exception as e:
        print("[POST] ❌", e)

def get_cookies():
    try:
        response = requests.get(f"{BASE_URL}/cookies", timeout=10)
        response.raise_for_status()
        print("[GET] ✅", response.json())
        return response.json()
    except Exception as e:
        print("[GET] ❌", e)

if __name__ == "__main__":
    # post_cookies()
    get_cookies()