Clubhouse API written in Python. Standalone client included. For reference and education purposes only.

Overview

Clubhouse API written in Python

FOR REFERENCE AND EDUCATION PURPOSES ONLY. THIS DOES NOT COME WITH ANY KINDS OF WARRANTY.

clubhouse-py is originally developed for the sake of interoperability.

Standalone client is also created with very basic features, including but not limited to the audio-chat.

Please note that you may get a permanent ban for sending invalid API requests. Server's ratelimit and security mechanisms are quite strict.

Demo

Please click the image to open a Youtube video demo.

IMAGE ALT TEXT HERE

Requirements

  • Windows or OSX
  • Python 3.7 or higher

Installation

  1. You need to install dependencies first.
$ pip3 install -r requirements.txt
  1. You need to install Agora SDK for voice communication. Refer to Agora-Python-SDK#installation.

Usage

  • For calling APIs from other script
from clubhouse import Clubhouse

...

if __name__ == "__main__":
    clubhouse = Clubhouse()
  • For running a standalone client
$ python3 cli.py

Supported features

Pre-authentication

  • def start_phone_number_auth(self, phone_number):
  • def call_phone_number_auth(self, phone_number):
  • def resend_phone_number_auth(self, phone_number):
  • def complete_phone_number_auth(self, phone_number, verification_code):
  • def check_for_update(self, is_testflight=False):

Post-authentication

  • def get_release_notes(self):
  • def check_waitlist_status(self):
  • def add_email(self, email):
  • def update_photo(self, photo_filename):
  • def follow(self, user_id, user_ids=None, source=4, source_topic_id=None):
  • def unfollow(self, user_id):
  • def block(self, user_id):
  • def unblock(self, user_id):
  • def follow_multiple(self, user_ids, user_id=None, source=7, source_topic_id=None):
  • def follow_club(self, club_id, source_topic_id=None):
  • def unfollow_club(self, club_id, source_topic_id=None):
  • def update_follow_notifications(self, user_id, notification_type=2):
  • def get_suggested_follows_similar(self, user_id):
  • def get_suggested_follows_friends_only(self, club_id=None, upload_contacts=True, contacts=()):
  • def get_suggested_follows_all(self, in_onboarding=True, page_size=50, page=1):
  • def ignore_suggested_follow(self, user_id):
  • def get_event(self, event_id, user_ids=None, club_id=None, is_member_only=False, event_hashid=None, description=None, time_start_epoch=None, name=None):
  • def create_event(self, name, time_start_epoch, description, event_id=None, user_ids=(), club_id=None, is_member_only=False, event_hashid=None):
  • def edit_event(self, name, time_start_epoch, description, event_id=None, user_ids=(), club_id=None, is_member_only=False, event_hashid=None):
  • def delete_event(self, event_id, user_ids=None, club_id=None, is_member_only=False, event_hashid=None, description=None, time_start_epoch=None, name=None):
  • def get_events(self, is_filtered=True, page_size=25, page=1):
  • def get_club(self, club_id, source_topic_id=None):
  • def get_club_members(self, club_id, return_followers=False, return_members=True, page_size=50, page=1):
  • def get_settings(self):
  • def get_welcome_channel(self):
  • def hide_channel(self, channel, hide=True):
  • def join_channel(self, channel, attribution_source="feed"):
  • def leave_channel(self, channel):
  • def make_channel_public(self, channel, channel_id=None):
  • def make_channel_social(self, channel, channel_id=None):
  • def end_channel(self, channel, channel_id=None):
  • def make_moderator(self, channel, user_id):
  • def block_from_channel(self, channel, user_id):
  • def get_profile(self, user_id):
  • def me(self, return_blocked_ids=False, timezone_identifier="Asia/Tokyo", return_following_ids=False):
  • def get_following(self, user_id, page_size=50, page=1):
  • def get_followers(self, user_id, page_size=50, page=1):
  • def get_mutual_follows(self, user_id, page_size=50, page=1):
  • def get_all_topics(self):
  • def get_channels(self):
  • def get_channel(self, channel, channel_id=None):
  • def active_ping(self, channel):
  • def audience_reply(self, channel, raise_hands=True, unraise_hands=False):
  • def change_handraise_settings(self, channel, is_enabled=True, handraise_permission=1):
  • def update_skintone(self, skintone=1):
  • def get_notifications(self, page_size=20, page=1):
  • def get_actionable_notifications(self):
  • def get_online_friends(self):
  • def accept_speaker_invite(self, channel, user_id):
  • def reject_speaker_invite(self, channel, user_id):
  • def invite_speaker(self, channel, user_id):
  • def uninvite_speaker(self, channel, user_id):
  • def mute_speaker(self, channel, user_id):
  • def get_suggested_speakers(self, channel):
  • def create_channel(self, topic="", user_ids=(), is_private=False, is_social_mode=False):
  • def get_create_channel_targets(self):
  • def get_suggested_invites(self, club_id=None, upload_contacts=True, contacts=()):
  • def get_suggested_club_invites(self, upload_contacts=True, contacts=()):
  • def invite_to_app(self, name, phone_number, message=None):
  • def invite_from_waitlist(self, user_id):
  • def search_users(self, query, followers_only=False, following_only=False, cofollows_only=False):
  • def search_clubs(self, query, followers_only=False, following_only=False, cofollows_only=False):
  • def get_topic(self, topic_id):
  • def get_clubs_for_topic(self, topic_id, page_size=25, page=1):
  • def get_clubs(self, is_startable_only):
  • def get_users_for_topic(self, topic_id, page_size=25, page=1):
  • def invite_to_existing_channel(self, channel, user_id):
  • def update_username(self, username):
  • def update_name(self, name):
  • def update_twitter_username(self, username, twitter_token, twitter_secret):
  • def update_instagram_username(self, code):
  • def update_displayname(self, name):
  • def refresh_token(self, refresh_token):
  • def update_bio(self, bio):
  • def record_action_trails(self, action_trails=()):
  • def add_user_topic(self, club_id, topic_id):
  • def remove_user_topic(self, club_id, topic_id):
  • def report_incident(self, user_id, channel, incident_type, incident_description, email):
  • def reject_welcome_channel(self):
  • def update_channel_flags(self, channel, visibility, flag_title, unflag_title):
  • def ignore_actionable_notification(self, actionable_notification_id):
  • def invite_to_new_channel(self, user_id, channel):
  • def accept_new_channel_invite(self, channel_invite_id):
  • def reject_new_channel_invite(self, channel_invite_id):
  • def cancel_new_channel_invite(self, channel_invite_id):
  • def add_club_admin(self, club_id, user_id):
  • def remove_club_admin(self, club_id, user_id):
  • def remove_club_member(self, club_id, user_id):
  • def accept_club_member_invite(self, club_id, source_topic_id=None):
  • def add_club_member(self, club_id, user_id, name, phone_number, message, reason):
  • def get_club_nominations(self, club_id, source_topic_id):
  • def approve_club_nomination(self, club_id, source_topic_id, invite_nomination_id):
  • def reject_club_nomination(self, club_id, source_topic_id, invite_nomination_id):
  • def add_club_topic(self, club_id, topic_id):
  • def remove_club_topic(self, club_id, topic_id):
  • def get_events_to_start(self):
  • def update_is_follow_allowed(self, club_id, is_follow_allowed=True):
  • def update_is_membership_private(self, club_id, is_membership_private):
  • def update_is_community(self, club_id, is_community):
  • def update_club_description(self, club_id, description):

