File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments