Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ If any JSON decoders errors are found, the `config.json` needs to be fixed. Make
{
"thread_delay": 2,
"unverified_place_frequency": false,
"column_wise": false,
"proxies": ["1.1.1.1:8080", "2.2.2.2:1234"],
"compact_logging": true
}
```

- thread_delay - Adds a delay between starting a new thread. Can be used to avoid ratelimiting.
- unverified_place_frequency - Sets the pixel place frequency to the unverified account limit.
- column_wise - If true, sets pixels column by column instead of row by row.
- proxies - Sets proxies to use for sending requests to reddit. The proxy used is randomly selected for each request. Can be used to avoid ratelimiting.
- compact_logging - Disables timer text until next pixel.
- Transparency can be achieved by using the RGB value (69, 42, 0) in any part of your image.
Expand Down
1 change: 1 addition & 0 deletions config_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"legacy_transparency": true,
"thread_delay": 2,
"unverified_place_frequency": false,
"column_wise": false,
"compact_logging": true,
"using_tor": false,
"tor_port": 1881,
Expand Down
30 changes: 24 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def __init__(self, config_path):
and self.json_data["legacy_transparency"] is not None
else True
)
self.column_wise = (
self.json_data["column_wise"]
if "column_wise" in self.json_data
and self.json_data["column_wise"] is not None
else False
)
proxy.Init(self)

# Color palette
Expand Down Expand Up @@ -345,13 +351,22 @@ def get_unset_pixel(self, x, y, index):
wasWaiting = False
time.sleep(index * self.delay_between_launches)

if x >= self.image_size[0]:
y += 1
x = 0
if self.column_wise:
if y >= self.image_size[1]:
x += 1
y = 0

if x >= self.image_size[0]:

if y >= self.image_size[1]:
x = 0
else:
if x >= self.image_size[0]:
y += 1
x = 0

if y >= self.image_size[1]:

y = 0
y = 0

if x == originalX and y == originalY and loopedOnce:
logger.info(
Expand Down Expand Up @@ -403,7 +418,10 @@ def get_unset_pixel(self, x, y, index):
x + self.pixel_x_start,
y + self.pixel_y_start,
)
x += 1
if self.column_wise:
y += 1
else:
x += 1
loopedOnce = True
return x, y, new_rgb

Expand Down