Skip to content

Commit fac861a

Browse files
committed
Fix: use END to finish JSON paste
1 parent 228bf0a commit fac861a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

add_bird.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def main():
6565
# ── 3. Get JSON from AI Studio ─────────────────────────────
6666
print()
6767
print("📋 Paste the JSON from AI Studio below.")
68-
print(" (Paste it, then press Enter twice to continue)\n")
68+
print(" When done, type END on a new line and press Enter.\n")
6969

7070
lines = []
7171
try:
7272
while True:
7373
line = input()
74-
if line == "" and lines and lines[-1] == "":
74+
if line.strip().upper() == "END":
7575
break
7676
lines.append(line)
7777
except EOFError:
@@ -80,11 +80,9 @@ def main():
8080
raw = "\n".join(lines).strip()
8181

8282
# Strip markdown code fences if AI Studio added them
83-
if raw.startswith("```"):
83+
if "```" in raw:
8484
raw = raw.split("```")[1]
85-
if raw.startswith("json"):
86-
raw = raw[4:]
87-
raw = raw.strip()
85+
raw = raw.lstrip("json").strip()
8886

8987
# ── 4. Parse & validate ────────────────────────────────────
9088
try:

0 commit comments

Comments
 (0)