GithubHelp home page GithubHelp logo

torresflo / pyreal Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 25 KB

A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.

License: GNU General Public License v3.0

Python 100.00%
bereal python python-api api api-wrapper hidden-api wrapper

pyreal's Introduction

GitHub license PRs Welcome GitHub contributors GitHub issues

PyReal

A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.
Report a bug or request a feature

Table of Contents

Getting Started

For users, you can just download the latest release and run it! Following information are mainly for developers.

Prerequisites and dependencies

This repository is tested with Python 3.7+.

You should install PyReal in a virtual environment. If you're unfamiliar with Python virtual environments, check out the user guide. First, create a virtual environment with the version of Python you're going to use and activate it.

Then, you will need to install the dependencies of the project:

pip install -r requirements.txt

Installation

Follow the instructions above then clone the repo (git clone https:://github.com/torresflo/PyReal.git). You can now run main.py to test the API or just write your own application.

Usage

API

The API is currently in development.

The goal of the API is to be able to retrieve data from BeReal (read-only), it is not planned to add write features like posting a photo or creating a comment.

Here are the current implemented and planned features:

  • Past posted photos (Memories)
  • Profile and User info
  • Current Feed (Friends and Discovery)
  • Reactions (RealMojis)
  • Memories Video

Here is a small example of how to use the API:

from API.BeRealAPI import PyReal

pyReal = PyReal()
pyReal.connect(<phoneNumber>) # Process the connection

if pyReal.isConnected():
    # Retrieve connected user info in form of a ConfidentialUser object
    pyReal.getUserInfo()

    # Retrieve friends list in form of an array of User object
    pyReal.getFriends()
    # Retrieve friend suggestion list in form of an array of FriendSuggestion object
    pyReal.getFriendSuggestions()
    # Retrieve sent friend requests list in form of an array of FriendRequest object
    pyReal.getSentFriendRequests()
    # Retrieve received friend requests list in form of an array of FriendRequest object
    pyReal.getReceivedFriendRequests()
    
    # Retrieve memory list in form of an array of Memory object
    pyReal.getMemories()
    # Retrieve friends feed in form of an array of Post object
    pyReal.getFriendsFeed()
    # Retrieve discovery feed in form of an array of Post object
    pyReal.getDiscoveryFeed()

Application

A small application (main.py) can be used to access the features.

On the first launch, it will ask for your phone number in the E614 format: +[country code][number]. Then it will ask you to enter the OTP (one time password) that you will receive on this phone number. This will allow the program to retreive your token and establish the connection with BeReal under your account.

⚠️ Your token will be stored in saved\token.txt, do not share it!

With the current version, the program will automatically download all your posted photos (Memories). Images are stored in saved\photos and are composed of both the front and back photos of each post.

Troubleshooting

A common issue is to fail to send the phone number at the first step. This is usually due because quota was exceeded in the BeReal API. In this case, just retry until it works (it could take a couple of retry).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

pyreal's People

Contributors

torresflo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pyreal's Issues

Similar project: BeFake

I just wanted to let you (@torresflo and everyone else who might read this) know that there is https://github.com/notmarek/BeFake, which seems to do basically the same thing and – as of now – is more popular. I haven't looked at this project in much detail, but it made a nice and clean first impression on me. Maybe we (as in PyReal and BeFake) could join forces? :)

Invalid App Credential

When trying to get the OTP, I get the following error:

Exception: Error when sending the OTP request. Probably the quota is exceeded, try again.

When further inspecting the response, I get the following:

{'error': {'code': 400, 'message': 'INVALID_APP_CREDENTIAL', 'errors': [{'message': 'INVALID_APP_CREDENTIAL', 'domain': 'global', 'reason': 'invalid'}]}}

app crashes when entering phone number

hello, i tried using pyreal and it crashes when entering my phone number +(country code)(number) (+40703293192 <-- this is a random romanian number i wrote for eample) and it just crashes in the command line and i cannot screenshot the error that comes up for some miliseconds before it crashes.

send the phone number

Hi, nice work,
I tried many many times, it never worked :/

keep getting the error : " Exception: Error when sending the OTP request. Probably the quota is exceeded, try again."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.