Skip to content

StarNumber12046/BeReal.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[BROKEN] BeReal.py

A Python API wrapper for BeReal

Caution

This uses only reverse-engineered code. I am not to be held responsible for any consequences of the use of this library. Your account may be banned, you might get ratelimited, use this with caution.

This library is currently in a broken state due to changes in the API. Please see rvaidun/befake#199

Installation

Warning

For now the project is NOT on pypi.

# Windows:
pip install git+https://github.com/StarNumber12046/BeReal.py

# Macos/Linux:
pip3 install git+https://github.com/StarNumber12046/BeReal.py

Features

  • Types
  • Semi-functioning eror handling

What I implemented

  • Current user profile
  • Feed
  • Friends enumeration
  • Friends profiles
  • RealMojis
  • Comments
  • FriendsOfFriends feed

What is on the roadmap

  • Actual error handling
  • Posting

Special thanks

Special thanks to macedonga with beunblurred for having already done part of the reverse engineering

Quick example

import BeReal, json

client = BeReal.client("+12345678901")
# Send and verify OTP
client.send_code()
otp = input("You should have received an authentication code. Please check your phone and enter it below.")
client.verify_code(otp)
# Initialize the client with BeReal-provided tokens
client.initialize_client()

# Save credentials
f = open("creds.json", "w")
f.write(json.dumps(client.save_session()))
f.close()

# Get logged in user
me = client.me()
print(f"Username: {me.username}")
for friend in me.friends:
    print(f"Friend: {friend.username}")

Pre-made examples

You can use my examples. Do it in this order:

  1. Example/auth.py (login)
  2. Example/example.py (actual data)
  3. (If the token expires) Example/refresh_token.py

Releases

No releases published

Packages

No packages published

Languages