-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_client.py
More file actions
30 lines (23 loc) · 830 Bytes
/
test_client.py
File metadata and controls
30 lines (23 loc) · 830 Bytes
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
import requests
from dotenv import load_dotenv
import os
from pathlib import Path
# Load .env from Server/.env relative to this script
env_path = Path(__file__).parent / "Server" / ".env"
load_dotenv(dotenv_path=env_path)
SERVER_URL = os.getenv("SERVER_URL")
if not SERVER_URL:
raise ValueError("SERVER_URL not found in Server/.env")
video_url = input("Enter YouTube video URL: ").strip()
user_instructions = input("Enter custom instructions: ").strip()
payload = {
"url": video_url,
"instructions": user_instructions,
}
response = requests.post(f"{SERVER_URL}/classify", json=payload)
print("\n--- RAW RESPONSE ---")
print(f"Status Code: {response.status_code}")
print(f"Headers: {dict(response.headers)}")
print(f"Body: {response.text}")
print(f"Data Type of body: {type(response.text)}")
print(response.text)