Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/place comeback. #46

Open
Arsyad1105 opened this issue Apr 1, 2022 · 58 comments
Open

r/place comeback. #46

Arsyad1105 opened this issue Apr 1, 2022 · 58 comments

Comments

@Arsyad1105
Copy link

Hi, do you think this still works for new upcoming r/place? If yes I still don't understand on how to put pictures.

@jakubfabijan
Copy link

It throws error 403 in my case

@AggelosM
Copy link

AggelosM commented Apr 1, 2022

Can we resurrect this repo?
Unless there's a better one somewhere.

@VNGamerGit
Copy link

It throws error 403 in my case

you tried it out? and how did you get 403?

@leoherzog
Copy link

Happy to see I'm not the only person who immediately thought about this project again today.

@Raminios
Copy link

Raminios commented Apr 1, 2022

I suspect most of the BMP -> request mapping stuff could be repurposed, but the URLs etc. have been changed for this time.

This is a Powershell request sniffed out from the browser which worked. Bearer token redacted for obvious reasons.

$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$session.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36"
Invoke-WebRequest -UseBasicParsing -Uri "https://gql-realtime-2.reddit.com/query" `
-Method "POST" `
-WebSession $session `
-Headers @{
"method"="POST"
  "authority"="gql-realtime-2.reddit.com"
  "scheme"="https"
  "path"="/query"
  "sec-ch-ua"="`" Not A;Brand`";v=`"99`", `"Chromium`";v=`"99`", `"Google Chrome`";v=`"99`""
  "apollographql-client-name"="mona-lisa"
  "sec-ch-ua-mobile"="?0"
  "authorization"="Bearer [REDACTED]"
  "accept"="*/*"
  "apollographql-client-version"="0.0.1"
  "sec-ch-ua-platform"="`"Windows`""
  "origin"="https://hot-potato.reddit.com"
  "sec-fetch-site"="same-site"
  "sec-fetch-mode"="cors"
  "sec-fetch-dest"="empty"
  "referer"="https://hot-potato.reddit.com/"
  "accept-encoding"="gzip, deflate, br"
  "accept-language"="en-GB,en-US;q=0.9,en;q=0.8"
} `
-ContentType "application/json" `
-Body "{`"operationName`":`"setPixel`",`"variables`":{`"input`":{`"actionName`":`"r/replace:set_pixel`",`"PixelMessageData`":{`"coordinate`":{`"x`":170,`"y`":33},`"colorIndex`":31,`"canvasIndex`":0}}},`"query`":`"mutation setPixel(`$input: ActInput!) {\n  act(input: `$input) {\n    data {\n      ... on BasicMessage {\n        id\n        data {\n          ... on GetUserCooldownResponseMessageData {\n            nextAvailablePixelTimestamp\n            __typename\n          }\n          ... on SetPixelResponseMessageData {\n            timestamp\n            __typename\n          }\n          __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n`"}"

@MarsVard
Copy link

MarsVard commented Apr 1, 2022

config has changed as well, https://www.reddit.com/api/place/board-bitmap <= this doesn't point to the board anymore

@guffelman
Copy link

Looks like https://hot-potato.reddit.com/embed/ might be the new place board. Not sure how we can get the bitmap from there yet. I've been looking at the authentication.js file to see if I can modify it for the new Auth Model.

@AstroOrbis
Copy link

Is there a working fork or are we all patching the current repo?

@werdes
Copy link

werdes commented Apr 1, 2022

full bitmap is still loaded, but url seems to have some logic behind it.
https://hot-potato.reddit.com/media/canvas-images/1648827785838-0-f-8Fg292Lw.png

first part seems to be a unix timestamp,
second part (f = full, d = diff), f is always the full one, d has diff pixels

no idea for second part (0) or 4th part

@AstroOrbis
Copy link

Error it throws for me:

> reddit-placebot@1.1.0 start
> node src/run.js --harmony

node:internal/modules/cjs/loader:1174
    throw err;
    ^

SyntaxError: \reddit-placebot-master\users.json: Unexpected token } in JSON at position 45
    at parse (<anonymous>)
    at Object.Module._extensions..json (node:internal/modules/cjs/loader:1171:22)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\User\Desktop\reddit-placebot-master\src\run.js:12:15)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

node 16.14.2 LTS

Error it throws for me:

> reddit-placebot@1.1.0 start
> node src/run.js --harmony

node:internal/modules/cjs/loader:1174
    throw err;
    ^

