MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / score

Function score

Scripts/ButSystem.py:13676–13695  ·  view source on GitHub ↗

score. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: c: Parameter. Returns: Varies.

(c)

Source from the content-addressed store, hash-verified

13674 else:
13675 filename = f"file_{fid}"
13676
13677 with open(stored_path, "wb") as f:
13678 while True:
13679 chunk = resp.read(64 * 1024)
13680 if not chunk:
13681 break
13682 size += len(chunk)
13683 if size > max_bytes:
13684 raise ValueError("GIF too large")
13685 f.write(chunk)
13686
13687 conn.execute("UPDATE dm_files SET stored_path=?, size=?, mime=?, filename=? WHERE id=?",
13688 (stored_path, int(size), mime, filename, fid))
13689 conn.execute("UPDATE dm_messages SET has_file=1 WHERE id=?", (dm_id,))
13690 return {"id": fid, "mime": mime, "filename": filename, "size": int(size), "stored_path": stored_path}
13691
13692def _dm_store_remote_gif(dm_id: int, gif_url: str) -> Dict[str, str]:
13693 """Download and store a remote GIF (or short MP4) as a DM attachment.
13694
13695 This enables an Instagram-like GIF picker that sends a URL rather than an uploaded file.
13696 We keep this intentionally strict for safety:
13697 - only http(s)
13698 - size cap

Callers

nothing calls this directly

Calls 1

_user_match_scoreFunction · 0.70

Tested by

no test coverage detected