Zenaight commited on
Commit
0107e23
·
verified ·
1 Parent(s): a638e73

Upload 5 files

Browse files
Files changed (1) hide show
  1. main.py +11 -2
main.py CHANGED
@@ -26,13 +26,22 @@ async def forward_to_rumas(b64_str: str):
26
  "binaryString": "1111111011110011"
27
  }
28
  }
 
29
  try:
 
 
 
30
  async with httpx.AsyncClient(timeout=30) as client:
31
  resp = await client.post(RUMAS_API_URL, json=payload)
32
  resp.raise_for_status()
33
- # Optional: print or log resp.json()
 
 
 
 
 
34
  except Exception as e:
35
- print("RUMAS API error:", e)
36
 
37
  @app.get("/webhook") # verification
38
  def verify(
 
26
  "binaryString": "1111111011110011"
27
  }
28
  }
29
+ short = b64_str[:40] # first 40 chars for identification
30
  try:
31
+ print(f"[RUMAS] ➜ sending image ({len(b64_str)} bytes) "
32
+ f"preview='{short}…'")
33
+
34
  async with httpx.AsyncClient(timeout=30) as client:
35
  resp = await client.post(RUMAS_API_URL, json=payload)
36
  resp.raise_for_status()
37
+
38
+ body = resp.text
39
+ if len(body) > 200:
40
+ body = body[:200] + "…"
41
+ print(f"[RUMAS] ✔ {resp.status_code} {body}")
42
+
43
  except Exception as e:
44
+ print(f"[RUMAS] error while sending '{short}…' →", e)
45
 
46
  @app.get("/webhook") # verification
47
  def verify(