SyntaxError: \reddit-placebot-master\users.json: Unexpected token } in JSON at position 45
    at parse (<anonymous>)
    at Object.Module._extensions..json (node:internal/modules/cjs/loader:1171:22)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\User\Desktop\reddit-placebot-master\src\run.js:12:15)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

node 16.14.2 LTS

That's a parse error in your users.json

@DeltaNeverUsed
Copy link

you probably have a , on the second last line of your users.json

@NamesMark
Copy link

NamesMark commented Apr 1, 2022

you probably have a , on the second last line of your users.json

Yeah, my bad. Now 403 for me also

Getting modhash and cookies for  ...
Unhandled rejection Error: Request failed with status code 403
    at createError (C:\Users\User\Desktop\reddit-placebot-master\node_modules\axios\lib\core\createError.js:15:15)
    at settle (C:\Users\User\Desktop\reddit-placebot-master\node_modules\axios\lib\core\settle.js:18:12)
    at IncomingMessage.handleStreamEnd (C:\Users\User\Desktop\reddit-placebot-master\node_modules\axios\lib\adapters\http.js:186:11)
    at IncomingMessage.emit (node:events:538:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

@AstroOrbis
Copy link

I feel like we should bring this to discord, friend me AstroOrbis#9797 and I'll create a group chat, something about GitHub issues is weird in short term conversations

@CicadaCinema
Copy link

CicadaCinema commented Apr 1, 2022

I'm starting over from scratch at this repo, small PRs appreciated (which would move us closer to the end goal).

https://github.com/CicadaCinema/place-bot

Current state: places a single pixel at the specified coordinates

@VNGamerGit
Copy link

all of this aside, anyone interested in an alliance?

@firefoxnightlymozzila
Copy link

soooo has anyone made a working fork

@AstroOrbis
Copy link

soooo has anyone made a working fork

We're working on it

@foxrumor
Copy link

foxrumor commented Apr 1, 2022

Can't wait!

@CicadaCinema
Copy link

I prefer working in the open - see https://github.com/CicadaCinema/place-bot/issues/1 for the current state of the attempt written in golang.

@OverDriveGain
Copy link

This repo uses old API of reddit. I think porting the same tool to the new API wouldn't be hard

@gavjan
Copy link

gavjan commented Apr 1, 2022

full bitmap is still loaded, but url seems to have some logic behind it. https://hot-potato.reddit.com/media/canvas-images/1648827785838-0-f-8Fg292Lw.png

@werdes where do you get this URL from?

@NotAProton
Copy link

@gavjan check the network tab in dev tools
image

@ImNotOnline
Copy link

So how is this coming?

@LiamTheNinja5
Copy link

So how is this coming?

give people some time coding is hard

@michaelshumshum
Copy link

michaelshumshum commented Apr 1, 2022

https://github.com/michaelshumshum/r-placer

here is my attempt. anybody who wants to help and knows python will be appreciated.

current state: logging in successful, account creation successful, adding pixels FAIL.

@rhozetta
Copy link

rhozetta commented Apr 1, 2022

https://github.com/michaelshumshum/r-placer

here is my attempt. anybody who wants to help and knows python will be appreciated.

current state: logging in successful, account creation successful, adding pixels FAIL.

if you need help with things like request links i can probably help

@LiamTheNinja5
Copy link

I don't know a lot about of coding but if I can help in anyway just let me know

@danr2c2
Copy link

danr2c2 commented Apr 1, 2022

Are these the right urls for adding pixels?

image

image

@michaelshumshum
Copy link

Are these the right urls for adding pixels?

image image

i know for certain the first one is. when you change a pixel, that url is the one that is posted to. it includes some payload data that corresponds to coordinates and color. though, i am not sure what that second one is.

@rsedxcftvgyhbujnkiqwe
Copy link

https://github.com/rdeepak2002/reddit-place-script-2022
This repo works successfully, using both the pull request from carlescufi plus a fix to the useragent.

The parameter headers={'User-agent': 'placebot001'} should be added to the requests.post line. I would add this info onto that page but I would like to bring attention to it here.

This bot is simplistic, however. It only iterates through the image and does not go back to fix pixels, and it overrides existing pixels, because it does not get any image data from the API. Is there any API call that will return the existing r/place image, so that it can be manipulated in code?

@Blazzycrafter
Copy link

i used burb to get a new api path....
the site api/login dont exist...
they used /login with out api...
and an anodet system oauth...

@MarsVard
Copy link

MarsVard commented Apr 2, 2022

@foco21
Copy link

foco21 commented Apr 2, 2022

someone should try forking this ?

@EntropyValley
Copy link

EntropyValley commented Apr 2, 2022

If anyone here wants to help improve the bot linked above (https://github.com/rdeepak2002/reddit-place-script-2022), there's a fork of that bot that includes pixel checking that just needs to be reimplemented on an updated fork (the fork dev says he doesn't want to PR and it's based on a much older version of the repo). We could really use a good python dev to look over the fork (https://github.com/DeltaNeverUsed/reddit-place-script-2022-get-board), then reimplement pixel checking from that fork into a new fork of the main repo (https://github.com/rdeepak2002/reddit-place-script-2022) and then PR it back in. I'm planning on working on it tomorrow if it's not already done, but that's a long ways away in the world of r/place.

edit: chrome did a weird and didn't update the url when I opened the fork. I updated the fork url with an actual url to the fork we need to implement back into the main repo

@dsf3449
Copy link

dsf3449 commented Apr 2, 2022

@rsedxcftvgyhbujnkiqwe
I've created an endpoint. Send a GET request to https://canvas.codes/canvas.

The expected response is:

{
    "ok": true,
    "url": "https://hot-potato.reddit.com/media/canvas-images/1648872350237-0-f-ryt2oirH.png"
}

Note: there is an optional ts field which may be returned if you are receiving a cached URL.

This URL is a raw 1000x1000 pixel image generated by Reddit's api within the past 10 seconds.

@MarsVard
Copy link

MarsVard commented Apr 2, 2022

@dsf3449

I'm getting Internal server error

@dsf3449
Copy link

dsf3449 commented Apr 2, 2022

@MarsVard Oops, sorry, oversight on my end. Should be good now!

@Glass47
Copy link

Glass47 commented Apr 2, 2022

Can someone make GUI version of this for noobs? I will pay 10$ i just want to have fun!

@vesk4000
Copy link

vesk4000 commented Apr 2, 2022

If someone can make the APIs work, I can probably make a pretty good GUI in something like Godot quite quickly. Does anyone want to collaborate? Is there a Discord or something like that, where we can work?

@Glass47
Copy link

Glass47 commented Apr 2, 2022

Hey @vesk4000 check this. Let me know if this can work for you to make GUI.
No need to be fancy shit just option to load specific image what bots should draw and repair if i select that option. Also i want support for adding multiple accounts easy and perhaps proxies so they don't get banned if they do IP detection. Or if they are not IP detected/shadowbanned then just compile without proxy support. But support for mutliple accounts. :)

@EntropyValley
Copy link

Honestly idk if it's such a good idea to build a GUI. While I'd ideally love for things to be as accessible as possible, we are working against an organization who has said that they don't want bots to exist, and so the easier access is, the more likely it's going to balloon to a point where they change the api and break things and/or start banning bot users more frequently. Imo, the way the linked bot repo works is pretty simple for people with even a bit of CLI or python experience, and so it's available to anyone willing to put in the effort to figure things out without being so available that it balloons out of control to a point where Reddit takes more action against us. If others feel differently, then go ahead, but this is just my worry haha

@Glass47
Copy link

Glass47 commented Apr 2, 2022

Honestly idk if it's such a good idea to build a GUI. While I'd ideally love for things to be as accessible as possible, we are working against an organization who has said that they don't want bots to exist, and so the easier access is, the more likely it's going to balloon to a point where they change the api and break things and/or start banning bot users more frequently. Imo, the way the linked bot repo works is pretty simple for people with even a bit of CLI or python experience, and so it's available to anyone willing to put in the effort to figure things out without being so available that it balloons out of control to a point where Reddit takes more action against us. If others feel differently, then go ahead, but this is just my worry haha

Understand your statement and i respect. Gonna spend some time setting this up so i can have fun..

@NoamikoT
Copy link

NoamikoT commented Apr 2, 2022

Sorry if this is not the place but is there a working product? really want to save my flag.

@MarsVard
Copy link

MarsVard commented Apr 2, 2022

@dsf3449 can you make your endpoint redirect to the bitmap instead? Or with a flag?

@gnhnjac
Copy link

gnhnjac commented Apr 2, 2022

Actually I've made a version that works! it fetches the background successfully using pypeteer and it successfully places pixels.
https://github.com/gnhnjac/rplace-bot
Happy for pull requests as there are still issues and it only works for 1 account currently.

@dsf3449
Copy link

dsf3449 commented Apr 2, 2022

Update to my endpoint (https://canvas.codes/canvas)

It will now return the following object:

{
    "ok": true,
    "url": "https://hot-potato.reddit.com/media/canvas-images/1648938881174-0-f-xonqAt69.png",
    "canvas_left": "https://hot-potato.reddit.com/media/canvas-images/1648938881174-0-f-xonqAt69.png",
    "canvas_right": "https://hot-potato.reddit.com/media/canvas-images/1648938881153-1-f-TXag23ti.png"
}

Where canvas_left refers to the left side of the board and canvas_right is the new section added today.

url is still included for backwards compatibility, but it's value is the same as canvas_left.

@Olmo-Gutierrez
Copy link

If someone can make the APIs work, I can probably make a pretty good GUI in something like Godot quite quickly. Does anyone want to collaborate? Is there a Discord or something like that, where we can work?

What's ur discord?

@Truedill1
Copy link

how do we do this boss

@gnhnjac
Copy link

gnhnjac commented Apr 3, 2022

can someone look at my code / does someone wanna collaborate? It successfully placed pixels and fetched the map for me so that’s big progress.

@smirea
Copy link

smirea commented Apr 3, 2022

Howdy! throwing my hat (bot) into the ring if y'all are interested: https://github.com/smirea/reddit-place-bot

It's all written in typescript and supports:

  • login with multiple account (username / password)
  • has a UI to design and export
  • downloads the current images and does not write pixels it doesn't have to (thanks @dsf3449 for the API!)

Feel free to use / submit PRs

@michaelshumshum
Copy link

Howdy! throwing my hat (bot) into the ring if y'all are interested: https://github.com/smirea/reddit-place-bot

It's all written in typescript and supports:

  • login with multiple account (username / password)
  • has a UI to design and export
  • downloads the current images and does not write pixels it doesn't have to (thanks @dsf3449 for the API!)

Feel free to use / submit PRs

did you have any of the rate limiting issues/banning issues? if so, how did you avoid it? accounts that i make within minutes get banned instantly.

@smirea
Copy link

smirea commented Apr 3, 2022

hmm i did not encounter any rate limiting issues yet, though i didn't do anything in particular to avoid it. just making sure to only send requests once the 5min cooldown has passed

@smirea
Copy link

smirea commented Apr 3, 2022

@dsf3449 any chance to update your api for the new 4 image format

@michaelshumshum
Copy link

@dsf3449 any chance to update your api for the new 4 image format

^ your end point is so much cleaner than doing it with the websockets

@MainGoldDragon
Copy link

What I love about this one is that in the readme it tells you EXACTLY how to set this up (well almost exactly). Every single other one just assumes you already have all the tools and programs installed and already know how to do all this stuff...... too bad this one doesn't work

@dsf3449
Copy link

dsf3449 commented Apr 3, 2022

@smirea @michaelshumshum Sorry, was afk for most of the day. The update is deploying now - give it 10 mins or so.

{
    "ok": true,
    "url": "https://hot-potato.reddit.com/media/canvas-images/1649023555283-0-f-zqwdpnN6.png",
    "canvas_left": "https://hot-potato.reddit.com/media/canvas-images/1649023555283-0-f-zqwdpnN6.png",
    "canvas_right": "https://hot-potato.reddit.com/media/canvas-images/1649023555132-1-f-tXHGLiDx.png",
    "quadrants": {
        "top_left": "https://hot-potato.reddit.com/media/canvas-images/1649023555283-0-f-zqwdpnN6.png",
        "top_right": "https://hot-potato.reddit.com/media/canvas-images/1649023555132-1-f-tXHGLiDx.png",
        "bottom_left": "https://hot-potato.reddit.com/media/canvas-images/1649023555514-2-f-bcJSoSFo.png",
        "bottom_right": "https://hot-potato.reddit.com/media/canvas-images/1649023555387-3-f-fO9iGlHq.png"
    },
    "ts": 1649023555
}

Again, previous url, canvas_left, and canvas_right are for backwards compatibility, the quadrants object should be used instead.

@ghost
Copy link

ghost commented Apr 4, 2022

@dsf3449 what is the 4th part of the link (bcJSoSFo)?

@ben221199
Copy link

ben221199 commented Apr 5, 2022

@dsf3449 what is the 4th part of the link (bcJSoSFo)?

I'm also interested. The other parts are:

  • timestamp
  • tag (0 for up left, 1 for up right, 2 for bottom left, 3 for bottom right)
  • type (d for difference, f for full)
  • ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests