Skip to content

Commit ed741c2

Browse files
committed
update
1 parent 269aa44 commit ed741c2

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ $ go mod tidy && go build -tags vi
6969
- github.com/kiasaki/ry
7070

7171
## Todo
72-
- x for disable certain AI mode.
72+
- x for disable certain AI mode.(Finished)
7373
- Change deamon mode to minimal browser mode for passing bot checking of ChatGPT.
7474

7575
## License

chatgpt.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,24 @@ func Chatgpt() {
100100
// channel_chatgpt <- "click_chatgpt"
101101
//}
102102

103-
page_chatgpt.MustElementX("//div[contains(text(), 'Stop generating')]")
103+
104+
//page_chatgpt.MustElementX("//div[contains(text(), 'Stop generating')]")
105+
page_chatgpt.MustElement("svg path[d='M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2z']")
106+
//fmt.Println("found creating icon")
104107
var regenerate_icon = false
108+
105109
for i := 1; i <= 60; i++ {
106-
if page_chatgpt.MustHas("svg path[d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15']") {
110+
//if page_chatgpt.MustHas("svg path[d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15']") {
111+
if page_chatgpt.MustHas("svg path[d='M7 11L12 6L17 11M12 18V7']") {
107112
regenerate_icon = true
113+
//fmt.Println("wait...")
108114
break
109115
}
110116
time.Sleep(1 * time.Second)
111117
}
112-
if regenerate_icon == true {
113-
answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group w-full')])[last()]").MustText()[7:]
118+
if regenerate_icon == true {
119+
answer := page_chatgpt.MustElementX("(//div[contains(@class, 'w-full text-token-text-primary')])[last()]").MustText()[7:]
120+
//answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group w-full')])[last()]").MustText()[7:]
114121
//answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group final-completion w-full')])[last()]").MustText()[7:]
115122
if strings.Contains(answer,
116123
"An error occurred. Either the engine you requested does not exist or there was another issue processing your request. If this issue persists please contact us through our help center at help.openai.com.") {

0 commit comments

Comments
 (0)