mirror of
https://github.com/lukaszraczylo/mcp-captcharesolver.git
synced 2026-10-15 01:07:32 +00:00
feat(captcha): LLM text-image OCR solver with strict-retry
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package captcha
|
||||
|
||||
import "strings"
|
||||
|
||||
// extractJSON returns the first {...} JSON object found in s, or s unchanged.
|
||||
func extractJSON(s string) string {
|
||||
start := strings.Index(s, "{")
|
||||
end := strings.LastIndex(s, "}")
|
||||
if start >= 0 && end > start {
|
||||
return s[start : end+1]
|
||||
}
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user