spywiree-priv / translateimage

Google Translate Images for free in Go
MIT License
2 stars 1 forks source link

Response timeout #3

Closed Avey777 closed 5 months ago

Avey777 commented 6 months ago
(base) root@Jengro:~# curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
(base) root@Jengro:~# 

I can access Google normally, but running main.go keeps timeout

(base) root@Jengro:/home/jengro/dev/translateimage# go run example/main.go 
2024/04/29 12:34:19 playwright: timeout: Timeout 30000ms exceeded.
exit status 1
spywiree-priv commented 6 months ago

Use the package from the most recent commit, set translateimage.timeout to 0, and show the results.

Avey777 commented 6 months ago

No matter how long the timeout is set, running main.go still prompts for timeout. So far, I haven't succeeded once

spywiree-priv commented 6 months ago

I can't reproduce this problem unless I slow down my internet very much. So, send me your ping, internet speed and full console output from the example in the dev branch.

Avey777 commented 5 months ago
PS C:\Users\Administrator\Documents\Dev\translateimage> ping translate.google.pl

Pinging translate.google.pl [216.58.223.195] with 32 bytes of data:
Reply from 216.58.223.195: bytes=32 time=14ms TTL=118
Reply from 216.58.223.195: bytes=32 time=14ms TTL=118
Reply from 216.58.223.195: bytes=32 time=14ms TTL=118
Reply from 216.58.223.195: bytes=32 time=14ms TTL=118

Ping statistics for 216.58.223.195:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 14ms, Maximum = 14ms, Average = 14ms
PS C:\Users\Administrator\Documents\Dev\translateimage>

PS C:\Users\Administrator\Documents\Dev\translateimage> git branch
* dev
  main
PS C:\Users\Administrator\Documents\Dev\translateimage> go run .\example\main.go
2024/05/10 06:21:32 Driver and Firefox browser installed
2024/05/10 06:21:33 Playwright instance started
2024/05/10 06:21:33 Firefox instance started
2024/05/10 06:21:34 Created a new page
2024/05/10 06:21:35 Set the site URL to: https://translate.google.pl/?op=images&hl=en&sl=auto&tl=en
2024/05/10 06:22:06 playwright: timeout: Timeout 30000ms exceeded.
exit status 1
PS C:\Users\Administrator\Documents\Dev\translateimage>

This computer is in Ghana, and I think the network is very good. This problem shouldn't have occurred

spywiree-priv commented 5 months ago

I have written a draft patch. Please test it and send me the console output and the videos.zip file.

Avey777 commented 5 months ago

I have written a draft patch. Please test it and send me the console output and the videos.zip file.

https://tmp.link/f/663f285402799

PS C:\Users\Administrator\Documents\Dev\translateimage> go run .\example\main.go
2024/05/11 08:14:57 Driver and Firefox browser installed
2024/05/11 08:14:57 Playwright instance started
2024/05/11 08:14:57 Firefox instance started
2024/05/11 08:14:58 Created a new page
2024/05/11 08:15:00 Set the site URL to: https://translate.google.pl/?op=images&hl=en&sl=auto&tl=en
2024/05/11 08:15:31 playwright: timeout: Timeout 30000ms exceeded.
exit status 1
PS C:\Users\Administrator\Documents\Dev\translateimage>
spywiree-priv commented 5 months ago

I didn't mean the screen recording, but the videos.zip file, which contains recordings of the headless browser. After running these commands:

git clone https://github.com/spywiree/translateimage.git
cd translateimage
git checkout dev
cd example
go run .

the videos.zip file will be in the translateimage/example folder.

Avey777 commented 5 months ago

videos.zip

Avey777 commented 5 months ago

@spywiree-priv Found a solution?

spywiree-priv commented 5 months ago

I think so. Check now.

Avey777 commented 5 months ago

I think so. Check now.

Great, it can work now image