Unsupported features

Endpoints

  • def update_club_rules(self):
  • def update_club_topics(self):
  • def get_events_for_user(self):

PubNub

PubNub is used for the notification while being in a conversation. This has not been implemented yet. However, you may utilize the PubSub keys provided in the sourcecode to implement this.

Reference

You may also add more endpoints and features based on the following repositories.

Please note that these repositories were partially referenced to create this project.

Most of things were tested and handcrafted from scratch.

Comments
  • The room not available

    The room not available

    Hey! I try to connect to room with channel name from the link, but get that message: {'success': False, 'error_message': 'That room is no longer available ๐Ÿ‘‹๐Ÿผ\nTry starting a new one instead?'} And my friends with iOS can get access to that room. I don't understand why it happened.

    question 
    opened by myxomor 5
  • Can't enter the room

    Can't enter the room

    Hi, thanks for the work. After I launched the client and authorized by sms code and tried to enter a particular room the following error occurred:

    zsh: killed     python3 cli.py
    

    I think it has to do with permissions. Can you help?

    duplicate 
    opened by ttoktassynov 2
  • req.json() is a weak point

    req.json() is a weak point

    I really don't like the part with

    req = requests.post(smth)
    return req.json()
    

    It can cause so many problems, server can return 50* and it will break .json() method, server can theoretically return "bad" json and so on.

    What do you think about idea to at least start validating response headers, or (better!) check if server response is a correct JSON. I can make a PR if you approve the idea.

    enhancement 
    opened by yegorov-p 2
  • Is it possible to get ban by sending requests to same endpoint repeatedly in range of 5-7 seconds?

    Is it possible to get ban by sending requests to same endpoint repeatedly in range of 5-7 seconds?

    Thank you for your work!

    I want to make a auto-updating subscriber counter in my bio, like "now i have N subscribers". As README says:

    Please note that you may get a permanent ban for sending invalid API requests. Server's ratelimit and security mechanisms are quite strict.

    I just want to know it it's safe to do this. Have you ever been banned? If so, how often were the requests sent? I want to update my bio every 5-10 seconds. Is it safe?

    question 
    opened by samohovets 2
  • How can i invite someone?

    How can i invite someone?

    I saw some functions with invite and comment: " Invite users to app. but this only works when you have a leftover invitation.". So what I need to do?

    question 
    opened by richard-undex 1
  • Signup error - Method

    Signup error - Method "GET" not allowed

    python3 cli.py

    1 )In docker with different version of python (3.6, 3.7, 3.8, 3.9). I don't understand why it's happening - because it's requests.post request :

    Please enter your phone number. (+818043217654) > +79099028132
    {'detail': 'Method "GET" not allowed.'}
    [-] Error occured during authentication. (None)
    
    1. On OSX 11, using python3.9 I'm getting HTTPSConnectionPool(host='www.clubhouseapi.com', port=443): Max retries exceeded with url: /api/start_phone_number_auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

    2. On OSX using app for requests, like - Insomnia - all working fine.

    Anyone have thoughts why it may happen with python? I tried installing requests[security] - but it's didn't helped either

    bug invalid 
    opened by 0x366 1
  • Profile pic upload

    Profile pic upload

    Is there currently a way to upload and update a profile pic? If so - do we need to upload it to a certain S3 bucket, or which API requests are available for this? If it's not yet implemented - are you planning on doing so?

    question 
    opened by mnb3000 1
  • /get_event example?

    /get_event example?

    Hello!

    Can anyone explain how /get_event method works? Let's say I have a link to event: https://www.joinclubhouse.com/event/abcdef I am trying to get link to the room from that event (yes, the event has already started and room exists). I thought that abcdef is an event_id, but calling .get_event(event_id='abcdef') returns 500 error from server.

    question 
    opened by yegorov-p 1
  • Is there any option to sign-up using invite code?

    Is there any option to sign-up using invite code?

     python3 cli.py
    [.] Please enter your phone number. (+818043217654) > +12345678900
    [.] Please enter the SMS verification code (1234, 0000, ...) > 0000
    [.] Writing configuration file complete.
    [!] You're still on the waitlist. Find your friends to get yourself in.
    Traceback (most recent call last):
      File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 326, in <module>
        main()
      File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 323, in main
        main()
      File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 319, in main
        chat_main(client)
      File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 150, in chat_main
        print_channel_list(client, max_limit)
      File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 83, in print_channel_list
        channels = client.get_channels()['channels']
    KeyError: 'channels'```
    question 
    opened by tandav 1
  • Headers conflict

    Headers conflict

    • [x] Extract headers per instance

      • This code can help to use multi account from this class as multi instance.
      • Before this only one account can be used because the dictionary(HEADERS) as an attribute of class has the same value for all instances.
      • Therefore, the auth specific to each instance cannot be stored separately.
    • [x] Add custom header

      • Custom header as class parameter can be used when user saved Headers.
    opened by mahdizojaji 0
Releases(v434.0.1)
  • v434.0.1(Jun 28, 2021)

    • Fixed the dict copy bug to support multi account authentications
    • Added additional comments, typo fixes

    Also available at pypi: https://pypi.org/project/clubhouse-py/434.0.1/

    Source code(tar.gz)
    Source code(zip)
  • v434(Jun 23, 2021)

  • 304.0.1(Feb 21, 2021)

  • v304(Feb 16, 2021)

    Built by using PyInstaller. Works on my system.

    All dependencies are included so you do not need to install extra files.

    Clubhouse CLI is currently tested on both Windows and OSX. However, it may not be stable enough to use as a standard client.

    There are some known bugs here and there, but I might plan to fix these issues sometime in the future,

    FOR REFERENCE AND EDUCATION PURPOSES ONLY. THIS DOES NOT COME WITH ANY KINDS OF WARRANTY.

    Installation Notes for OSX

    WARNING: This is purely experimental and tested only on my system. It may not work on your system. Don't blame me for it.

    Installation

    1. Download clubhouse-v304-x86_64-darwin

    2. Run terminal and give exec permission chmod +x ./clubhouse-v304-x86_64-darwin

    3. Run the application. ./clubhouse-v304-x86_64-darwin

    Notes

    1. Hotkey will not work in OSX due to security restrictions. You need to run the application. with sudo ./clubhouse-v304-x86_64-darwin
    Source code(tar.gz)
    Source code(zip)
    clubhouse-v304-x86_64-darwin(15.26 MB)
    clubhouse-v304.exe(23.11 MB)
Owner
security engineer. but don't trust my code. always writing broken codes with a bad quality
Gdrive-python: A wrapping module in python of gdrive

gdrive-python gdrive-python is a wrapping module in python of gdrive made by @pr

Vittorio Pippi 3 Feb 19, 2022
Github action for automatically determine the version for next release by using repository tags

This action will automatically determine the version for next release by using repository tags

Igor Gov 7 Oct 25, 2022
Programmeertheorie 2022 - Team Trainspotters - RailNL

Trainspotters Vak: Programmeertheorie 2022 Gekozen case: RailNL Teamnaam: Trainspotters Studenten: Mijntje Meijer, Sam Bijhouwer, Maik Larooij To-do's

Maik Larooij 1 Jan 25, 2022
DevSecOps pipeline for Python based web app using Jenkins, Ansible, AWS, and open-source security tools and checks.

DevSecOps pipeline for Python Web App A Jenkins end-to-end DevSecOps pipeline for Python web application, hosted on AWS Ubuntu 20.04 Note: This projec

Devanshu Vashishtha 4 Aug 15, 2022
A slack bot that notifies you when a restaurant is available for orders

Slack Wolt Notifier A Slack bot that notifies you when a Wolt restaurant or venue is available for orders. How does it work? Slack supports bots that

Gil Matok 8 Oct 24, 2022
Melissa Songs is a telegram bot to easily find songs sending music snippets and search tracks ๐Ÿ’ƒ๐Ÿฝ๐ŸŽต

Find songs on Telegram, like on Shazam... ๐Ÿ˜Ž Open on telegram ยท Report Bug ยท Request Feature โฌ‡๏ธ Installation To get a local copy installed and working

Joaquim Roque 21 Nov 10, 2022
A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages.

Footer-Bot A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages. Best for Telegram Movie Channels. Made by @AbirH

Abir Hasan 35 Jan 02, 2023
This is a Discord script that will provide a QR Code to your scholars for Axie Infinity.

DiscordQRCodeBot This is a Discord script that will provide a QR Code to your Axie Infinity scholars. Setup Run Ubuntu on AWS ec2 instance Dowloads al

ZracheSs | xyZ 24 Oct 05, 2022
A python API for BSCScan (Binance Smart Chain Explorer), available on PyPI.

bscscan-python A complete Python API for BscScan.com, available on PyPI. Powered by BscScan.com APIs. This is a gently modified fork of the etherscan-

Panagiotis Kotsias 246 Dec 31, 2022
KalmanFilterExercise - A Kalman Filter is a algorithmic filter that is used to estimate the state of an unknown variable

Kalman Filter Exercise What are Kalman Filters? A Kalman Filter is a algorithmic

4 Feb 26, 2022
Reddit bot that uses sentiment analysis

Reddit Bot Project 2: Neural Network Boogaloo Reddit bot that uses sentiment analysis from NLTK.VADER WIP_WIP_WIP_WIP_WIP_WIP Link to test subreddit:

TpK 1 Oct 24, 2021
NekoRobot-2 - Neko is An Anime themed advance Telegram group management bot.

NekoRobot A modular telegram Python bot running on python3 with an sqlalchemy, mongodb database. โ•’โ•โ•โ•ใ€Œ Status ใ€ Maintained Support Group Included Free

Lovely Boy 19 Nov 12, 2022
An API wrapper for Henrik's Unofficial VALORANT API

ValorantAPI.py An API wrapper for Henrik's Unofficial VALORANT API Warning!! This project is still in beta and only contains barely anything yet. If y

Jakkaphat Chalermphanaphan 0 Feb 04, 2022
Python 3 SDK/Wrapper for Huobi Crypto Exchange Api

This packages intents to be an idiomatic PythonApi wrapper for https://www.huobi.com/ Huobi Api Doc: https://huobiapi.github.io/docs Showcase TODO Con

3 Jul 28, 2022
TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)

TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)

Crypto Trader 1 Jan 06, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
Yes, it's true :purple_heart: This repository has 353 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

510 Dec 28, 2022
Discord bot to display private leaderboards for Advent of Code.

Advent Of Code Discord Bot Discord bot for displaying Advent of Code private leardboards, as well as custom leaderboards where participants can set th

The Future Gadgets Lab 6 Nov 29, 2022
Irenedao-nft-generator - Original scripts used to generate IreneDAO NFTs

IreneDAO NFT Generator Scripts to generate IreneDAO NFT. Make sure you have Pill

libevm 60 Oct 27, 2022
Group Chat Spammer For Discord

Group Chat Spammer For Discord Free and public gc spammer

Dreamy 20 Dec 27, 2022