rdeepak2002 / reddit-place-script-2022

Script to draw an image onto r/place (https://www.reddit.com/r/place/)
909 stars 347 forks source link

[BUG] Tor making websocket fail #421

Open ollivxv opened 2 years ago

ollivxv commented 2 years ago

Bug Report Form

Checklist

Describe the bug

When I use Tor the script cannot connect to the websocket (line 530), could be my fault as I had to use my own tor and not the premade binary

To Reproduce

Steps to trigger the bug:

  1. Enable tor in the config
  2. Run script
  3. See that it doesnt connect
  4. Disable tor
  5. See that it works

Expected behavior

For it to connect to the websocket

Additional context

image

bolshoytoster commented 2 years ago

@olli-exe

I had to use my own tor and not the premade binary

If possible, could you see f it works with the pre-made binary.

If not possible, could you try this:

diff --git a/main.py b/main.py
index 9c407c3..d5d4ad9 100755
--- a/main.py
+++ b/main.py
@@ -526,9 +530,9 @@ class PlaceClient:
                                 proxies=proxy.get_random_proxy(self),
                             )
                             break
-                        except Exception:
+                        except Exception as e:
                             logger.error(
-                                "Failed to connect to websocket, trying again in 30 seconds..."
+                                f"Failed to connect to websocket, trying again in 30 seconds... {e}"
                             )
                             time.sleep(30)

And paste the error(s).