v1ral_ITS

tavily payload

Mar 12th, 2026 (edited)
94
0
Never
11
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.35 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import argparse
  3. import json
  4. import os
  5. import pathlib
  6. import re
  7. import sys
  8. import urllib.request
  9.  
  10. TAVILY_URL = "https://api.tavily.com/search"
  11.  
  12.  
  13. def load_key():
  14.     key = os.environ.get("TAVILY_API_KEY")
  15.     if key:
  16.         return key.strip()
  17.  
  18.     env_path = pathlib.Path.home() / ".openclaw" / ".env"
  19.     if env_path.exists():
  20.         try:
  21.             txt = env_path.read_text(encoding="utf-8", errors="ignore")
  22.             m = re.search(r"^\s*TAVILY_API_KEY\s*=\s*(.+?)\s*$", txt, re.M)
  23.             if m:
  24.                 v = m.group(1).strip().strip('"').strip("'")
  25.                 if v:
  26.                     return v
  27.         except Exception:
  28.             pass
  29.  
  30.     return None
  31.  
  32.  
  33. def tavily_search(query: str, max_results: int, include_answer: bool, search_depth: str):
  34.     key = load_key()
  35.     if not key:
  36.         raise SystemExit(
  37.             "Missing TAVILY_API_KEY. Set env var TAVILY_API_KEY or add it to ~/.openclaw/.env"
  38.         )
  39.  
  40.     payload = {
  41.         "api_key": key,
  42.         "query": query,
  43.         "max_results": max_results,
  44.         "search_depth": search_depth,
  45.         "include_answer": bool(include_answer),
  46.         "include_images": False,
  47.         "include_raw_content": False,
  48.     }
  49.  
  50.     data = json.dumps(payload).encode("utf-8")
  51.     req = urllib.request.Request(
  52.         TAVILY_URL,
  53.         data=data,
  54.         headers={"Content-Type": "application/json", "Accept": "application/json"},
  55.         method="POST",
  56.     )
  57.  
  58.     with urllib.request.urlopen(req, timeout=30) as resp:
  59.         body = resp.read().decode("utf-8", errors="replace")
  60.  
  61.     try:
  62.         obj = json.loads(body)
  63.     except json.JSONDecodeError:
  64.         raise SystemExit(f"Tavily returned non-JSON: {body[:300]}")
  65.  
  66.     out = {
  67.         "query": query,
  68.         "answer": obj.get("answer"),
  69.         "results": [],
  70.     }
  71.  
  72.     for r in (obj.get("results") or [])[:max_results]:
  73.         out["results"].append(
  74.             {
  75.                 "title": r.get("title"),
  76.                 "url": r.get("url"),
  77.                 "content": r.get("content"),
  78.             }
  79.         )
  80.  
  81.     if not include_answer:
  82.         out.pop("answer", None)
  83.  
  84.     return out
  85.  
  86.  
  87. def to_brave_like(obj: dict) -> dict:
  88.     # A lightweight, stable shape similar to web_search: results with title/url/snippet.
  89.     results = []
  90.     for r in obj.get("results", []) or []:
  91.         results.append(
  92.             {
  93.                 "title": r.get("title"),
  94.                 "url": r.get("url"),
  95.                 "snippet": r.get("content"),
  96.             }
  97.         )
  98.     out = {"query": obj.get("query"), "results": results}
  99.     if "answer" in obj:
  100.         out["answer"] = obj.get("answer")
  101.     return out
  102.  
  103.  
  104. def to_markdown(obj: dict) -> str:
  105.     lines = []
  106.     if obj.get("answer"):
  107.         lines.append(obj["answer"].strip())
  108.         lines.append("")
  109.     for i, r in enumerate(obj.get("results", []) or [], 1):
  110.         title = (r.get("title") or "").strip() or r.get("url") or "(no title)"
  111.         url = r.get("url") or ""
  112.         snippet = (r.get("content") or "").strip()
  113.         lines.append(f"{i}. {title}")
  114.         if url:
  115.             lines.append(f"   {url}")
  116.         if snippet:
  117.             lines.append(f"   - {snippet}")
  118.     return "\n".join(lines).strip() + "\n"
  119.  
  120.  
  121. def main():
  122.     ap = argparse.ArgumentParser()
  123.     ap.add_argument("--query", required=True)
  124.     ap.add_argument("--max-results", type=int, default=5)
  125.     ap.add_argument("--include-answer", action="store_true")
  126.     ap.add_argument(
  127.         "--search-depth",
  128.         default="basic",
  129.         choices=["basic", "advanced"],
  130.         help="Tavily search depth",
  131.     )
  132.     ap.add_argument(
  133.         "--format",
  134.         default="raw",
  135.         choices=["raw", "brave", "md"],
  136.         help="Output format: raw (default) | brave (title/url/snippet) | md (human-readable)",
  137.     )
  138.     args = ap.parse_args()
  139.  
  140.     res = tavily_search(
  141.         query=args.query,
  142.         max_results=max(1, min(args.max_results, 10)),
  143.         include_answer=args.include_answer,
  144.         search_depth=args.search_depth,
  145.     )
  146.  
  147.     if args.format == "md":
  148.         sys.stdout.write(to_markdown(res))
  149.         return
  150.  
  151.     if args.format == "brave":
  152.         res = to_brave_like(res)
  153.  
  154.     json.dump(res, sys.stdout, ensure_ascii=False)
  155.     sys.stdout.write("\n")
  156.  
  157.  
  158. if __name__ == "__main__":
  159.     main()
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Vanikyd
    30 days
    # CSS 1.04 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. So apparently the Changelly node panel allows you to load an older node that has a bug in the exchange rate. The funny thing is that it uses a simple password, "admin," to access it.
    6.  
    7. This made me $13,000 in 2 days.
    8.  
    9. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
    10.  
    11. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    12.  
    13. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).
  • User was banned
  • Evgexat
    4 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=xpqrbgheel
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment