Skip to content
← Back to Community
How do you check if a repl exists?
Profile icon
h
has Hacker Plan
firefish

EDIT: I have found the answer by myself.

Here is a cut-down version of my code:

const f = require("node-fetch"); (async () => { await f("https://repl.it/@a/b") .then(res => console.log(res.status)); await f("https://repl.it/@firefish/haha-fetch-go-brrr") .then(res => console.log(res.status)); })();

Now, I am testing to see if a repl is private or not. I am expecting the output

404 200

but instead I get

403 403

Upon extracting the body of the response, I can see that it is the HTML of Cloudflare Error 1020 (which I happen to have an old screenshot of when repl.it showed the same error to everybody temporarily).
image

I can wget it from both repl.it and my host machine.
image

image

Otherwise, how do you check if a repl exists, or is private/non-existant?

Voters
Profile icon
programmeruser
Profile icon
Kookiez
Profile icon
DynamicSquid
Profile icon
firefish
Comments
hotnewtop
Profile icon
programmeruser

Hello, thanks to you, I can now post on repl talk! @firefish

Profile icon
firefish
Profile icon
programmeruser
Profile icon
firefish

@programmeruser oh you managed to do that? cool

Profile icon
RixTheTyrunt

...

Profile icon
programmeruser

@RixTheTyrunt you don't need to understand this

Profile icon
firefish

Ok, I found the answer to my own problem. It was the fact that the user agent being passed by node-fetch was deemed "untrustworthy", so all I had to do was replace the user agent with something as simple as Mozilla/5.0 and that did the trick.

Profile icon
Kookiez

There's 0 answers yet 4 upvotes. i bet amasad can answer this

Profile icon
firefish

@Kookiez ok i answered my own problem

Profile icon
Kookiez
Profile icon
firefish

@Kookiez because you are now part of the project, you are entitled to work on it

Profile icon
Kookiez

@firefish oh noes, i am supposed to work 2 hours a day on a multiplayer repl and on this while doing my own thing that i work 30 min a day and trying to catch up on schoolwork at the same time! yay? lol

Profile icon
firefish

@Kookiez ok lol maybe not then i'll find someone else FOR THE TIME BEING ;)

Profile icon
RixTheTyrunt

Maybe me?

Profile icon
firefish

@RixTheTyrunt yes i am definitely going to ask you to be part of a project that has been dead for 14 months

Profile icon
RixTheTyrunt

Link?